loginWithRedirect method
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 toopenid profile email
. You can override these scopes, butopenid
is always requested regardless of this setting.- If you want to log into a specific organization, provide the
organizationId
. ProvideinvitationUrl
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));