fromIdToken static method
Creates a OidcUser from an encoded id_token passed via token.
You can verify the idToken by passing the keystore parameter.
You can also pass optional attributes that will get stored
with the user.
Implementation
static Future<OidcUser> fromIdToken({
required OidcToken token,
bool strictVerification = false,
JsonWebKeyStore? keystore,
OidcStore? cacheStore,
List<String>? allowedAlgorithms,
Map<String, dynamic>? attributes,
Map<String, dynamic>? userInfo,
String? idTokenOverride,
}) async {
final idToken = idTokenOverride ?? token.idToken;
if (idToken == null) {
throw const OidcException(
"Server didn't return the id_token.",
);
}
final webToken = await _getWebToken(
keystore,
idToken,
allowedAlgorithms,
cacheStore,
strictVerification,
);
return OidcUser._(
idToken: idToken,
parsedIdToken: webToken,
token: token,
attributes: attributes ?? const {},
allowedAlgorithms: allowedAlgorithms,
keystore: keystore,
userInfo: userInfo ?? const {},
);
}