authenticate method

Future<UserInfo> authenticate({
  1. required String redirectURI,
  2. List<PromptOption>? prompt,
  3. List<String>? uiLocales,
  4. ColorScheme? colorScheme,
  5. AuthenticationPage? page,
  6. String? state,
  7. String? oauthProviderAlias,
  8. String? wechatRedirectURI,
  9. String? authenticationFlowGroup,
})

Implementation

Future<UserInfo> authenticate({
  required String redirectURI,
  List<PromptOption>? prompt,
  List<String>? uiLocales,
  ColorScheme? colorScheme,
  AuthenticationPage? page,
  String? state,
  String? oauthProviderAlias,
  String? wechatRedirectURI,
  String? authenticationFlowGroup,
}) async {
  final authRequest =
      await internalCreateAuthenticateRequest(AuthenticateOptions(
    redirectURI: redirectURI,
    isSsoEnabled: isSsoEnabled,
    preAuthenticatedURLEnabled: preAuthenticatedURLEnabled,
    state: state,
    prompt: prompt,
    uiLocales: uiLocales,
    colorScheme: colorScheme,
    oauthProviderAlias: oauthProviderAlias,
    wechatRedirectURI: wechatRedirectURI,
    page: page,
    authenticationFlowGroup: authenticationFlowGroup,
  ));

  if (wechatRedirectURI != null) {
    await native.registerWechatRedirectURI(
        onWechatRedirectURI: _onWechatRedirectURI,
        wechatRedirectURI: wechatRedirectURI);
  }

  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);
}