CognitoIdentityProvider / Client / get_user_auth_factors
get_user_auth_factors#
- CognitoIdentityProvider.Client.get_user_auth_factors(**kwargs)#
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_AUTH
flow.
Authorize this action with a signed-in user’s access token. It must include the scope
aws.cognito.signin.user.admin
.Note
Amazon Cognito doesn’t evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can’t use IAM credentials to authorize requests, and you can’t grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.
See also: AWS API Documentation
Request Syntax
response = client.get_user_auth_factors( AccessToken='string' )
- Parameters:
AccessToken (string) –
[REQUIRED]
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
.- Return type:
dict
- Returns:
Response Syntax
{ 'Username': 'string', 'PreferredMfaSetting': 'string', 'UserMFASettingList': [ 'string', ], 'ConfiguredUserAuthFactors': [ 'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN', ] }
Response Structure
(dict) –
Username (string) –
The name of the user who is eligible for the authentication factors in the response.
PreferredMfaSetting (string) –
The challenge method that Amazon Cognito returns to the user in response to sign-in requests. Users can prefer SMS message, email message, or TOTP MFA.
UserMFASettingList (list) –
The MFA options that are activated for the user. The possible values in this list are
SMS_MFA
,EMAIL_OTP
, andSOFTWARE_TOKEN_MFA
.(string) –
ConfiguredUserAuthFactors (list) –
The authentication types that are available to the user with
USER_AUTH
sign-in, for example["PASSWORD", "WEB_AUTHN"]
.(string) –
Exceptions
CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException
CognitoIdentityProvider.Client.exceptions.InvalidParameterException
CognitoIdentityProvider.Client.exceptions.NotAuthorizedException
CognitoIdentityProvider.Client.exceptions.TooManyRequestsException
CognitoIdentityProvider.Client.exceptions.PasswordResetRequiredException
CognitoIdentityProvider.Client.exceptions.UserNotFoundException
CognitoIdentityProvider.Client.exceptions.UserNotConfirmedException
CognitoIdentityProvider.Client.exceptions.InternalErrorException
CognitoIdentityProvider.Client.exceptions.ForbiddenException