loginWithRedirect method
Redirects the user to Auth0 Universal Login to log into the app.
Additional notes:
- Use
redirectUrlto 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. audiencerelates to the API Identifier you want to reference in your access tokens. See API settings to learn more.scopesdefaults toopenid profile email. You can override these scopes, butopenidis always requested regardless of this setting.- If you want to log into a specific organization, provide the
organizationId. ProvideinvitationUrlif a user has been invited to join an organization. - Arbitrary
parameterscan be specified and then picked up in a custom Auth0 Action or Rule. - The
appStatecan be used to pass custom state to the callback URL. This app state can be any value, as long as it can be converted into a Javascript literal.
See https://api.dart.dev/dart-js_interop/NullableObjectUtilExtension/jsify.html
Implementation
Future<void> loginWithRedirect({
final Object? appState,
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(
appState: appState,
audience: audience,
redirectUrl: redirectUrl,
organizationId: organizationId,
invitationUrl: invitationUrl,
scopes: scopes ?? {},
idTokenValidationConfig: IdTokenValidationConfig(maxAge: maxAge),
parameters: parameters,
),
);