CognitoIdentityProvider / Client / admin_get_user_auth_factors
admin_get_user_auth_factors¶
- CognitoIdentityProvider.Client.admin_get_user_auth_factors(**kwargs)¶
Lists the authentication options for a user in a user pool. Returns the following:
The user’s multi-factor authentication (MFA) preferences.
The user’s options for choice-based authentication with the
USER_AUTHflow.
Note
Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.
Learn more
See also: AWS API Documentation
Request Syntax
response = client.admin_get_user_auth_factors( UserPoolId='string', Username='string' )
- Parameters:
UserPoolId (string) –
[REQUIRED]
The ID of the user pool where you want to get information about the user’s authentication factors.
Username (string) –
[REQUIRED]
The name of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If
usernameisn’t an alias attribute in your user pool, this value must be thesubof a local user or the username of a user from a third-party IdP.
- Return type:
dict
- Returns:
Response Syntax
{ 'Username': 'string', 'PreferredMfaSetting': 'string', 'UserMFASettingList': [ 'string', ], 'ConfiguredUserAuthFactors': [ 'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN'|'SOFTWARE_TOKEN', ] }
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_AUTHsign-in, for example["PASSWORD", "WEB_AUTHN"].PASSWORDcan only be used as a first authentication factor.SOFTWARE_TOKENcan only be used as an MFA factor.EMAIL_OTP,SMS_OTP, andWEB_AUTHNcan be used as either a first authentication factor or an MFA factor.WEB_AUTHNis available as an MFA factor only when passkey MFA is enabled at the user pool level.(string) –
Exceptions
CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExceptionCognitoIdentityProvider.Client.exceptions.InvalidParameterExceptionCognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptionCognitoIdentityProvider.Client.exceptions.OperationNotEnabledExceptionCognitoIdentityProvider.Client.exceptions.TooManyRequestsExceptionCognitoIdentityProvider.Client.exceptions.UserNotFoundExceptionCognitoIdentityProvider.Client.exceptions.InternalErrorException