reauthenticate method
Future<UserInfo>
reauthenticate({
- required String redirectURI,
- int maxAge = 0,
- List<
String> ? uiLocales, - ColorScheme? colorScheme,
- String? wechatRedirectURI,
- BiometricOptionsIOS? biometricIOS,
- BiometricOptionsAndroid? biometricAndroid,
Implementation
Future<UserInfo> reauthenticate({
required String redirectURI,
int maxAge = 0,
List<String>? uiLocales,
ColorScheme? colorScheme,
String? wechatRedirectURI,
BiometricOptionsIOS? biometricIOS,
BiometricOptionsAndroid? biometricAndroid,
}) async {
final biometricEnabled = await isBiometricEnabled();
if (biometricEnabled && biometricIOS != null && biometricAndroid != null) {
return await authenticateBiometric(
ios: biometricIOS,
android: biometricAndroid,
);
}
final codeVerifier = CodeVerifier(_rng);
final oidcRequest = OIDCAuthenticationRequest(
clientID: clientID,
redirectURI: redirectURI,
responseType: "code",
scope: [
"openid",
"https://authgear.com/scopes/full-access",
],
codeChallenge: codeVerifier.codeChallenge,
uiLocales: uiLocales,
colorScheme: colorScheme,
idTokenHint: idTokenHint,
maxAge: maxAge,
suppressIDPSessionCookie: !shareSessionWithSystemBrowser,
wechatRedirectURI: wechatRedirectURI,
);
final config = await _apiClient.fetchOIDCConfiguration();
final authenticationURL = Uri.parse(config.authorizationEndpoint)
.replace(queryParameters: oidcRequest.toQueryParameters());
final resultURL = await native.authenticate(
url: authenticationURL.toString(),
redirectURI: redirectURI,
preferEphemeral: !shareSessionWithSystemBrowser,
wechatRedirectURI: wechatRedirectURI,
onWechatRedirectURI: _onWechatRedirectURI,
);
final xDeviceInfo = await _getXDeviceInfo();
return await _finishReauthentication(
url: Uri.parse(resultURL),
redirectURI: redirectURI,
codeVerifier: codeVerifier,
xDeviceInfo: xDeviceInfo);
}