CognitoIdentityProvider.Client.
get_user
(**kwargs)¶Gets the user attributes and metadata for a user.
See also: AWS API Documentation
Request Syntax
response = client.get_user(
AccessToken='string'
)
[REQUIRED]
A non-expired access token for the user whose information you want to query.
{
'Username': 'string',
'UserAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'MFAOptions': [
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
],
'PreferredMfaSetting': 'string',
'UserMFASettingList': [
'string',
]
}
Response Structure
Represents the response from the server from the request to get information about the user.
The user name of the user you want to retrieve from the get user request.
An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the custom:
prefix to the attribute name.
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
This response parameter is no longer supported. It provides information only about SMS MFA configurations. It doesn't provide information about time-based one-time password (TOTP) software token MFA configurations. To look up information about either type of MFA configuration, use UserMFASettingList instead.
This data type is no longer supported. Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations.
The delivery medium to send the MFA code. You can use this parameter to set only the SMS
delivery medium value.
The attribute name of the MFA option type. The only valid value is phone_number
.
The user's preferred MFA setting.
The MFA options that are activated for the user. The possible values in this list are SMS_MFA
and SOFTWARE_TOKEN_MFA
.
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