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_AUTH flow.

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 username isn’t an alias attribute in your user pool, this value must be the sub of 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, and SOFTWARE_TOKEN_MFA.

      • (string) –

    • ConfiguredUserAuthFactors (list) –

      The authentication types that are available to the user with USER_AUTH sign-in, for example ["PASSWORD", "WEB_AUTHN"].

      PASSWORD can only be used as a first authentication factor. SOFTWARE_TOKEN can only be used as an MFA factor. EMAIL_OTP, SMS_OTP, and WEB_AUTHN can be used as either a first authentication factor or an MFA factor. WEB_AUTHN is available as an MFA factor only when passkey MFA is enabled at the user pool level.

      • (string) –

Exceptions

  • CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException

  • CognitoIdentityProvider.Client.exceptions.InvalidParameterException

  • CognitoIdentityProvider.Client.exceptions.NotAuthorizedException

  • CognitoIdentityProvider.Client.exceptions.OperationNotEnabledException

  • CognitoIdentityProvider.Client.exceptions.TooManyRequestsException

  • CognitoIdentityProvider.Client.exceptions.UserNotFoundException

  • CognitoIdentityProvider.Client.exceptions.InternalErrorException