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? customAuthorizationUrl,
  19. String? customTokenUrl,
  20. String? customDomainUrlWithTenantId,
  21. String? loginHint,
  22. String? domainHint,
  23. String? codeVerifier,
  24. String? userAgent,
  25. bool isStub = false,
  26. Widget loader = const SizedBox(),
  27. AndroidOptions? aOptions,
  28. CacheLocation? cacheLocation,
  29. required GlobalKey<NavigatorState> navigatorKey,
  30. String? origin,
  31. Map<String, String> customParameters = const {},
  32. String? postLogoutRedirectUri,
  33. PreferredSizeWidget? appBar,
  34. dynamic onPageFinished(
    1. String url
    )?,
})

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.customAuthorizationUrl,
  this.customTokenUrl,
  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 {},
  this.postLogoutRedirectUri,
  this.appBar,
  this.onPageFinished,
})  : authorizationUrl = customAuthorizationUrl ??
          (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 = customTokenUrl ??
          (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'),
      aOptions = aOptions ?? AndroidOptions(encryptedSharedPreferences: true),
      cacheLocation = cacheLocation ?? CacheLocation.localStorage,
      redirectUri = redirectUri ?? getDefaultRedirectUri();