authenticate method
Future<UserInfo>
authenticate({
- required String redirectURI,
- List<
PromptOption> ? prompt, - List<
String> ? uiLocales, - ColorScheme? colorScheme,
- AuthenticationPage? page,
- String? oauthProviderAlias,
- String? wechatRedirectURI,
- String? authenticationFlowGroup,
- String? resource,
- List<
String> ? scopes,
Implementation
Future<UserInfo> authenticate({
required String redirectURI,
List<PromptOption>? prompt,
List<String>? uiLocales,
ColorScheme? colorScheme,
AuthenticationPage? page,
String? oauthProviderAlias,
String? wechatRedirectURI,
String? authenticationFlowGroup,
/// Resource indicator (RFC 8707). The URI of an API Resource registered in Authgear Portal.
///
/// When it is set, the access tokens of the resulting session have `aud` set to this URI instead of the Authgear endpoint.
/// The binding lasts for the whole session, including tokens obtained by refreshing.
String? resource,
/// Scopes of the API Resource given in [resource] to request.
///
/// They are merged with the scopes required by the SDK. The scopes required by the SDK are always requested.
List<String>? scopes,
}) async {
final authRequest = await internalCreateAuthenticateRequest(
AuthenticateOptions(
redirectURI: redirectURI,
isSsoEnabled: isSsoEnabled,
preAuthenticatedURLEnabled: preAuthenticatedURLEnabled,
state: null,
prompt: prompt,
uiLocales: uiLocales,
colorScheme: colorScheme,
oauthProviderAlias: oauthProviderAlias,
wechatRedirectURI: wechatRedirectURI,
page: page,
authenticationFlowGroup: authenticationFlowGroup,
resource: resource,
scopes: scopes,
),
);
final resultURL = await _uiImplementation.openAuthorizationURL(
url: authRequest.url.toString(),
redirectURI: authRequest.redirectURI,
shareCookiesWithDeviceBrowser: isSsoEnabled,
);
return await internalFinishAuthentication(
url: Uri.parse(resultURL),
redirectURI: redirectURI,
codeVerifier: authRequest.verifier,
);
}