:doc:`CognitoIdentityProvider <../../cognito-idp>` / Client / get_user_auth_factors

*********************
get_user_auth_factors
*********************



.. py:method:: 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 <https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html>`__.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserAuthFactors>`_  


  **Request Syntax**
  ::

    response = client.get_user_auth_factors(
        AccessToken='string'
    )
    
  :type AccessToken: string
  :param AccessToken: **[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``.

    

  
  
  :rtype: 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``, 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"]``.

        
        

        - *(string) --* 
    
  
  **Exceptions**
  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.NotAuthorizedException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.TooManyRequestsException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.PasswordResetRequiredException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.UserNotFoundException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.UserNotConfirmedException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.InternalErrorException`

  
  *   :py:class:`CognitoIdentityProvider.Client.exceptions.ForbiddenException`

  