Config constructor

Config({
  1. required String tenant,
  2. String? policy,
  3. required String clientId,
  4. String responseType = 'code',
  5. String? redirectUri,
  6. required String scope,
  7. bool webUseRedirect = false,
  8. String? responseMode,
  9. String? state,
  10. String? prompt,
  11. String? codeChallenge,
  12. String? codeChallengeMethod,
  13. String nonce = '12345',
  14. String tokenIdentifier = 'Token',
  15. String? clientSecret,
  16. String? resource,
  17. bool isB2C = false,
  18. String? customDomainUrlWithTenantId,
  19. String? loginHint,
  20. String? domainHint,
  21. String? codeVerifier,
  22. String? userAgent,
  23. bool isStub = false,
  24. Widget loader = const SizedBox(),
  25. AndroidOptions? aOptions,
  26. CacheLocation? cacheLocation,
  27. required GlobalKey<NavigatorState> navigatorKey,
  28. String? origin,
  29. Map<String, String> customParameters = const {},
  30. String? postLogoutRedirectUri,
})

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

Implementation

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