Config constructor Null safety

Config(
  1. {required String tenant,
  2. String? policy,
  3. required String clientId,
  4. String responseType = 'code',
  5. required String redirectUri,
  6. required String scope,
  7. String? responseMode,
  8. String? state,
  9. String? prompt,
  10. String? codeChallenge,
  11. String? codeChallengeMethod,
  12. String nonce = '12345',
  13. String tokenIdentifier = 'Token',
  14. String? clientSecret,
  15. String? resource,
  16. bool isB2C = false,
  17. String? loginHint,
  18. String? domainHint,
  19. String? codeVerifier,
  20. String? userAgent,
  21. bool isStub = false,
  22. AndroidOptions? aOptions,
  23. required GlobalKey<NavigatorState> navigatorKey}
)

Azure AD OAuth Configuration. Look at individual fields for description.

Implementation

Config({
  required this.tenant,
  this.policy,
  required this.clientId,
  this.responseType = 'code',
  required this.redirectUri,
  required this.scope,
  this.responseMode,
  this.state,
  this.prompt,
  this.codeChallenge,
  this.codeChallengeMethod,
  this.nonce = '12345',
  this.tokenIdentifier = 'Token',
  this.clientSecret,
  this.resource,
  this.isB2C = false,
  this.loginHint,
  this.domainHint,
  this.codeVerifier,
  this.userAgent,
  this.isStub = false,
  AndroidOptions? aOptions,
  required this.navigatorKey,
})  : authorizationUrl = isB2C
          ? 'https://$tenant.b2clogin.com/$tenant.onmicrosoft.com/$policy/oauth2/v2.0/authorize'
          : 'https://login.microsoftonline.com/$tenant/oauth2/v2.0/authorize',
      tokenUrl = isB2C
          ? 'https://$tenant.b2clogin.com/$tenant.onmicrosoft.com/$policy/oauth2/v2.0/token'
          : 'https://login.microsoftonline.com/$tenant/oauth2/v2.0/token',
      aOptions = aOptions ?? AndroidOptions(encryptedSharedPreferences: true);