loginWithRedirect method

Future<void> loginWithRedirect({
  1. String? audience,
  2. String? redirectUrl,
  3. String? organizationId,
  4. String? invitationUrl,
  5. int? maxAge,
  6. Set<String>? scopes,
  7. Map<String, String> parameters = const {},
})

Redirects the user to Auth0 Universal Login to log into the app.

Additional notes:

  • Use redirectUrl to tell Auth0 where to redirect back to once the user has logged in. This URL must be registered in your Auth0 application settings under Allowed Callback URLs. See the Auth0 docs to learn more. Note: While this property is optional, you would normally want to set this explicitly unless you have configured a default route.
  • audience relates to the API Identifier you want to reference in your access tokens. See API settings to learn more.
  • scopes defaults to openid profile email. You can override these scopes, but openid is always requested regardless of this setting.
  • If you want to log into a specific organization, provide the organizationId. Provide invitationUrl if a user has been invited to join an organization.
  • Arbitrary parameters can be specified and then picked up in a custom Auth0 Action or Rule.

Implementation

Future<void> loginWithRedirect(
        {final String? audience,
        final String? redirectUrl,
        final String? organizationId,
        final String? invitationUrl,
        final int? maxAge,
        final Set<String>? scopes,
        final Map<String, String> parameters = const {}}) =>
    Auth0FlutterWebPlatform.instance.loginWithRedirect(LoginOptions(
        audience: audience,
        redirectUrl: redirectUrl,
        organizationId: organizationId,
        invitationUrl: invitationUrl,
        scopes: scopes ?? {},
        idTokenValidationConfig: IdTokenValidationConfig(maxAge: maxAge),
        parameters: parameters));