CognitoIdentityProvider

Table of Contents

Client

class CognitoIdentityProvider.Client

A low-level client representing Amazon Cognito Identity Provider:

import boto3

client = boto3.client('cognito-idp')

These are the available methods:

add_custom_attributes(**kwargs)

Adds additional user attributes to the user pool schema.

See also: AWS API Documentation

Request Syntax

response = client.add_custom_attributes(
    UserPoolId='string',
    CustomAttributes=[
        {
            'Name': 'string',
            'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean',
            'DeveloperOnlyAttribute': True|False,
            'Mutable': True|False,
            'Required': True|False,
            'NumberAttributeConstraints': {
                'MinValue': 'string',
                'MaxValue': 'string'
            },
            'StringAttributeConstraints': {
                'MinLength': 'string',
                'MaxLength': 'string'
            }
        },
    ]
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to add custom attributes.

  • CustomAttributes (list) --

    [REQUIRED]

    An array of custom attributes, such as Mutable and Name.

    • (dict) --

      Contains information about the schema attribute.

      • Name (string) --

        A schema attribute of the name type.

      • AttributeDataType (string) --

        The attribute data type.

      • DeveloperOnlyAttribute (boolean) --

        Specifies whether the attribute type is developer only.

      • Mutable (boolean) --

        Specifies whether the attribute can be changed once it has been created.

      • Required (boolean) --

        Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

      • NumberAttributeConstraints (dict) --

        Specifies the constraints for an attribute of the number type.

        • MinValue (string) --

          The minimum value of an attribute that is of the number data type.

        • MaxValue (string) --

          The maximum value of an attribute that is of the number data type.

      • StringAttributeConstraints (dict) --

        Specifies the constraints for an attribute of the string type.

        • MinLength (string) --

          The minimum length of an attribute value of the string type.

        • MaxLength (string) --

          The maximum length of an attribute value of the string type.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server for the request to add custom attributes.

admin_add_user_to_group(**kwargs)

Adds the specified user to the specified group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_add_user_to_group(
    UserPoolId='string',
    Username='string',
    GroupName='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

  • Username (string) --

    [REQUIRED]

    The username for the user.

  • GroupName (string) --

    [REQUIRED]

    The group name.

Returns

None

admin_confirm_sign_up(**kwargs)

Confirms user registration as an admin without using a confirmation code. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_confirm_sign_up(
    UserPoolId='string',
    Username='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for which you want to confirm user registration.

  • Username (string) --

    [REQUIRED]

    The user name for which you want to confirm user registration.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server for the request to confirm registration.

admin_create_user(**kwargs)

Creates a new user in the specified user pool and sends a welcome message via email or phone (SMS). This message is based on a template that you configured in your call to CreateUserPool or UpdateUserPool. This template includes your custom sign-up instructions and placeholders for user name and temporary password.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_create_user(
    UserPoolId='string',
    Username='string',
    UserAttributes=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    ValidationData=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    TemporaryPassword='string',
    ForceAliasCreation=True|False,
    MessageAction='RESEND'|'SUPPRESS',
    DesiredDeliveryMediums=[
        'SMS'|'EMAIL',
    ]
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where the user will be created.

  • Username (string) --

    [REQUIRED]

    The username for the user. Must be unique within the user pool. Must be a UTF-8 string between 1 and 128 characters. After the user is created, the username cannot be changed.

  • UserAttributes (list) --

    An array of name-value pairs that contain user attributes and attribute values to be set for the user to be created. You can create a user without specifying any attributes other than Username. However, any attributes that you specify as required (in CreateUserPool or in the Attributes tab of the console) must be supplied either by you (in your call to AdminCreateUser) or by the user (when he or she signs up in response to your welcome message).

    To send a message inviting the user to sign up, you must specify the user's email address or phone number. This can be done in your call to AdminCreateUser or in the Users tab of the Amazon Cognito console for managing your user pools.

    In your call to AdminCreateUser, you can set the email_verified attribute to True, and you can set the phone_number_verified attribute to True. (You cannot do this by calling other operations such as AdminUpdateUserAttributes.)

    • email : The email address of the user to whom the message that contains the code and username will be sent. Required if the email_verified attribute is set to True, or if "EMAIL" is specified in the DesiredDeliveryMediums parameter.
    • phone_number : The phone number of the user to whom the message that contains the code and username will be sent. Required if the phone_number_verified attribute is set to True, or if "SMS" is specified in the DesiredDeliveryMediums parameter.
    • (dict) --

      Specifies whether the attribute is standard or custom.

      • Name (string) -- [REQUIRED]

        The name of the attribute.

      • Value (string) --

        The value of the attribute.

  • ValidationData (list) --

    The user's validation data. This is an array of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. For example, you might choose to allow or disallow user sign-up based on the user's domain.

    To configure custom validation, you must create a Pre Sign-up Lambda trigger for the user pool as described in the Amazon Cognito Developer Guide. The Lambda trigger receives the validation data and uses it in the validation process.

    The user's validation data is not persisted.

    • (dict) --

      Specifies whether the attribute is standard or custom.

      • Name (string) -- [REQUIRED]

        The name of the attribute.

      • Value (string) --

        The value of the attribute.

  • TemporaryPassword (string) --

    The user's temporary password. This password must conform to the password policy that you specified when you created the user pool.

    The temporary password is valid only once. To complete the Admin Create User flow, the user must enter the temporary password in the sign-in page along with a new password to be used in all future sign-ins.

    This parameter is not required. If you do not specify a value, Amazon Cognito generates one for you.

    The temporary password can only be used until the user account expiration limit that you specified when you created the user pool. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter.

  • ForceAliasCreation (boolean) --

    This parameter is only used if the phone_number_verified or email_verified attribute is set to True. Otherwise, it is ignored.

    If this parameter is set to True and the phone number or email address specified in the UserAttributes parameter already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user. The previous user will no longer be able to log in using that alias.

    If this parameter is set to False, the API throws an AliasExistsException error if the alias already exists. The default value is False.

  • MessageAction (string) -- Set to "RESEND" to resend the invitation message to a user that already exists and reset the expiration limit on the user's account. Set to "SUPPRESS" to suppress sending the message. Only one value can be specified.
  • DesiredDeliveryMediums (list) --

    Specify "EMAIL" if email will be used to send the welcome message. Specify "SMS" if the phone number will be used. The default value is "SMS". More than one value can be specified.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'User': {
        'Username': 'string',
        'Attributes': [
            {
                'Name': 'string',
                'Value': 'string'
            },
        ],
        'UserCreateDate': datetime(2015, 1, 1),
        'UserLastModifiedDate': datetime(2015, 1, 1),
        'Enabled': True|False,
        'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
        'MFAOptions': [
            {
                'DeliveryMedium': 'SMS'|'EMAIL',
                'AttributeName': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to create the user.

    • User (dict) --

      The user returned in the request to create a new user.

      • Username (string) --

        The user name of the user you wish to describe.

      • Attributes (list) --

        A container with information about the user type attributes.

        • (dict) --

          Specifies whether the attribute is standard or custom.

          • Name (string) --

            The name of the attribute.

          • Value (string) --

            The value of the attribute.

      • UserCreateDate (datetime) --

        The creation date of the user.

      • UserLastModifiedDate (datetime) --

        The last modified date of the user.

      • Enabled (boolean) --

        Specifies whether the user is enabled.

      • UserStatus (string) --

        The user status. Can be one of the following:

        • UNCONFIRMED - User has been created but not confirmed.
        • CONFIRMED - User has been confirmed.
        • ARCHIVED - User is no longer active.
        • COMPROMISED - User is disabled due to a potential security threat.
        • UNKNOWN - User status is not known.
      • MFAOptions (list) --

        The MFA options for the user.

        • (dict) --

          Specifies the different settings for multi-factor authentication (MFA).

          • DeliveryMedium (string) --

            The delivery medium (email message or SMS message) to send the MFA code.

          • AttributeName (string) --

            The attribute name of the MFA option type.

admin_delete_user(**kwargs)

Deletes a user as an administrator. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_delete_user(
    UserPoolId='string',
    Username='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to delete the user.

  • Username (string) --

    [REQUIRED]

    The user name of the user you wish to delete.

Returns

None

admin_delete_user_attributes(**kwargs)

Deletes the user attributes in a user pool as an administrator. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_delete_user_attributes(
    UserPoolId='string',
    Username='string',
    UserAttributeNames=[
        'string',
    ]
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to delete user attributes.

  • Username (string) --

    [REQUIRED]

    The user name of the user from which you would like to delete attributes.

  • UserAttributeNames (list) --

    [REQUIRED]

    An array of strings representing the user attribute names you wish to delete.

    • (string) --
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response received from the server for a request to delete user attributes.

admin_disable_user(**kwargs)

Disables the specified user as an administrator. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_disable_user(
    UserPoolId='string',
    Username='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to disable the user.

  • Username (string) --

    [REQUIRED]

    The user name of the user you wish to disable.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response received from the server to disable the user as an administrator.

admin_enable_user(**kwargs)

Enables the specified user as an administrator. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_enable_user(
    UserPoolId='string',
    Username='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to enable the user.

  • Username (string) --

    [REQUIRED]

    The user name of the user you wish to ebable.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server for the request to enable a user as an administrator.

admin_forget_device(**kwargs)

Forgets the device, as an administrator.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_forget_device(
    UserPoolId='string',
    Username='string',
    DeviceKey='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID.

  • Username (string) --

    [REQUIRED]

    The user name.

  • DeviceKey (string) --

    [REQUIRED]

    The device key.

Returns

None

admin_get_device(**kwargs)

Gets the device, as an administrator.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_get_device(
    DeviceKey='string',
    UserPoolId='string',
    Username='string'
)
Parameters
  • DeviceKey (string) --

    [REQUIRED]

    The device key.

  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID.

  • Username (string) --

    [REQUIRED]

    The user name.

Return type

dict

Returns

Response Syntax

{
    'Device': {
        'DeviceKey': 'string',
        'DeviceAttributes': [
            {
                'Name': 'string',
                'Value': 'string'
            },
        ],
        'DeviceCreateDate': datetime(2015, 1, 1),
        'DeviceLastModifiedDate': datetime(2015, 1, 1),
        'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Gets the device response, as an administrator.

    • Device (dict) --

      The device.

      • DeviceKey (string) --

        The device key.

      • DeviceAttributes (list) --

        The device attributes.

        • (dict) --

          Specifies whether the attribute is standard or custom.

          • Name (string) --

            The name of the attribute.

          • Value (string) --

            The value of the attribute.

      • DeviceCreateDate (datetime) --

        The creation date of the device.

      • DeviceLastModifiedDate (datetime) --

        The last modified date of the device.

      • DeviceLastAuthenticatedDate (datetime) --

        The date in which the device was last authenticated.

admin_get_user(**kwargs)

Gets the specified user by user name in a user pool as an administrator. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_get_user(
    UserPoolId='string',
    Username='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to get information about the user.

  • Username (string) --

    [REQUIRED]

    The user name of the user you wish to retrieve.

Return type

dict

Returns

Response Syntax

{
    'Username': 'string',
    'UserAttributes': [
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    'UserCreateDate': datetime(2015, 1, 1),
    'UserLastModifiedDate': datetime(2015, 1, 1),
    'Enabled': True|False,
    'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
    'MFAOptions': [
        {
            'DeliveryMedium': 'SMS'|'EMAIL',
            'AttributeName': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the response from the server from the request to get the specified user as an administrator.

    • Username (string) --

      The user name of the user about whom you are receiving information.

    • UserAttributes (list) --

      An array of name-value pairs representing user attributes.

      • (dict) --

        Specifies whether the attribute is standard or custom.

        • Name (string) --

          The name of the attribute.

        • Value (string) --

          The value of the attribute.

    • UserCreateDate (datetime) --

      The date the user was created.

    • UserLastModifiedDate (datetime) --

      The date the user was last modified.

    • Enabled (boolean) --

      Indicates that the status is enabled.

    • UserStatus (string) --

      The user status. Can be one of the following:

      • UNCONFIRMED - User has been created but not confirmed.
      • CONFIRMED - User has been confirmed.
      • ARCHIVED - User is no longer active.
      • COMPROMISED - User is disabled due to a potential security threat.
      • UNKNOWN - User status is not known.
    • MFAOptions (list) --

      Specifies the options for MFA (e.g., email or phone number).

      • (dict) --

        Specifies the different settings for multi-factor authentication (MFA).

        • DeliveryMedium (string) --

          The delivery medium (email message or SMS message) to send the MFA code.

        • AttributeName (string) --

          The attribute name of the MFA option type.

admin_initiate_auth(**kwargs)

Initiates the authentication flow, as an administrator.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_initiate_auth(
    UserPoolId='string',
    ClientId='string',
    AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH',
    AuthParameters={
        'string': 'string'
    },
    ClientMetadata={
        'string': 'string'
    }
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The ID of the Amazon Cognito user pool.

  • ClientId (string) --

    [REQUIRED]

    The client app ID.

  • AuthFlow (string) --

    [REQUIRED]

    The authentication flow.

  • AuthParameters (dict) --

    The authentication parameters.

    • (string) --
      • (string) --
  • ClientMetadata (dict) --

    The client app metadata.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Initiates the authentication response, as an administrator.

    • ChallengeName (string) --

      The name of the challenge.

    • Session (string) --

      The session.

    • ChallengeParameters (dict) --

      The challenge parameters.

      • (string) --
        • (string) --
    • AuthenticationResult (dict) --

      The result of the authentication response.

      • AccessToken (string) --

        The access token of the authentication result.

      • ExpiresIn (integer) --

        The expiration period of the authentication result.

      • TokenType (string) --

        The token type of the authentication result.

      • RefreshToken (string) --

        The refresh token of the authentication result.

      • IdToken (string) --

        The ID token of the authentication result.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key.

        • DeviceGroupKey (string) --

          The device group key.

admin_list_devices(**kwargs)

Lists devices, as an administrator.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_list_devices(
    UserPoolId='string',
    Username='string',
    Limit=123,
    PaginationToken='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID.

  • Username (string) --

    [REQUIRED]

    The user name.

  • Limit (integer) -- The limit of the devices request.
  • PaginationToken (string) -- The pagination token.
Return type

dict

Returns

Response Syntax

{
    'Devices': [
        {
            'DeviceKey': 'string',
            'DeviceAttributes': [
                {
                    'Name': 'string',
                    'Value': 'string'
                },
            ],
            'DeviceCreateDate': datetime(2015, 1, 1),
            'DeviceLastModifiedDate': datetime(2015, 1, 1),
            'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
        },
    ],
    'PaginationToken': 'string'
}

Response Structure

  • (dict) --

    Lists the device's response, as an administrator.

    • Devices (list) --

      The devices in the list of devices response.

      • (dict) --

        The device type.

        • DeviceKey (string) --

          The device key.

        • DeviceAttributes (list) --

          The device attributes.

          • (dict) --

            Specifies whether the attribute is standard or custom.

            • Name (string) --

              The name of the attribute.

            • Value (string) --

              The value of the attribute.

        • DeviceCreateDate (datetime) --

          The creation date of the device.

        • DeviceLastModifiedDate (datetime) --

          The last modified date of the device.

        • DeviceLastAuthenticatedDate (datetime) --

          The date in which the device was last authenticated.

    • PaginationToken (string) --

      The pagination token.

admin_list_groups_for_user(**kwargs)

Lists the groups that the user belongs to.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_list_groups_for_user(
    Username='string',
    UserPoolId='string',
    Limit=123,
    NextToken='string'
)
Parameters
  • Username (string) --

    [REQUIRED]

    The username for the user.

  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

  • Limit (integer) -- The limit of the request to list groups.
  • NextToken (string) -- An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Return type

dict

Returns

Response Syntax

{
    'Groups': [
        {
            'GroupName': 'string',
            'UserPoolId': 'string',
            'Description': 'string',
            'RoleArn': 'string',
            'Precedence': 123,
            'LastModifiedDate': datetime(2015, 1, 1),
            'CreationDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Groups (list) --

      The groups that the user belongs to.

      • (dict) --

        The group type.

        • GroupName (string) --

          The name of the group.

        • UserPoolId (string) --

          The user pool ID for the user pool.

        • Description (string) --

          A string containing the description of the group.

        • RoleArn (string) --

          The role ARN for the group.

        • Precedence (integer) --

          A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

          Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

          The default Precedence value is null.

        • LastModifiedDate (datetime) --

          The date the group was last modified.

        • CreationDate (datetime) --

          The date the group was created.

    • NextToken (string) --

      An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

admin_remove_user_from_group(**kwargs)

Removes the specified user from the specified group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_remove_user_from_group(
    UserPoolId='string',
    Username='string',
    GroupName='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

  • Username (string) --

    [REQUIRED]

    The username for the user.

  • GroupName (string) --

    [REQUIRED]

    The group name.

Returns

None

admin_reset_user_password(**kwargs)

Resets the specified user's password in a user pool as an administrator. Works on any user.

When a developer calls this API, the current password is invalidated, so it must be changed. If a user tries to sign in after the API is called, the app will get a PasswordResetRequiredException exception back and should direct the user down the flow to reset the password, which is the same as the forgot password flow. In addition, if the user pool has phone verification selected and a verified phone number exists for the user, or if email verification is selected and a verified email exists for the user, calling this API will also result in sending a message to the end user with the code to change their password.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_reset_user_password(
    UserPoolId='string',
    Username='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to reset the user's password.

  • Username (string) --

    [REQUIRED]

    The user name of the user whose password you wish to reset.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server to reset a user password as an administrator.

admin_respond_to_auth_challenge(**kwargs)

Responds to an authentication challenge, as an administrator.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_respond_to_auth_challenge(
    UserPoolId='string',
    ClientId='string',
    ChallengeName='SMS_MFA'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
    ChallengeResponses={
        'string': 'string'
    },
    Session='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The ID of the Amazon Cognito user pool.

  • ClientId (string) --

    [REQUIRED]

    The client ID.

  • ChallengeName (string) --

    [REQUIRED]

    The name of the challenge.

  • ChallengeResponses (dict) --

    The challenge response.

    • (string) --
      • (string) --
  • Session (string) -- The session.
Return type

dict

Returns

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Responds to the authentication challenge, as an administrator.

    • ChallengeName (string) --

      The name of the challenge.

    • Session (string) --

      The session.

    • ChallengeParameters (dict) --

      The challenge parameters.

      • (string) --
        • (string) --
    • AuthenticationResult (dict) --

      The result returned by the server in response to the authentication request.

      • AccessToken (string) --

        The access token of the authentication result.

      • ExpiresIn (integer) --

        The expiration period of the authentication result.

      • TokenType (string) --

        The token type of the authentication result.

      • RefreshToken (string) --

        The refresh token of the authentication result.

      • IdToken (string) --

        The ID token of the authentication result.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key.

        • DeviceGroupKey (string) --

          The device group key.

admin_set_user_settings(**kwargs)

Sets all the user settings for a specified user name. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_set_user_settings(
    UserPoolId='string',
    Username='string',
    MFAOptions=[
        {
            'DeliveryMedium': 'SMS'|'EMAIL',
            'AttributeName': 'string'
        },
    ]
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to set the user's settings, such as MFA options.

  • Username (string) --

    [REQUIRED]

    The user name of the user for whom you wish to set user settings.

  • MFAOptions (list) --

    [REQUIRED]

    Specifies the options for MFA (e.g., email or phone number).

    • (dict) --

      Specifies the different settings for multi-factor authentication (MFA).

      • DeliveryMedium (string) --

        The delivery medium (email message or SMS message) to send the MFA code.

      • AttributeName (string) --

        The attribute name of the MFA option type.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server to set user settings as an administrator.

admin_update_device_status(**kwargs)

Updates the device status as an administrator.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_update_device_status(
    UserPoolId='string',
    Username='string',
    DeviceKey='string',
    DeviceRememberedStatus='remembered'|'not_remembered'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID

  • Username (string) --

    [REQUIRED]

    The user name.

  • DeviceKey (string) --

    [REQUIRED]

    The device key.

  • DeviceRememberedStatus (string) -- The status indicating whether a device has been remembered or not.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    The status response from the request to update the device, as an administrator.

admin_update_user_attributes(**kwargs)

Updates the specified user's attributes, including developer attributes, as an administrator. Works on any user.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_update_user_attributes(
    UserPoolId='string',
    Username='string',
    UserAttributes=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ]
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to update user attributes.

  • Username (string) --

    [REQUIRED]

    The user name of the user for whom you want to update user attributes.

  • UserAttributes (list) --

    [REQUIRED]

    An array of name-value pairs representing user attributes.

    • (dict) --

      Specifies whether the attribute is standard or custom.

      • Name (string) -- [REQUIRED]

        The name of the attribute.

      • Value (string) --

        The value of the attribute.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server for the request to update user attributes as an administrator.

admin_user_global_sign_out(**kwargs)

Signs out users from all devices, as an administrator.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.admin_user_global_sign_out(
    UserPoolId='string',
    Username='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID.

  • Username (string) --

    [REQUIRED]

    The user name.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    The global sign-out response, as an administrator.

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
change_password(**kwargs)

Changes the password for a specified user in a user pool.

See also: AWS API Documentation

Request Syntax

response = client.change_password(
    PreviousPassword='string',
    ProposedPassword='string',
    AccessToken='string'
)
Parameters
  • PreviousPassword (string) --

    [REQUIRED]

    The old password in the change password request.

  • ProposedPassword (string) --

    [REQUIRED]

    The new password in the change password request.

  • AccessToken (string) -- The access token in the change password request.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    The response from the server to the change password request.

confirm_device(**kwargs)

Confirms tracking of the device. This API call is the call that beings device tracking.

See also: AWS API Documentation

Request Syntax

response = client.confirm_device(
    AccessToken='string',
    DeviceKey='string',
    DeviceSecretVerifierConfig={
        'PasswordVerifier': 'string',
        'Salt': 'string'
    },
    DeviceName='string'
)
Parameters
  • AccessToken (string) --

    [REQUIRED]

    The access token.

  • DeviceKey (string) --

    [REQUIRED]

    The device key.

  • DeviceSecretVerifierConfig (dict) --

    The configuration of the device secret verifier.

    • PasswordVerifier (string) --

      The password verifier.

    • Salt (string) --

      The salt.

  • DeviceName (string) -- The device name.
Return type

dict

Returns

Response Syntax

{
    'UserConfirmationNecessary': True|False
}

Response Structure

  • (dict) --

    Confirms the device response.

    • UserConfirmationNecessary (boolean) --

      Indicates whether the user confirmation is necessary to confirm the device response.

confirm_forgot_password(**kwargs)

Allows a user to enter a code provided when they reset their password to update their password.

See also: AWS API Documentation

Request Syntax

response = client.confirm_forgot_password(
    ClientId='string',
    SecretHash='string',
    Username='string',
    ConfirmationCode='string',
    Password='string'
)
Parameters
  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

  • SecretHash (string) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
  • Username (string) --

    [REQUIRED]

    The user name of the user for whom you want to enter a code to retrieve a forgotten password.

  • ConfirmationCode (string) --

    [REQUIRED]

    The confirmation code sent by a user's request to retrieve a forgotten password.

  • Password (string) --

    [REQUIRED]

    The password sent by sent by a user's request to retrieve a forgotten password.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    The response from the server that results from a user's request to retrieve a forgotten password.

confirm_sign_up(**kwargs)

Confirms registration of a user and handles the existing alias from a previous user.

See also: AWS API Documentation

Request Syntax

response = client.confirm_sign_up(
    ClientId='string',
    SecretHash='string',
    Username='string',
    ConfirmationCode='string',
    ForceAliasCreation=True|False
)
Parameters
  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

  • SecretHash (string) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
  • Username (string) --

    [REQUIRED]

    The user name of the user whose registration you wish to confirm.

  • ConfirmationCode (string) --

    [REQUIRED]

    The confirmation code sent by a user's request to confirm registration.

  • ForceAliasCreation (boolean) -- Boolean to be specified to force user confirmation irrespective of existing alias. By default set to False. If this parameter is set to True and the phone number/email used for sign up confirmation already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user being confirmed. If set to False, the API will throw an AliasExistsException error.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server for the registration confirmation.

create_group(**kwargs)

Creates a new group in the specified user pool.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.create_group(
    GroupName='string',
    UserPoolId='string',
    Description='string',
    RoleArn='string',
    Precedence=123
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the group. Must be unique.

  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

  • Description (string) -- A string containing the description of the group.
  • RoleArn (string) -- The role ARN for the group.
  • Precedence (integer) --

    A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower Precedence values take precedence over groups with higher or null Precedence values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens.

    Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

    The default Precedence value is null.

Return type

dict

Returns

Response Syntax

{
    'Group': {
        'GroupName': 'string',
        'UserPoolId': 'string',
        'Description': 'string',
        'RoleArn': 'string',
        'Precedence': 123,
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      The group object for the group.

      • GroupName (string) --

        The name of the group.

      • UserPoolId (string) --

        The user pool ID for the user pool.

      • Description (string) --

        A string containing the description of the group.

      • RoleArn (string) --

        The role ARN for the group.

      • Precedence (integer) --

        A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

        Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

        The default Precedence value is null.

      • LastModifiedDate (datetime) --

        The date the group was last modified.

      • CreationDate (datetime) --

        The date the group was created.

create_user_import_job(**kwargs)

Creates the user import job.

See also: AWS API Documentation

Request Syntax

response = client.create_user_import_job(
    JobName='string',
    UserPoolId='string',
    CloudWatchLogsRoleArn='string'
)
Parameters
  • JobName (string) --

    [REQUIRED]

    The job name for the user import job.

  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool that the users are being imported into.

  • CloudWatchLogsRoleArn (string) --

    [REQUIRED]

    The role ARN for the Amazon CloudWatch Logging role for the user import job.

Return type

dict

Returns

Response Syntax

{
    'UserImportJob': {
        'JobName': 'string',
        'JobId': 'string',
        'UserPoolId': 'string',
        'PreSignedUrl': 'string',
        'CreationDate': datetime(2015, 1, 1),
        'StartDate': datetime(2015, 1, 1),
        'CompletionDate': datetime(2015, 1, 1),
        'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
        'CloudWatchLogsRoleArn': 'string',
        'ImportedUsers': 123,
        'SkippedUsers': 123,
        'FailedUsers': 123,
        'CompletionMessage': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to create the user import job.

    • UserImportJob (dict) --

      The job object that represents the user import job.

      • JobName (string) --

        The job name for the user import job.

      • JobId (string) --

        The job ID for the user import job.

      • UserPoolId (string) --

        The user pool ID for the user pool that the users are being imported into.

      • PreSignedUrl (string) --

        The pre-signed URL to be used to upload the .csv file.

      • CreationDate (datetime) --

        The date when the user import job was created.

      • StartDate (datetime) --

        The date when the user import job was started.

      • CompletionDate (datetime) --

        The date when the user imoprt job was completed.

      • Status (string) --

        The status of the user import job. One of the following:

        • Created - The job was created but not started.
        • Pending - A transition state. You have started the job, but it has not begun importing users yet.
        • InProgress - The job has started, and users are being imported.
        • Stopping - You have stopped the job, but the job has not stopped importing users yet.
        • Stopped - You have stopped the job, and the job has stopped importing users.
        • Succeeded - The job has completed successfully.
        • Failed - The job has stopped due to an error.
        • Expired - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
      • CloudWatchLogsRoleArn (string) --

        The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.

      • ImportedUsers (integer) --

        The number of users that were successfully imported.

      • SkippedUsers (integer) --

        The number of users that were skipped.

      • FailedUsers (integer) --

        The number of users that could not be imported.

      • CompletionMessage (string) --

        The message returned when the user import job is completed.

create_user_pool(**kwargs)

Creates a new Amazon Cognito user pool and sets the password policy for the pool.

See also: AWS API Documentation

Request Syntax

response = client.create_user_pool(
    PoolName='string',
    Policies={
        'PasswordPolicy': {
            'MinimumLength': 123,
            'RequireUppercase': True|False,
            'RequireLowercase': True|False,
            'RequireNumbers': True|False,
            'RequireSymbols': True|False
        }
    },
    LambdaConfig={
        'PreSignUp': 'string',
        'CustomMessage': 'string',
        'PostConfirmation': 'string',
        'PreAuthentication': 'string',
        'PostAuthentication': 'string',
        'DefineAuthChallenge': 'string',
        'CreateAuthChallenge': 'string',
        'VerifyAuthChallengeResponse': 'string'
    },
    AutoVerifiedAttributes=[
        'phone_number'|'email',
    ],
    AliasAttributes=[
        'phone_number'|'email'|'preferred_username',
    ],
    SmsVerificationMessage='string',
    EmailVerificationMessage='string',
    EmailVerificationSubject='string',
    SmsAuthenticationMessage='string',
    MfaConfiguration='OFF'|'ON'|'OPTIONAL',
    DeviceConfiguration={
        'ChallengeRequiredOnNewDevice': True|False,
        'DeviceOnlyRememberedOnUserPrompt': True|False
    },
    EmailConfiguration={
        'SourceArn': 'string',
        'ReplyToEmailAddress': 'string'
    },
    SmsConfiguration={
        'SnsCallerArn': 'string',
        'ExternalId': 'string'
    },
    UserPoolTags={
        'string': 'string'
    },
    AdminCreateUserConfig={
        'AllowAdminCreateUserOnly': True|False,
        'UnusedAccountValidityDays': 123,
        'InviteMessageTemplate': {
            'SMSMessage': 'string',
            'EmailMessage': 'string',
            'EmailSubject': 'string'
        }
    },
    Schema=[
        {
            'Name': 'string',
            'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean',
            'DeveloperOnlyAttribute': True|False,
            'Mutable': True|False,
            'Required': True|False,
            'NumberAttributeConstraints': {
                'MinValue': 'string',
                'MaxValue': 'string'
            },
            'StringAttributeConstraints': {
                'MinLength': 'string',
                'MaxLength': 'string'
            }
        },
    ]
)
Parameters
  • PoolName (string) --

    [REQUIRED]

    A string used to name the user pool.

  • Policies (dict) --

    The policies associated with the new user pool.

    • PasswordPolicy (dict) --

      A container with information about the user pool password policy.

      • MinimumLength (integer) --

        The minimum length of the password policy that you have set. Cannot be less than 6.

      • RequireUppercase (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.

      • RequireLowercase (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.

      • RequireNumbers (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one number in their password.

      • RequireSymbols (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.

  • LambdaConfig (dict) --

    The Lambda trigger configuration information for the new user pool.

    • PreSignUp (string) --

      A pre-registration AWS Lambda trigger.

    • CustomMessage (string) --

      A custom Message AWS Lambda trigger.

    • PostConfirmation (string) --

      A post-confirmation AWS Lambda trigger.

    • PreAuthentication (string) --

      A pre-authentication AWS Lambda trigger.

    • PostAuthentication (string) --

      A post-authentication AWS Lambda trigger.

    • DefineAuthChallenge (string) --

      Defines the authentication challenge.

    • CreateAuthChallenge (string) --

      Creates an authentication challenge.

    • VerifyAuthChallengeResponse (string) --

      Verifies the authentication challenge response.

  • AutoVerifiedAttributes (list) --

    The attributes to be auto-verified. Possible values: email , phone_number .

    • (string) --
  • AliasAttributes (list) --

    Attributes supported as an alias for this user pool. Possible values: phone_number , email , or preferred_username .

    • (string) --
  • SmsVerificationMessage (string) -- A string representing the SMS verification message.
  • EmailVerificationMessage (string) -- A string representing the email verification message.
  • EmailVerificationSubject (string) -- A string representing the email verification subject.
  • SmsAuthenticationMessage (string) -- A string representing the SMS authentication message.
  • MfaConfiguration (string) -- Specifies MFA configuration details.
  • DeviceConfiguration (dict) --

    The device configuration.

    • ChallengeRequiredOnNewDevice (boolean) --

      Indicates whether a challenge is required on a new device. Only applicable to a new device.

    • DeviceOnlyRememberedOnUserPrompt (boolean) --

      If true, a device is only remembered on user prompt.

  • EmailConfiguration (dict) --

    The email configuration.

    • SourceArn (string) --

      The Amazon Resource Name (ARN) of the email source.

    • ReplyToEmailAddress (string) --

      The REPLY-TO email address.

  • SmsConfiguration (dict) --

    The SMS configuration.

    • SnsCallerArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

    • ExternalId (string) --

      The external ID.

  • UserPoolTags (dict) --

    The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

    • (string) --
      • (string) --
  • AdminCreateUserConfig (dict) --

    The configuration for AdminCreateUser requests.

    • AllowAdminCreateUserOnly (boolean) --

      Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

    • UnusedAccountValidityDays (integer) --

      The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

    • InviteMessageTemplate (dict) --

      The message template to be used for the welcome message to new users.

      • SMSMessage (string) --

        The message template for SMS messages.

      • EmailMessage (string) --

        The message template for email messages.

      • EmailSubject (string) --

        The subject line for email messages.

  • Schema (list) --

    An array of schema attributes for the new user pool. These attributes can be standard or custom attributes.

    • (dict) --

      Contains information about the schema attribute.

      • Name (string) --

        A schema attribute of the name type.

      • AttributeDataType (string) --

        The attribute data type.

      • DeveloperOnlyAttribute (boolean) --

        Specifies whether the attribute type is developer only.

      • Mutable (boolean) --

        Specifies whether the attribute can be changed once it has been created.

      • Required (boolean) --

        Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

      • NumberAttributeConstraints (dict) --

        Specifies the constraints for an attribute of the number type.

        • MinValue (string) --

          The minimum value of an attribute that is of the number data type.

        • MaxValue (string) --

          The maximum value of an attribute that is of the number data type.

      • StringAttributeConstraints (dict) --

        Specifies the constraints for an attribute of the string type.

        • MinLength (string) --

          The minimum length of an attribute value of the string type.

        • MaxLength (string) --

          The maximum length of an attribute value of the string type.

Return type

dict

Returns

Response Syntax

{
    'UserPool': {
        'Id': 'string',
        'Name': 'string',
        'Policies': {
            'PasswordPolicy': {
                'MinimumLength': 123,
                'RequireUppercase': True|False,
                'RequireLowercase': True|False,
                'RequireNumbers': True|False,
                'RequireSymbols': True|False
            }
        },
        'LambdaConfig': {
            'PreSignUp': 'string',
            'CustomMessage': 'string',
            'PostConfirmation': 'string',
            'PreAuthentication': 'string',
            'PostAuthentication': 'string',
            'DefineAuthChallenge': 'string',
            'CreateAuthChallenge': 'string',
            'VerifyAuthChallengeResponse': 'string'
        },
        'Status': 'Enabled'|'Disabled',
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1),
        'SchemaAttributes': [
            {
                'Name': 'string',
                'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean',
                'DeveloperOnlyAttribute': True|False,
                'Mutable': True|False,
                'Required': True|False,
                'NumberAttributeConstraints': {
                    'MinValue': 'string',
                    'MaxValue': 'string'
                },
                'StringAttributeConstraints': {
                    'MinLength': 'string',
                    'MaxLength': 'string'
                }
            },
        ],
        'AutoVerifiedAttributes': [
            'phone_number'|'email',
        ],
        'AliasAttributes': [
            'phone_number'|'email'|'preferred_username',
        ],
        'SmsVerificationMessage': 'string',
        'EmailVerificationMessage': 'string',
        'EmailVerificationSubject': 'string',
        'SmsAuthenticationMessage': 'string',
        'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
        'DeviceConfiguration': {
            'ChallengeRequiredOnNewDevice': True|False,
            'DeviceOnlyRememberedOnUserPrompt': True|False
        },
        'EstimatedNumberOfUsers': 123,
        'EmailConfiguration': {
            'SourceArn': 'string',
            'ReplyToEmailAddress': 'string'
        },
        'SmsConfiguration': {
            'SnsCallerArn': 'string',
            'ExternalId': 'string'
        },
        'UserPoolTags': {
            'string': 'string'
        },
        'SmsConfigurationFailure': 'string',
        'EmailConfigurationFailure': 'string',
        'AdminCreateUserConfig': {
            'AllowAdminCreateUserOnly': True|False,
            'UnusedAccountValidityDays': 123,
            'InviteMessageTemplate': {
                'SMSMessage': 'string',
                'EmailMessage': 'string',
                'EmailSubject': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents the response from the server for the request to create a user pool.

    • UserPool (dict) --

      A container for the user pool details.

      • Id (string) --

        The ID of the user pool.

      • Name (string) --

        The name of the user pool.

      • Policies (dict) --

        A container describing the policies associated with a user pool.

        • PasswordPolicy (dict) --

          A container with information about the user pool password policy.

          • MinimumLength (integer) --

            The minimum length of the password policy that you have set. Cannot be less than 6.

          • RequireUppercase (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.

          • RequireLowercase (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.

          • RequireNumbers (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one number in their password.

          • RequireSymbols (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.

      • LambdaConfig (dict) --

        A container describing the AWS Lambda triggers associated with a user pool.

        • PreSignUp (string) --

          A pre-registration AWS Lambda trigger.

        • CustomMessage (string) --

          A custom Message AWS Lambda trigger.

        • PostConfirmation (string) --

          A post-confirmation AWS Lambda trigger.

        • PreAuthentication (string) --

          A pre-authentication AWS Lambda trigger.

        • PostAuthentication (string) --

          A post-authentication AWS Lambda trigger.

        • DefineAuthChallenge (string) --

          Defines the authentication challenge.

        • CreateAuthChallenge (string) --

          Creates an authentication challenge.

        • VerifyAuthChallengeResponse (string) --

          Verifies the authentication challenge response.

      • Status (string) --

        The status of a user pool.

      • LastModifiedDate (datetime) --

        The last modified date of a user pool.

      • CreationDate (datetime) --

        The creation date of a user pool.

      • SchemaAttributes (list) --

        A container with the schema attributes of a user pool.

        • (dict) --

          Contains information about the schema attribute.

          • Name (string) --

            A schema attribute of the name type.

          • AttributeDataType (string) --

            The attribute data type.

          • DeveloperOnlyAttribute (boolean) --

            Specifies whether the attribute type is developer only.

          • Mutable (boolean) --

            Specifies whether the attribute can be changed once it has been created.

          • Required (boolean) --

            Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

          • NumberAttributeConstraints (dict) --

            Specifies the constraints for an attribute of the number type.

            • MinValue (string) --

              The minimum value of an attribute that is of the number data type.

            • MaxValue (string) --

              The maximum value of an attribute that is of the number data type.

          • StringAttributeConstraints (dict) --

            Specifies the constraints for an attribute of the string type.

            • MinLength (string) --

              The minimum length of an attribute value of the string type.

            • MaxLength (string) --

              The maximum length of an attribute value of the string type.

      • AutoVerifiedAttributes (list) --

        Specifies the attributes that are auto-verified in a user pool.

        • (string) --
      • AliasAttributes (list) --

        Specifies the attributes that are aliased in a user pool.

        • (string) --
      • SmsVerificationMessage (string) --

        The contents of the SMS verification message.

      • EmailVerificationMessage (string) --

        The contents of the email verification message.

      • EmailVerificationSubject (string) --

        The subject of the email verification message.

      • SmsAuthenticationMessage (string) --

        The contents of the SMS authentication message.

      • MfaConfiguration (string) --

        Can be one of the following values:

        • OFF - MFA tokens are not required and cannot be specified during user registration.
        • ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.
        • OPTIONAL - Users have the option when registering to create an MFA token.
      • DeviceConfiguration (dict) --

        The device configuration.

        • ChallengeRequiredOnNewDevice (boolean) --

          Indicates whether a challenge is required on a new device. Only applicable to a new device.

        • DeviceOnlyRememberedOnUserPrompt (boolean) --

          If true, a device is only remembered on user prompt.

      • EstimatedNumberOfUsers (integer) --

        A number estimating the size of the user pool.

      • EmailConfiguration (dict) --

        The email configuration.

        • SourceArn (string) --

          The Amazon Resource Name (ARN) of the email source.

        • ReplyToEmailAddress (string) --

          The REPLY-TO email address.

      • SmsConfiguration (dict) --

        The SMS configuration.

        • SnsCallerArn (string) --

          The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

        • ExternalId (string) --

          The external ID.

      • UserPoolTags (dict) --

        The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

        • (string) --
          • (string) --
      • SmsConfigurationFailure (string) --

        The reason why the SMS configuration cannot send the message(s) to your users.

      • EmailConfigurationFailure (string) --

        The reason why the email configuration cannot send the messages to your users.

      • AdminCreateUserConfig (dict) --

        The configuration for AdminCreateUser requests.

        • AllowAdminCreateUserOnly (boolean) --

          Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

        • UnusedAccountValidityDays (integer) --

          The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

        • InviteMessageTemplate (dict) --

          The message template to be used for the welcome message to new users.

          • SMSMessage (string) --

            The message template for SMS messages.

          • EmailMessage (string) --

            The message template for email messages.

          • EmailSubject (string) --

            The subject line for email messages.

create_user_pool_client(**kwargs)

Creates the user pool client.

See also: AWS API Documentation

Request Syntax

response = client.create_user_pool_client(
    UserPoolId='string',
    ClientName='string',
    GenerateSecret=True|False,
    RefreshTokenValidity=123,
    ReadAttributes=[
        'string',
    ],
    WriteAttributes=[
        'string',
    ],
    ExplicitAuthFlows=[
        'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY',
    ]
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to create a user pool client.

  • ClientName (string) --

    [REQUIRED]

    The client name for the user pool client you would like to create.

  • GenerateSecret (boolean) -- Boolean to specify whether you want to generate a secret for the user pool client being created.
  • RefreshTokenValidity (integer) -- The validity of the refresh token, in days.
  • ReadAttributes (list) --

    The read attributes.

    • (string) --
  • WriteAttributes (list) --

    The write attributes.

    • (string) --
  • ExplicitAuthFlows (list) --

    The explicit authentication flows.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'UserPoolClient': {
        'UserPoolId': 'string',
        'ClientName': 'string',
        'ClientId': 'string',
        'ClientSecret': 'string',
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1),
        'RefreshTokenValidity': 123,
        'ReadAttributes': [
            'string',
        ],
        'WriteAttributes': [
            'string',
        ],
        'ExplicitAuthFlows': [
            'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY',
        ]
    }
}

Response Structure

  • (dict) --

    Represents the response from the server to create a user pool client.

    • UserPoolClient (dict) --

      The user pool client that was just created.

      • UserPoolId (string) --

        The user pool ID for the user pool client.

      • ClientName (string) --

        The client name from the user pool request of the client type.

      • ClientId (string) --

        The ID of the client associated with the user pool.

      • ClientSecret (string) --

        The client secret from the user pool request of the client type.

      • LastModifiedDate (datetime) --

        The last modified date from the user pool request of the client type.

      • CreationDate (datetime) --

        The creation date from the user pool request of the client type.

      • RefreshTokenValidity (integer) --

        The validity of the refresh token, in days.

      • ReadAttributes (list) --

        The Read-only attributes.

        • (string) --
      • WriteAttributes (list) --

        The writeable attributes.

        • (string) --
      • ExplicitAuthFlows (list) --

        The explicit authentication flows.

        • (string) --

delete_group(**kwargs)

Deletes a group. Currently only groups with no members can be deleted.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.delete_group(
    GroupName='string',
    UserPoolId='string'
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the group.

  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

Returns

None

delete_user(**kwargs)

Allows a user to delete one's self.

See also: AWS API Documentation

Request Syntax

response = client.delete_user(
    AccessToken='string'
)
Parameters
AccessToken (string) -- The access token from a request to delete a user.
Returns
None
delete_user_attributes(**kwargs)

Deletes the attributes for a user.

See also: AWS API Documentation

Request Syntax

response = client.delete_user_attributes(
    UserAttributeNames=[
        'string',
    ],
    AccessToken='string'
)
Parameters
  • UserAttributeNames (list) --

    [REQUIRED]

    An array of strings representing the user attribute names you wish to delete.

    • (string) --
  • AccessToken (string) -- The access token used in the request to delete user attributes.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server to delete user attributes.

delete_user_pool(**kwargs)

Deletes the specified Amazon Cognito user pool.

See also: AWS API Documentation

Request Syntax

response = client.delete_user_pool(
    UserPoolId='string'
)
Parameters
UserPoolId (string) --

[REQUIRED]

The user pool ID for the user pool you want to delete.

Returns
None
delete_user_pool_client(**kwargs)

Allows the developer to delete the user pool client.

See also: AWS API Documentation

Request Syntax

response = client.delete_user_pool_client(
    UserPoolId='string',
    ClientId='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to delete the client.

  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

Returns

None

describe_user_import_job(**kwargs)

Describes the user import job.

See also: AWS API Documentation

Request Syntax

response = client.describe_user_import_job(
    UserPoolId='string',
    JobId='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool that the users are being imported into.

  • JobId (string) --

    [REQUIRED]

    The job ID for the user import job.

Return type

dict

Returns

Response Syntax

{
    'UserImportJob': {
        'JobName': 'string',
        'JobId': 'string',
        'UserPoolId': 'string',
        'PreSignedUrl': 'string',
        'CreationDate': datetime(2015, 1, 1),
        'StartDate': datetime(2015, 1, 1),
        'CompletionDate': datetime(2015, 1, 1),
        'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
        'CloudWatchLogsRoleArn': 'string',
        'ImportedUsers': 123,
        'SkippedUsers': 123,
        'FailedUsers': 123,
        'CompletionMessage': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to describe the user import job.

    • UserImportJob (dict) --

      The job object that represents the user import job.

      • JobName (string) --

        The job name for the user import job.

      • JobId (string) --

        The job ID for the user import job.

      • UserPoolId (string) --

        The user pool ID for the user pool that the users are being imported into.

      • PreSignedUrl (string) --

        The pre-signed URL to be used to upload the .csv file.

      • CreationDate (datetime) --

        The date when the user import job was created.

      • StartDate (datetime) --

        The date when the user import job was started.

      • CompletionDate (datetime) --

        The date when the user imoprt job was completed.

      • Status (string) --

        The status of the user import job. One of the following:

        • Created - The job was created but not started.
        • Pending - A transition state. You have started the job, but it has not begun importing users yet.
        • InProgress - The job has started, and users are being imported.
        • Stopping - You have stopped the job, but the job has not stopped importing users yet.
        • Stopped - You have stopped the job, and the job has stopped importing users.
        • Succeeded - The job has completed successfully.
        • Failed - The job has stopped due to an error.
        • Expired - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
      • CloudWatchLogsRoleArn (string) --

        The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.

      • ImportedUsers (integer) --

        The number of users that were successfully imported.

      • SkippedUsers (integer) --

        The number of users that were skipped.

      • FailedUsers (integer) --

        The number of users that could not be imported.

      • CompletionMessage (string) --

        The message returned when the user import job is completed.

describe_user_pool(**kwargs)

Returns the configuration information and metadata of the specified user pool.

See also: AWS API Documentation

Request Syntax

response = client.describe_user_pool(
    UserPoolId='string'
)
Parameters
UserPoolId (string) --

[REQUIRED]

The user pool ID for the user pool you want to describe.

Return type
dict
Returns
Response Syntax
{
    'UserPool': {
        'Id': 'string',
        'Name': 'string',
        'Policies': {
            'PasswordPolicy': {
                'MinimumLength': 123,
                'RequireUppercase': True|False,
                'RequireLowercase': True|False,
                'RequireNumbers': True|False,
                'RequireSymbols': True|False
            }
        },
        'LambdaConfig': {
            'PreSignUp': 'string',
            'CustomMessage': 'string',
            'PostConfirmation': 'string',
            'PreAuthentication': 'string',
            'PostAuthentication': 'string',
            'DefineAuthChallenge': 'string',
            'CreateAuthChallenge': 'string',
            'VerifyAuthChallengeResponse': 'string'
        },
        'Status': 'Enabled'|'Disabled',
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1),
        'SchemaAttributes': [
            {
                'Name': 'string',
                'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean',
                'DeveloperOnlyAttribute': True|False,
                'Mutable': True|False,
                'Required': True|False,
                'NumberAttributeConstraints': {
                    'MinValue': 'string',
                    'MaxValue': 'string'
                },
                'StringAttributeConstraints': {
                    'MinLength': 'string',
                    'MaxLength': 'string'
                }
            },
        ],
        'AutoVerifiedAttributes': [
            'phone_number'|'email',
        ],
        'AliasAttributes': [
            'phone_number'|'email'|'preferred_username',
        ],
        'SmsVerificationMessage': 'string',
        'EmailVerificationMessage': 'string',
        'EmailVerificationSubject': 'string',
        'SmsAuthenticationMessage': 'string',
        'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
        'DeviceConfiguration': {
            'ChallengeRequiredOnNewDevice': True|False,
            'DeviceOnlyRememberedOnUserPrompt': True|False
        },
        'EstimatedNumberOfUsers': 123,
        'EmailConfiguration': {
            'SourceArn': 'string',
            'ReplyToEmailAddress': 'string'
        },
        'SmsConfiguration': {
            'SnsCallerArn': 'string',
            'ExternalId': 'string'
        },
        'UserPoolTags': {
            'string': 'string'
        },
        'SmsConfigurationFailure': 'string',
        'EmailConfigurationFailure': 'string',
        'AdminCreateUserConfig': {
            'AllowAdminCreateUserOnly': True|False,
            'UnusedAccountValidityDays': 123,
            'InviteMessageTemplate': {
                'SMSMessage': 'string',
                'EmailMessage': 'string',
                'EmailSubject': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents the response to describe the user pool.

    • UserPool (dict) --

      The container of metadata returned by the server to describe the pool.

      • Id (string) --

        The ID of the user pool.

      • Name (string) --

        The name of the user pool.

      • Policies (dict) --

        A container describing the policies associated with a user pool.

        • PasswordPolicy (dict) --

          A container with information about the user pool password policy.

          • MinimumLength (integer) --

            The minimum length of the password policy that you have set. Cannot be less than 6.

          • RequireUppercase (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.

          • RequireLowercase (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.

          • RequireNumbers (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one number in their password.

          • RequireSymbols (boolean) --

            In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.

      • LambdaConfig (dict) --

        A container describing the AWS Lambda triggers associated with a user pool.

        • PreSignUp (string) --

          A pre-registration AWS Lambda trigger.

        • CustomMessage (string) --

          A custom Message AWS Lambda trigger.

        • PostConfirmation (string) --

          A post-confirmation AWS Lambda trigger.

        • PreAuthentication (string) --

          A pre-authentication AWS Lambda trigger.

        • PostAuthentication (string) --

          A post-authentication AWS Lambda trigger.

        • DefineAuthChallenge (string) --

          Defines the authentication challenge.

        • CreateAuthChallenge (string) --

          Creates an authentication challenge.

        • VerifyAuthChallengeResponse (string) --

          Verifies the authentication challenge response.

      • Status (string) --

        The status of a user pool.

      • LastModifiedDate (datetime) --

        The last modified date of a user pool.

      • CreationDate (datetime) --

        The creation date of a user pool.

      • SchemaAttributes (list) --

        A container with the schema attributes of a user pool.

        • (dict) --

          Contains information about the schema attribute.

          • Name (string) --

            A schema attribute of the name type.

          • AttributeDataType (string) --

            The attribute data type.

          • DeveloperOnlyAttribute (boolean) --

            Specifies whether the attribute type is developer only.

          • Mutable (boolean) --

            Specifies whether the attribute can be changed once it has been created.

          • Required (boolean) --

            Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

          • NumberAttributeConstraints (dict) --

            Specifies the constraints for an attribute of the number type.

            • MinValue (string) --

              The minimum value of an attribute that is of the number data type.

            • MaxValue (string) --

              The maximum value of an attribute that is of the number data type.

          • StringAttributeConstraints (dict) --

            Specifies the constraints for an attribute of the string type.

            • MinLength (string) --

              The minimum length of an attribute value of the string type.

            • MaxLength (string) --

              The maximum length of an attribute value of the string type.

      • AutoVerifiedAttributes (list) --

        Specifies the attributes that are auto-verified in a user pool.

        • (string) --
      • AliasAttributes (list) --

        Specifies the attributes that are aliased in a user pool.

        • (string) --
      • SmsVerificationMessage (string) --

        The contents of the SMS verification message.

      • EmailVerificationMessage (string) --

        The contents of the email verification message.

      • EmailVerificationSubject (string) --

        The subject of the email verification message.

      • SmsAuthenticationMessage (string) --

        The contents of the SMS authentication message.

      • MfaConfiguration (string) --

        Can be one of the following values:

        • OFF - MFA tokens are not required and cannot be specified during user registration.
        • ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.
        • OPTIONAL - Users have the option when registering to create an MFA token.
      • DeviceConfiguration (dict) --

        The device configuration.

        • ChallengeRequiredOnNewDevice (boolean) --

          Indicates whether a challenge is required on a new device. Only applicable to a new device.

        • DeviceOnlyRememberedOnUserPrompt (boolean) --

          If true, a device is only remembered on user prompt.

      • EstimatedNumberOfUsers (integer) --

        A number estimating the size of the user pool.

      • EmailConfiguration (dict) --

        The email configuration.

        • SourceArn (string) --

          The Amazon Resource Name (ARN) of the email source.

        • ReplyToEmailAddress (string) --

          The REPLY-TO email address.

      • SmsConfiguration (dict) --

        The SMS configuration.

        • SnsCallerArn (string) --

          The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

        • ExternalId (string) --

          The external ID.

      • UserPoolTags (dict) --

        The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

        • (string) --
          • (string) --
      • SmsConfigurationFailure (string) --

        The reason why the SMS configuration cannot send the message(s) to your users.

      • EmailConfigurationFailure (string) --

        The reason why the email configuration cannot send the messages to your users.

      • AdminCreateUserConfig (dict) --

        The configuration for AdminCreateUser requests.

        • AllowAdminCreateUserOnly (boolean) --

          Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

        • UnusedAccountValidityDays (integer) --

          The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

        • InviteMessageTemplate (dict) --

          The message template to be used for the welcome message to new users.

          • SMSMessage (string) --

            The message template for SMS messages.

          • EmailMessage (string) --

            The message template for email messages.

          • EmailSubject (string) --

            The subject line for email messages.

describe_user_pool_client(**kwargs)

Client method for returning the configuration information and metadata of the specified user pool client.

See also: AWS API Documentation

Request Syntax

response = client.describe_user_pool_client(
    UserPoolId='string',
    ClientId='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool you want to describe.

  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

Return type

dict

Returns

Response Syntax

{
    'UserPoolClient': {
        'UserPoolId': 'string',
        'ClientName': 'string',
        'ClientId': 'string',
        'ClientSecret': 'string',
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1),
        'RefreshTokenValidity': 123,
        'ReadAttributes': [
            'string',
        ],
        'WriteAttributes': [
            'string',
        ],
        'ExplicitAuthFlows': [
            'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY',
        ]
    }
}

Response Structure

  • (dict) --

    Represents the response from the server from a request to describe the user pool client.

    • UserPoolClient (dict) --

      The user pool client from a server response to describe the user pool client.

      • UserPoolId (string) --

        The user pool ID for the user pool client.

      • ClientName (string) --

        The client name from the user pool request of the client type.

      • ClientId (string) --

        The ID of the client associated with the user pool.

      • ClientSecret (string) --

        The client secret from the user pool request of the client type.

      • LastModifiedDate (datetime) --

        The last modified date from the user pool request of the client type.

      • CreationDate (datetime) --

        The creation date from the user pool request of the client type.

      • RefreshTokenValidity (integer) --

        The validity of the refresh token, in days.

      • ReadAttributes (list) --

        The Read-only attributes.

        • (string) --
      • WriteAttributes (list) --

        The writeable attributes.

        • (string) --
      • ExplicitAuthFlows (list) --

        The explicit authentication flows.

        • (string) --

forget_device(**kwargs)

Forgets the specified device.

See also: AWS API Documentation

Request Syntax

response = client.forget_device(
    AccessToken='string',
    DeviceKey='string'
)
Parameters
  • AccessToken (string) -- The access token for the forgotten device request.
  • DeviceKey (string) --

    [REQUIRED]

    The device key.

Returns

None

forgot_password(**kwargs)

Retrieves the password for the specified client ID or username.

See also: AWS API Documentation

Request Syntax

response = client.forgot_password(
    ClientId='string',
    SecretHash='string',
    Username='string'
)
Parameters
  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

  • SecretHash (string) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
  • Username (string) --

    [REQUIRED]

    The user name of the user for whom you want to enter a code to reset a forgotten password.

Return type

dict

Returns

Response Syntax

{
    'CodeDeliveryDetails': {
        'Destination': 'string',
        'DeliveryMedium': 'SMS'|'EMAIL',
        'AttributeName': 'string'
    }
}

Response Structure

  • (dict) --

    Respresents the response from the server regarding the request to reset a password.

    • CodeDeliveryDetails (dict) --

      The code delivery details returned by the server in response to the request to reset a password.

      • Destination (string) --

        The destination for the code delivery details.

      • DeliveryMedium (string) --

        The delivery medium (email message or phone number).

      • AttributeName (string) --

        The name of the attribute in the code delivery details type.

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_csv_header(**kwargs)

Gets the header information for the .csv file to be used as input for the user import job.

See also: AWS API Documentation

Request Syntax

response = client.get_csv_header(
    UserPoolId='string'
)
Parameters
UserPoolId (string) --

[REQUIRED]

The user pool ID for the user pool that the users are to be imported into.

Return type
dict
Returns
Response Syntax
{
    'UserPoolId': 'string',
    'CSVHeader': [
        'string',
    ]
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to get the header information for the .csv file for the user import job.

    • UserPoolId (string) --

      The user pool ID for the user pool that the users are to be imported into.

    • CSVHeader (list) --

      The header information for the .csv file for the user import job.

      • (string) --
get_device(**kwargs)

Gets the device.

See also: AWS API Documentation

Request Syntax

response = client.get_device(
    DeviceKey='string',
    AccessToken='string'
)
Parameters
  • DeviceKey (string) --

    [REQUIRED]

    The device key.

  • AccessToken (string) -- The access token.
Return type

dict

Returns

Response Syntax

{
    'Device': {
        'DeviceKey': 'string',
        'DeviceAttributes': [
            {
                'Name': 'string',
                'Value': 'string'
            },
        ],
        'DeviceCreateDate': datetime(2015, 1, 1),
        'DeviceLastModifiedDate': datetime(2015, 1, 1),
        'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    Gets the device response.

    • Device (dict) --

      The device.

      • DeviceKey (string) --

        The device key.

      • DeviceAttributes (list) --

        The device attributes.

        • (dict) --

          Specifies whether the attribute is standard or custom.

          • Name (string) --

            The name of the attribute.

          • Value (string) --

            The value of the attribute.

      • DeviceCreateDate (datetime) --

        The creation date of the device.

      • DeviceLastModifiedDate (datetime) --

        The last modified date of the device.

      • DeviceLastAuthenticatedDate (datetime) --

        The date in which the device was last authenticated.

get_group(**kwargs)

Gets a group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.get_group(
    GroupName='string',
    UserPoolId='string'
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the group.

  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

Return type

dict

Returns

Response Syntax

{
    'Group': {
        'GroupName': 'string',
        'UserPoolId': 'string',
        'Description': 'string',
        'RoleArn': 'string',
        'Precedence': 123,
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      The group object for the group.

      • GroupName (string) --

        The name of the group.

      • UserPoolId (string) --

        The user pool ID for the user pool.

      • Description (string) --

        A string containing the description of the group.

      • RoleArn (string) --

        The role ARN for the group.

      • Precedence (integer) --

        A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

        Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

        The default Precedence value is null.

      • LastModifiedDate (datetime) --

        The date the group was last modified.

      • CreationDate (datetime) --

        The date the group was created.

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
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'
)
Parameters
AccessToken (string) -- The access token returned by the server response to get information about the user.
Return type
dict
Returns
Response Syntax
{
    'Username': 'string',
    'UserAttributes': [
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    'MFAOptions': [
        {
            'DeliveryMedium': 'SMS'|'EMAIL',
            'AttributeName': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the response from the server from the request to get information about the user.

    • Username (string) --

      The user name of the user you wish to retrieve from the get user request.

    • UserAttributes (list) --

      An array of name-value pairs representing user attributes.

      • (dict) --

        Specifies whether the attribute is standard or custom.

        • Name (string) --

          The name of the attribute.

        • Value (string) --

          The value of the attribute.

    • MFAOptions (list) --

      Specifies the options for MFA (e.g., email or phone number).

      • (dict) --

        Specifies the different settings for multi-factor authentication (MFA).

        • DeliveryMedium (string) --

          The delivery medium (email message or SMS message) to send the MFA code.

        • AttributeName (string) --

          The attribute name of the MFA option type.

get_user_attribute_verification_code(**kwargs)

Gets the user attribute verification code for the specified attribute name.

See also: AWS API Documentation

Request Syntax

response = client.get_user_attribute_verification_code(
    AccessToken='string',
    AttributeName='string'
)
Parameters
  • AccessToken (string) -- The access token returned by the server response to get the user attribute verification code.
  • AttributeName (string) --

    [REQUIRED]

    The attribute name returned by the server response to get the user attribute verification code.

Return type

dict

Returns

Response Syntax

{
    'CodeDeliveryDetails': {
        'Destination': 'string',
        'DeliveryMedium': 'SMS'|'EMAIL',
        'AttributeName': 'string'
    }
}

Response Structure

  • (dict) --

    The verification code response returned by the server response to get the user attribute verification code.

    • CodeDeliveryDetails (dict) --

      The code delivery details returned by the server in response to the request to get the user attribute verification code.

      • Destination (string) --

        The destination for the code delivery details.

      • DeliveryMedium (string) --

        The delivery medium (email message or phone number).

      • AttributeName (string) --

        The name of the attribute in the code delivery details type.

get_waiter(waiter_name)
global_sign_out(**kwargs)

Signs out users from all devices.

See also: AWS API Documentation

Request Syntax

response = client.global_sign_out(
    AccessToken='string'
)
Parameters
AccessToken (string) -- The access token.
Return type
dict
Returns
Response Syntax
{}

Response Structure

  • (dict) --

    The response to the request to sign out all devices.

initiate_auth(**kwargs)

Initiates the authentication flow.

See also: AWS API Documentation

Request Syntax

response = client.initiate_auth(
    AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH',
    AuthParameters={
        'string': 'string'
    },
    ClientMetadata={
        'string': 'string'
    },
    ClientId='string'
)
Parameters
  • AuthFlow (string) --

    [REQUIRED]

    The authentication flow.

  • AuthParameters (dict) --

    The authentication parameters.

    • (string) --
      • (string) --
  • ClientMetadata (dict) --

    The client app's metadata.

    • (string) --
      • (string) --
  • ClientId (string) --

    [REQUIRED]

    The client ID.

Return type

dict

Returns

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Initiates the authentication response.

    • ChallengeName (string) --

      The name of the challenge.

    • Session (string) --

      The session.

    • ChallengeParameters (dict) --

      The challenge parameters.

      • (string) --
        • (string) --
    • AuthenticationResult (dict) --

      The result returned by the server in response to the request to initiate authentication.

      • AccessToken (string) --

        The access token of the authentication result.

      • ExpiresIn (integer) --

        The expiration period of the authentication result.

      • TokenType (string) --

        The token type of the authentication result.

      • RefreshToken (string) --

        The refresh token of the authentication result.

      • IdToken (string) --

        The ID token of the authentication result.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key.

        • DeviceGroupKey (string) --

          The device group key.

list_devices(**kwargs)

Lists the devices.

See also: AWS API Documentation

Request Syntax

response = client.list_devices(
    AccessToken='string',
    Limit=123,
    PaginationToken='string'
)
Parameters
  • AccessToken (string) --

    [REQUIRED]

    The access tokens for the request to list devices.

  • Limit (integer) -- The limit of the device request.
  • PaginationToken (string) -- The pagination token for the list request.
Return type

dict

Returns

Response Syntax

{
    'Devices': [
        {
            'DeviceKey': 'string',
            'DeviceAttributes': [
                {
                    'Name': 'string',
                    'Value': 'string'
                },
            ],
            'DeviceCreateDate': datetime(2015, 1, 1),
            'DeviceLastModifiedDate': datetime(2015, 1, 1),
            'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
        },
    ],
    'PaginationToken': 'string'
}

Response Structure

  • (dict) --

    Represents the response to list devices.

    • Devices (list) --

      The devices returned in the list devices response.

      • (dict) --

        The device type.

        • DeviceKey (string) --

          The device key.

        • DeviceAttributes (list) --

          The device attributes.

          • (dict) --

            Specifies whether the attribute is standard or custom.

            • Name (string) --

              The name of the attribute.

            • Value (string) --

              The value of the attribute.

        • DeviceCreateDate (datetime) --

          The creation date of the device.

        • DeviceLastModifiedDate (datetime) --

          The last modified date of the device.

        • DeviceLastAuthenticatedDate (datetime) --

          The date in which the device was last authenticated.

    • PaginationToken (string) --

      The pagination token for the list device response.

list_groups(**kwargs)

Lists the groups associated with a user pool.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.list_groups(
    UserPoolId='string',
    Limit=123,
    NextToken='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

  • Limit (integer) -- The limit of the request to list groups.
  • NextToken (string) -- An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Return type

dict

Returns

Response Syntax

{
    'Groups': [
        {
            'GroupName': 'string',
            'UserPoolId': 'string',
            'Description': 'string',
            'RoleArn': 'string',
            'Precedence': 123,
            'LastModifiedDate': datetime(2015, 1, 1),
            'CreationDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Groups (list) --

      The group objects for the groups.

      • (dict) --

        The group type.

        • GroupName (string) --

          The name of the group.

        • UserPoolId (string) --

          The user pool ID for the user pool.

        • Description (string) --

          A string containing the description of the group.

        • RoleArn (string) --

          The role ARN for the group.

        • Precedence (integer) --

          A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

          Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

          The default Precedence value is null.

        • LastModifiedDate (datetime) --

          The date the group was last modified.

        • CreationDate (datetime) --

          The date the group was created.

    • NextToken (string) --

      An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

list_user_import_jobs(**kwargs)

Lists the user import jobs.

See also: AWS API Documentation

Request Syntax

response = client.list_user_import_jobs(
    UserPoolId='string',
    MaxResults=123,
    PaginationToken='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool that the users are being imported into.

  • MaxResults (integer) --

    [REQUIRED]

    The maximum number of import jobs you want the request to return.

  • PaginationToken (string) -- An identifier that was returned from the previous call to ListUserImportJobs, which can be used to return the next set of import jobs in the list.
Return type

dict

Returns

Response Syntax

{
    'UserImportJobs': [
        {
            'JobName': 'string',
            'JobId': 'string',
            'UserPoolId': 'string',
            'PreSignedUrl': 'string',
            'CreationDate': datetime(2015, 1, 1),
            'StartDate': datetime(2015, 1, 1),
            'CompletionDate': datetime(2015, 1, 1),
            'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
            'CloudWatchLogsRoleArn': 'string',
            'ImportedUsers': 123,
            'SkippedUsers': 123,
            'FailedUsers': 123,
            'CompletionMessage': 'string'
        },
    ],
    'PaginationToken': 'string'
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to list the user import jobs.

    • UserImportJobs (list) --

      The user import jobs.

      • (dict) --

        The user import job type.

        • JobName (string) --

          The job name for the user import job.

        • JobId (string) --

          The job ID for the user import job.

        • UserPoolId (string) --

          The user pool ID for the user pool that the users are being imported into.

        • PreSignedUrl (string) --

          The pre-signed URL to be used to upload the .csv file.

        • CreationDate (datetime) --

          The date when the user import job was created.

        • StartDate (datetime) --

          The date when the user import job was started.

        • CompletionDate (datetime) --

          The date when the user imoprt job was completed.

        • Status (string) --

          The status of the user import job. One of the following:

          • Created - The job was created but not started.
          • Pending - A transition state. You have started the job, but it has not begun importing users yet.
          • InProgress - The job has started, and users are being imported.
          • Stopping - You have stopped the job, but the job has not stopped importing users yet.
          • Stopped - You have stopped the job, and the job has stopped importing users.
          • Succeeded - The job has completed successfully.
          • Failed - The job has stopped due to an error.
          • Expired - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
        • CloudWatchLogsRoleArn (string) --

          The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.

        • ImportedUsers (integer) --

          The number of users that were successfully imported.

        • SkippedUsers (integer) --

          The number of users that were skipped.

        • FailedUsers (integer) --

          The number of users that could not be imported.

        • CompletionMessage (string) --

          The message returned when the user import job is completed.

    • PaginationToken (string) --

      An identifier that can be used to return the next set of user import jobs in the list.

list_user_pool_clients(**kwargs)

Lists the clients that have been created for the specified user pool.

See also: AWS API Documentation

Request Syntax

response = client.list_user_pool_clients(
    UserPoolId='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to list user pool clients.

  • MaxResults (integer) -- The maximum number of results you want the request to return when listing the user pool clients.
  • NextToken (string) -- An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Return type

dict

Returns

Response Syntax

{
    'UserPoolClients': [
        {
            'ClientId': 'string',
            'UserPoolId': 'string',
            'ClientName': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the response from the server that lists user pool clients.

    • UserPoolClients (list) --

      The user pool clients in the response that lists user pool clients.

      • (dict) --

        The description of the user pool client.

        • ClientId (string) --

          The ID of the client associated with the user pool.

        • UserPoolId (string) --

          The user pool ID for the user pool where you want to describe the user pool client.

        • ClientName (string) --

          The client name from the user pool client description.

    • NextToken (string) --

      An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

list_user_pools(**kwargs)

Lists the user pools associated with an AWS account.

See also: AWS API Documentation

Request Syntax

response = client.list_user_pools(
    NextToken='string',
    MaxResults=123
)
Parameters
  • NextToken (string) -- An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
  • MaxResults (integer) --

    [REQUIRED]

    The maximum number of results you want the request to return when listing the user pools.

Return type

dict

Returns

Response Syntax

{
    'UserPools': [
        {
            'Id': 'string',
            'Name': 'string',
            'LambdaConfig': {
                'PreSignUp': 'string',
                'CustomMessage': 'string',
                'PostConfirmation': 'string',
                'PreAuthentication': 'string',
                'PostAuthentication': 'string',
                'DefineAuthChallenge': 'string',
                'CreateAuthChallenge': 'string',
                'VerifyAuthChallengeResponse': 'string'
            },
            'Status': 'Enabled'|'Disabled',
            'LastModifiedDate': datetime(2015, 1, 1),
            'CreationDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Represents the response to list user pools.

    • UserPools (list) --

      The user pools from the response to list users.

      • (dict) --

        A user pool description.

        • Id (string) --

          The ID in a user pool description.

        • Name (string) --

          The name in a user pool description.

        • LambdaConfig (dict) --

          The AWS Lambda configuration information in a user pool description.

          • PreSignUp (string) --

            A pre-registration AWS Lambda trigger.

          • CustomMessage (string) --

            A custom Message AWS Lambda trigger.

          • PostConfirmation (string) --

            A post-confirmation AWS Lambda trigger.

          • PreAuthentication (string) --

            A pre-authentication AWS Lambda trigger.

          • PostAuthentication (string) --

            A post-authentication AWS Lambda trigger.

          • DefineAuthChallenge (string) --

            Defines the authentication challenge.

          • CreateAuthChallenge (string) --

            Creates an authentication challenge.

          • VerifyAuthChallengeResponse (string) --

            Verifies the authentication challenge response.

        • Status (string) --

          The user pool status in a user pool description.

        • LastModifiedDate (datetime) --

          The last modified date in a user pool description.

        • CreationDate (datetime) --

          The creation date in a user pool description.

    • NextToken (string) --

      An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

list_users(**kwargs)

Lists the users in the Amazon Cognito user pool.

See also: AWS API Documentation

Request Syntax

response = client.list_users(
    UserPoolId='string',
    AttributesToGet=[
        'string',
    ],
    Limit=123,
    PaginationToken='string',
    Filter='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for which you want to list users.

  • AttributesToGet (list) --

    The attributes to get from the request to list users.

    • (string) --
  • Limit (integer) -- The limit of the request to list users.
  • PaginationToken (string) -- An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
  • Filter (string) -- The filter for the list users request.
Return type

dict

Returns

Response Syntax

{
    'Users': [
        {
            'Username': 'string',
            'Attributes': [
                {
                    'Name': 'string',
                    'Value': 'string'
                },
            ],
            'UserCreateDate': datetime(2015, 1, 1),
            'UserLastModifiedDate': datetime(2015, 1, 1),
            'Enabled': True|False,
            'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
            'MFAOptions': [
                {
                    'DeliveryMedium': 'SMS'|'EMAIL',
                    'AttributeName': 'string'
                },
            ]
        },
    ],
    'PaginationToken': 'string'
}

Response Structure

  • (dict) --

    The response from the request to list users.

    • Users (list) --

      The users returned in the request to list users.

      • (dict) --

        The user type.

        • Username (string) --

          The user name of the user you wish to describe.

        • Attributes (list) --

          A container with information about the user type attributes.

          • (dict) --

            Specifies whether the attribute is standard or custom.

            • Name (string) --

              The name of the attribute.

            • Value (string) --

              The value of the attribute.

        • UserCreateDate (datetime) --

          The creation date of the user.

        • UserLastModifiedDate (datetime) --

          The last modified date of the user.

        • Enabled (boolean) --

          Specifies whether the user is enabled.

        • UserStatus (string) --

          The user status. Can be one of the following:

          • UNCONFIRMED - User has been created but not confirmed.
          • CONFIRMED - User has been confirmed.
          • ARCHIVED - User is no longer active.
          • COMPROMISED - User is disabled due to a potential security threat.
          • UNKNOWN - User status is not known.
        • MFAOptions (list) --

          The MFA options for the user.

          • (dict) --

            Specifies the different settings for multi-factor authentication (MFA).

            • DeliveryMedium (string) --

              The delivery medium (email message or SMS message) to send the MFA code.

            • AttributeName (string) --

              The attribute name of the MFA option type.

    • PaginationToken (string) --

      An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

list_users_in_group(**kwargs)

Lists the users in the specified group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.list_users_in_group(
    UserPoolId='string',
    GroupName='string',
    Limit=123,
    NextToken='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

  • GroupName (string) --

    [REQUIRED]

    The name of the group.

  • Limit (integer) -- The limit of the request to list users.
  • NextToken (string) -- An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Return type

dict

Returns

Response Syntax

{
    'Users': [
        {
            'Username': 'string',
            'Attributes': [
                {
                    'Name': 'string',
                    'Value': 'string'
                },
            ],
            'UserCreateDate': datetime(2015, 1, 1),
            'UserLastModifiedDate': datetime(2015, 1, 1),
            'Enabled': True|False,
            'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
            'MFAOptions': [
                {
                    'DeliveryMedium': 'SMS'|'EMAIL',
                    'AttributeName': 'string'
                },
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Users (list) --

      The users returned in the request to list users.

      • (dict) --

        The user type.

        • Username (string) --

          The user name of the user you wish to describe.

        • Attributes (list) --

          A container with information about the user type attributes.

          • (dict) --

            Specifies whether the attribute is standard or custom.

            • Name (string) --

              The name of the attribute.

            • Value (string) --

              The value of the attribute.

        • UserCreateDate (datetime) --

          The creation date of the user.

        • UserLastModifiedDate (datetime) --

          The last modified date of the user.

        • Enabled (boolean) --

          Specifies whether the user is enabled.

        • UserStatus (string) --

          The user status. Can be one of the following:

          • UNCONFIRMED - User has been created but not confirmed.
          • CONFIRMED - User has been confirmed.
          • ARCHIVED - User is no longer active.
          • COMPROMISED - User is disabled due to a potential security threat.
          • UNKNOWN - User status is not known.
        • MFAOptions (list) --

          The MFA options for the user.

          • (dict) --

            Specifies the different settings for multi-factor authentication (MFA).

            • DeliveryMedium (string) --

              The delivery medium (email message or SMS message) to send the MFA code.

            • AttributeName (string) --

              The attribute name of the MFA option type.

    • NextToken (string) --

      An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.

resend_confirmation_code(**kwargs)

Resends the confirmation (for confirmation of registration) to a specific user in the user pool.

See also: AWS API Documentation

Request Syntax

response = client.resend_confirmation_code(
    ClientId='string',
    SecretHash='string',
    Username='string'
)
Parameters
  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

  • SecretHash (string) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
  • Username (string) --

    [REQUIRED]

    The user name of the user to whom you wish to resend a confirmation code.

Return type

dict

Returns

Response Syntax

{
    'CodeDeliveryDetails': {
        'Destination': 'string',
        'DeliveryMedium': 'SMS'|'EMAIL',
        'AttributeName': 'string'
    }
}

Response Structure

  • (dict) --

    The response from the server when the Amazon Cognito Your User Pools service makes the request to resend a confirmation code.

    • CodeDeliveryDetails (dict) --

      The code delivery details returned by the server in response to the request to resend the confirmation code.

      • Destination (string) --

        The destination for the code delivery details.

      • DeliveryMedium (string) --

        The delivery medium (email message or phone number).

      • AttributeName (string) --

        The name of the attribute in the code delivery details type.

respond_to_auth_challenge(**kwargs)

Responds to the authentication challenge.

See also: AWS API Documentation

Request Syntax

response = client.respond_to_auth_challenge(
    ClientId='string',
    ChallengeName='SMS_MFA'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
    Session='string',
    ChallengeResponses={
        'string': 'string'
    }
)
Parameters
  • ClientId (string) --

    [REQUIRED]

    The client ID.

  • ChallengeName (string) --

    [REQUIRED]

    The name of the challenge.

  • Session (string) -- The session.
  • ChallengeResponses (dict) --

    The responses to the authentication challenge.

    • (string) --
      • (string) --
Return type

dict

Returns

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    }
}

Response Structure

  • (dict) --

    The response to respond to the authentication challenge.

    • ChallengeName (string) --

      The challenge name.

    • Session (string) --

      The session.

    • ChallengeParameters (dict) --

      The challenge parameters.

      • (string) --
        • (string) --
    • AuthenticationResult (dict) --

      The result returned by the server in response to the request to respond to the authentication challenge.

      • AccessToken (string) --

        The access token of the authentication result.

      • ExpiresIn (integer) --

        The expiration period of the authentication result.

      • TokenType (string) --

        The token type of the authentication result.

      • RefreshToken (string) --

        The refresh token of the authentication result.

      • IdToken (string) --

        The ID token of the authentication result.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key.

        • DeviceGroupKey (string) --

          The device group key.

set_user_settings(**kwargs)

Sets the user settings like multi-factor authentication (MFA). If MFA is to be removed for a particular attribute pass the attribute with code delivery as null. If null list is passed, all MFA options are removed.

See also: AWS API Documentation

Request Syntax

response = client.set_user_settings(
    AccessToken='string',
    MFAOptions=[
        {
            'DeliveryMedium': 'SMS'|'EMAIL',
            'AttributeName': 'string'
        },
    ]
)
Parameters
  • AccessToken (string) --

    [REQUIRED]

    The access token for the set user settings request.

  • MFAOptions (list) --

    [REQUIRED]

    Specifies the options for MFA (e.g., email or phone number).

    • (dict) --

      Specifies the different settings for multi-factor authentication (MFA).

      • DeliveryMedium (string) --

        The delivery medium (email message or SMS message) to send the MFA code.

      • AttributeName (string) --

        The attribute name of the MFA option type.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    The response from the server for a set user settings request.

sign_up(**kwargs)

Registers the user in the specified user pool and creates a user name, password, and user attributes.

See also: AWS API Documentation

Request Syntax

response = client.sign_up(
    ClientId='string',
    SecretHash='string',
    Username='string',
    Password='string',
    UserAttributes=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    ValidationData=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ]
)
Parameters
  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

  • SecretHash (string) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
  • Username (string) --

    [REQUIRED]

    The user name of the user you wish to register.

  • Password (string) --

    [REQUIRED]

    The password of the user you wish to register.

  • UserAttributes (list) --

    An array of name-value pairs representing user attributes.

    • (dict) --

      Specifies whether the attribute is standard or custom.

      • Name (string) -- [REQUIRED]

        The name of the attribute.

      • Value (string) --

        The value of the attribute.

  • ValidationData (list) --

    The validation data in the request to register a user.

    • (dict) --

      Specifies whether the attribute is standard or custom.

      • Name (string) -- [REQUIRED]

        The name of the attribute.

      • Value (string) --

        The value of the attribute.

Return type

dict

Returns

Response Syntax

{
    'UserConfirmed': True|False,
    'CodeDeliveryDetails': {
        'Destination': 'string',
        'DeliveryMedium': 'SMS'|'EMAIL',
        'AttributeName': 'string'
    }
}

Response Structure

  • (dict) --

    The response from the server for a registration request.

    • UserConfirmed (boolean) --

      A response from the server indicating that a user registration has been confirmed.

    • CodeDeliveryDetails (dict) --

      The code delivery details returned by the server response to the user registration request.

      • Destination (string) --

        The destination for the code delivery details.

      • DeliveryMedium (string) --

        The delivery medium (email message or phone number).

      • AttributeName (string) --

        The name of the attribute in the code delivery details type.

start_user_import_job(**kwargs)

Starts the user import.

See also: AWS API Documentation

Request Syntax

response = client.start_user_import_job(
    UserPoolId='string',
    JobId='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool that the users are being imported into.

  • JobId (string) --

    [REQUIRED]

    The job ID for the user import job.

Return type

dict

Returns

Response Syntax

{
    'UserImportJob': {
        'JobName': 'string',
        'JobId': 'string',
        'UserPoolId': 'string',
        'PreSignedUrl': 'string',
        'CreationDate': datetime(2015, 1, 1),
        'StartDate': datetime(2015, 1, 1),
        'CompletionDate': datetime(2015, 1, 1),
        'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
        'CloudWatchLogsRoleArn': 'string',
        'ImportedUsers': 123,
        'SkippedUsers': 123,
        'FailedUsers': 123,
        'CompletionMessage': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to start the user import job.

    • UserImportJob (dict) --

      The job object that represents the user import job.

      • JobName (string) --

        The job name for the user import job.

      • JobId (string) --

        The job ID for the user import job.

      • UserPoolId (string) --

        The user pool ID for the user pool that the users are being imported into.

      • PreSignedUrl (string) --

        The pre-signed URL to be used to upload the .csv file.

      • CreationDate (datetime) --

        The date when the user import job was created.

      • StartDate (datetime) --

        The date when the user import job was started.

      • CompletionDate (datetime) --

        The date when the user imoprt job was completed.

      • Status (string) --

        The status of the user import job. One of the following:

        • Created - The job was created but not started.
        • Pending - A transition state. You have started the job, but it has not begun importing users yet.
        • InProgress - The job has started, and users are being imported.
        • Stopping - You have stopped the job, but the job has not stopped importing users yet.
        • Stopped - You have stopped the job, and the job has stopped importing users.
        • Succeeded - The job has completed successfully.
        • Failed - The job has stopped due to an error.
        • Expired - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
      • CloudWatchLogsRoleArn (string) --

        The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.

      • ImportedUsers (integer) --

        The number of users that were successfully imported.

      • SkippedUsers (integer) --

        The number of users that were skipped.

      • FailedUsers (integer) --

        The number of users that could not be imported.

      • CompletionMessage (string) --

        The message returned when the user import job is completed.

stop_user_import_job(**kwargs)

Stops the user import job.

See also: AWS API Documentation

Request Syntax

response = client.stop_user_import_job(
    UserPoolId='string',
    JobId='string'
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool that the users are being imported into.

  • JobId (string) --

    [REQUIRED]

    The job ID for the user import job.

Return type

dict

Returns

Response Syntax

{
    'UserImportJob': {
        'JobName': 'string',
        'JobId': 'string',
        'UserPoolId': 'string',
        'PreSignedUrl': 'string',
        'CreationDate': datetime(2015, 1, 1),
        'StartDate': datetime(2015, 1, 1),
        'CompletionDate': datetime(2015, 1, 1),
        'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
        'CloudWatchLogsRoleArn': 'string',
        'ImportedUsers': 123,
        'SkippedUsers': 123,
        'FailedUsers': 123,
        'CompletionMessage': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to stop the user import job.

    • UserImportJob (dict) --

      The job object that represents the user import job.

      • JobName (string) --

        The job name for the user import job.

      • JobId (string) --

        The job ID for the user import job.

      • UserPoolId (string) --

        The user pool ID for the user pool that the users are being imported into.

      • PreSignedUrl (string) --

        The pre-signed URL to be used to upload the .csv file.

      • CreationDate (datetime) --

        The date when the user import job was created.

      • StartDate (datetime) --

        The date when the user import job was started.

      • CompletionDate (datetime) --

        The date when the user imoprt job was completed.

      • Status (string) --

        The status of the user import job. One of the following:

        • Created - The job was created but not started.
        • Pending - A transition state. You have started the job, but it has not begun importing users yet.
        • InProgress - The job has started, and users are being imported.
        • Stopping - You have stopped the job, but the job has not stopped importing users yet.
        • Stopped - You have stopped the job, and the job has stopped importing users.
        • Succeeded - The job has completed successfully.
        • Failed - The job has stopped due to an error.
        • Expired - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
      • CloudWatchLogsRoleArn (string) --

        The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.

      • ImportedUsers (integer) --

        The number of users that were successfully imported.

      • SkippedUsers (integer) --

        The number of users that were skipped.

      • FailedUsers (integer) --

        The number of users that could not be imported.

      • CompletionMessage (string) --

        The message returned when the user import job is completed.

update_device_status(**kwargs)

Updates the device status.

See also: AWS API Documentation

Request Syntax

response = client.update_device_status(
    AccessToken='string',
    DeviceKey='string',
    DeviceRememberedStatus='remembered'|'not_remembered'
)
Parameters
  • AccessToken (string) --

    [REQUIRED]

    The access token.

  • DeviceKey (string) --

    [REQUIRED]

    The device key.

  • DeviceRememberedStatus (string) -- The status of whether a device is remembered.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    The response to the request to update the device status.

update_group(**kwargs)

Updates the specified group with the specified attributes.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.update_group(
    GroupName='string',
    UserPoolId='string',
    Description='string',
    RoleArn='string',
    Precedence=123
)
Parameters
  • GroupName (string) --

    [REQUIRED]

    The name of the group.

  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool.

  • Description (string) -- A string containing the new description of the group.
  • RoleArn (string) -- The new role ARN for the group. This is used for setting the cognito:roles and cognito:preferred_role claims in the token.
  • Precedence (integer) -- The new precedence value for the group. For more information about this parameter, see CreateGroupRequest .
Return type

dict

Returns

Response Syntax

{
    'Group': {
        'GroupName': 'string',
        'UserPoolId': 'string',
        'Description': 'string',
        'RoleArn': 'string',
        'Precedence': 123,
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • Group (dict) --

      The group object for the group.

      • GroupName (string) --

        The name of the group.

      • UserPoolId (string) --

        The user pool ID for the user pool.

      • Description (string) --

        A string containing the description of the group.

      • RoleArn (string) --

        The role ARN for the group.

      • Precedence (integer) --

        A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

        Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

        The default Precedence value is null.

      • LastModifiedDate (datetime) --

        The date the group was last modified.

      • CreationDate (datetime) --

        The date the group was created.

update_user_attributes(**kwargs)

Allows a user to update a specific attribute (one at a time).

See also: AWS API Documentation

Request Syntax

response = client.update_user_attributes(
    UserAttributes=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    AccessToken='string'
)
Parameters
  • UserAttributes (list) --

    [REQUIRED]

    An array of name-value pairs representing user attributes.

    • (dict) --

      Specifies whether the attribute is standard or custom.

      • Name (string) -- [REQUIRED]

        The name of the attribute.

      • Value (string) --

        The value of the attribute.

  • AccessToken (string) -- The access token for the request to update user attributes.
Return type

dict

Returns

Response Syntax

{
    'CodeDeliveryDetailsList': [
        {
            'Destination': 'string',
            'DeliveryMedium': 'SMS'|'EMAIL',
            'AttributeName': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    Represents the response from the server for the request to update user attributes.

    • CodeDeliveryDetailsList (list) --

      The code delivery details list from the server for the request to update user attributes.

      • (dict) --

        The type of code delivery details being returned from the server.

        • Destination (string) --

          The destination for the code delivery details.

        • DeliveryMedium (string) --

          The delivery medium (email message or phone number).

        • AttributeName (string) --

          The name of the attribute in the code delivery details type.

update_user_pool(**kwargs)

Updates the specified user pool with the specified attributes.

See also: AWS API Documentation

Request Syntax

response = client.update_user_pool(
    UserPoolId='string',
    Policies={
        'PasswordPolicy': {
            'MinimumLength': 123,
            'RequireUppercase': True|False,
            'RequireLowercase': True|False,
            'RequireNumbers': True|False,
            'RequireSymbols': True|False
        }
    },
    LambdaConfig={
        'PreSignUp': 'string',
        'CustomMessage': 'string',
        'PostConfirmation': 'string',
        'PreAuthentication': 'string',
        'PostAuthentication': 'string',
        'DefineAuthChallenge': 'string',
        'CreateAuthChallenge': 'string',
        'VerifyAuthChallengeResponse': 'string'
    },
    AutoVerifiedAttributes=[
        'phone_number'|'email',
    ],
    SmsVerificationMessage='string',
    EmailVerificationMessage='string',
    EmailVerificationSubject='string',
    SmsAuthenticationMessage='string',
    MfaConfiguration='OFF'|'ON'|'OPTIONAL',
    DeviceConfiguration={
        'ChallengeRequiredOnNewDevice': True|False,
        'DeviceOnlyRememberedOnUserPrompt': True|False
    },
    EmailConfiguration={
        'SourceArn': 'string',
        'ReplyToEmailAddress': 'string'
    },
    SmsConfiguration={
        'SnsCallerArn': 'string',
        'ExternalId': 'string'
    },
    UserPoolTags={
        'string': 'string'
    },
    AdminCreateUserConfig={
        'AllowAdminCreateUserOnly': True|False,
        'UnusedAccountValidityDays': 123,
        'InviteMessageTemplate': {
            'SMSMessage': 'string',
            'EmailMessage': 'string',
            'EmailSubject': 'string'
        }
    }
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool you want to update.

  • Policies (dict) --

    A container with the policies you wish to update in a user pool.

    • PasswordPolicy (dict) --

      A container with information about the user pool password policy.

      • MinimumLength (integer) --

        The minimum length of the password policy that you have set. Cannot be less than 6.

      • RequireUppercase (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.

      • RequireLowercase (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.

      • RequireNumbers (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one number in their password.

      • RequireSymbols (boolean) --

        In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.

  • LambdaConfig (dict) --

    The AWS Lambda configuration information from the request to update the user pool.

    • PreSignUp (string) --

      A pre-registration AWS Lambda trigger.

    • CustomMessage (string) --

      A custom Message AWS Lambda trigger.

    • PostConfirmation (string) --

      A post-confirmation AWS Lambda trigger.

    • PreAuthentication (string) --

      A pre-authentication AWS Lambda trigger.

    • PostAuthentication (string) --

      A post-authentication AWS Lambda trigger.

    • DefineAuthChallenge (string) --

      Defines the authentication challenge.

    • CreateAuthChallenge (string) --

      Creates an authentication challenge.

    • VerifyAuthChallengeResponse (string) --

      Verifies the authentication challenge response.

  • AutoVerifiedAttributes (list) --

    The attributes that are automatically verified when the Amazon Cognito service makes a request to update user pools.

    • (string) --
  • SmsVerificationMessage (string) -- A container with information about the SMS verification message.
  • EmailVerificationMessage (string) -- The contents of the email verification message.
  • EmailVerificationSubject (string) -- The subject of the email verfication message.
  • SmsAuthenticationMessage (string) -- The contents of the SMS authentication message.
  • MfaConfiguration (string) --

    Can be one of the following values:

    • OFF - MFA tokens are not required and cannot be specified during user registration.
    • ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.
    • OPTIONAL - Users have the option when registering to create an MFA token.
  • DeviceConfiguration (dict) --

    Device configuration.

    • ChallengeRequiredOnNewDevice (boolean) --

      Indicates whether a challenge is required on a new device. Only applicable to a new device.

    • DeviceOnlyRememberedOnUserPrompt (boolean) --

      If true, a device is only remembered on user prompt.

  • EmailConfiguration (dict) --

    Email configuration.

    • SourceArn (string) --

      The Amazon Resource Name (ARN) of the email source.

    • ReplyToEmailAddress (string) --

      The REPLY-TO email address.

  • SmsConfiguration (dict) --

    SMS configuration.

    • SnsCallerArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

    • ExternalId (string) --

      The external ID.

  • UserPoolTags (dict) --

    The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

    • (string) --
      • (string) --
  • AdminCreateUserConfig (dict) --

    The configuration for AdminCreateUser requests.

    • AllowAdminCreateUserOnly (boolean) --

      Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

    • UnusedAccountValidityDays (integer) --

      The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

    • InviteMessageTemplate (dict) --

      The message template to be used for the welcome message to new users.

      • SMSMessage (string) --

        The message template for SMS messages.

      • EmailMessage (string) --

        The message template for email messages.

      • EmailSubject (string) --

        The subject line for email messages.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    Represents the response from the server when you make a request to update the user pool.

update_user_pool_client(**kwargs)

Allows the developer to update the specified user pool client and password policy.

See also: AWS API Documentation

Request Syntax

response = client.update_user_pool_client(
    UserPoolId='string',
    ClientId='string',
    ClientName='string',
    RefreshTokenValidity=123,
    ReadAttributes=[
        'string',
    ],
    WriteAttributes=[
        'string',
    ],
    ExplicitAuthFlows=[
        'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY',
    ]
)
Parameters
  • UserPoolId (string) --

    [REQUIRED]

    The user pool ID for the user pool where you want to update the user pool client.

  • ClientId (string) --

    [REQUIRED]

    The ID of the client associated with the user pool.

  • ClientName (string) -- The client name from the update user pool client request.
  • RefreshTokenValidity (integer) -- The validity of the refresh token, in days.
  • ReadAttributes (list) --

    The read-only attributes of the user pool.

    • (string) --
  • WriteAttributes (list) --

    The writeable attributes of the user pool.

    • (string) --
  • ExplicitAuthFlows (list) --

    Explicit authentication flows.

    • (string) --
Return type

dict

Returns

Response Syntax

{
    'UserPoolClient': {
        'UserPoolId': 'string',
        'ClientName': 'string',
        'ClientId': 'string',
        'ClientSecret': 'string',
        'LastModifiedDate': datetime(2015, 1, 1),
        'CreationDate': datetime(2015, 1, 1),
        'RefreshTokenValidity': 123,
        'ReadAttributes': [
            'string',
        ],
        'WriteAttributes': [
            'string',
        ],
        'ExplicitAuthFlows': [
            'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY',
        ]
    }
}

Response Structure

  • (dict) --

    Represents the response from the server to the request to update the user pool client.

    • UserPoolClient (dict) --

      The user pool client value from the response from the server when an update user pool client request is made.

      • UserPoolId (string) --

        The user pool ID for the user pool client.

      • ClientName (string) --

        The client name from the user pool request of the client type.

      • ClientId (string) --

        The ID of the client associated with the user pool.

      • ClientSecret (string) --

        The client secret from the user pool request of the client type.

      • LastModifiedDate (datetime) --

        The last modified date from the user pool request of the client type.

      • CreationDate (datetime) --

        The creation date from the user pool request of the client type.

      • RefreshTokenValidity (integer) --

        The validity of the refresh token, in days.

      • ReadAttributes (list) --

        The Read-only attributes.

        • (string) --
      • WriteAttributes (list) --

        The writeable attributes.

        • (string) --
      • ExplicitAuthFlows (list) --

        The explicit authentication flows.

        • (string) --

verify_user_attribute(**kwargs)

Verifies the specified user attributes in the user pool.

See also: AWS API Documentation

Request Syntax

response = client.verify_user_attribute(
    AccessToken='string',
    AttributeName='string',
    Code='string'
)
Parameters
  • AccessToken (string) -- Represents the access token of the request to verify user attributes.
  • AttributeName (string) --

    [REQUIRED]

    The attribute name in the request to verify user attributes.

  • Code (string) --

    [REQUIRED]

    The verification code in the request to verify user attributes.

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    A container representing the response from the server from the request to verify user attributes.