getUserAuthFactors method
Lists the authentication options for the currently signed-in user. Returns the following:
- The user's multi-factor authentication (MFA) preferences.
-
The user's options for choice-based authentication with the
USER_AUTHflow.
aws.cognito.signin.user.admin.
May throw ForbiddenException.
May throw InternalErrorException.
May throw InvalidParameterException.
May throw NotAuthorizedException.
May throw OperationNotEnabledException.
May throw PasswordResetRequiredException.
May throw ResourceNotFoundException.
May throw TooManyRequestsException.
May throw UserNotConfirmedException.
May throw UserNotFoundException.
Parameter accessToken :
A valid access token that Amazon Cognito issued to the currently signed-in
user. Must include a scope claim for
aws.cognito.signin.user.admin.
Implementation
Future<GetUserAuthFactorsResponse> getUserAuthFactors({
required String accessToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.GetUserAuthFactors'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
signed: false,
// TODO queryParams
headers: headers,
payload: {
'AccessToken': accessToken,
},
);
return GetUserAuthFactorsResponse.fromJson(jsonResponse.body);
}