Amazon Cognito Identity Provider

2016/12/15 - Amazon Cognito Identity Provider - 9 new 3 updated api methods

AdminAddUserToGroup (new) Link ¶

Adds the specified user to the specified group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.admin_add_user_to_group(
    UserPoolId='string',
    Username='string',
    GroupName='string'
)
type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

type Username

string

param Username

[REQUIRED]

The username for the user.

type GroupName

string

param GroupName

[REQUIRED]

The group name.

returns

None

AdminRemoveUserFromGroup (new) Link ¶

Removes the specified user from the specified group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.admin_remove_user_from_group(
    UserPoolId='string',
    Username='string',
    GroupName='string'
)
type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

type Username

string

param Username

[REQUIRED]

The username for the user.

type GroupName

string

param GroupName

[REQUIRED]

The group name.

returns

None

ListGroups (new) Link ¶

Lists the groups associated with a user pool.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.list_groups(
    UserPoolId='string',
    Limit=123,
    NextToken='string'
)
type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

type Limit

integer

param Limit

The limit of the request to list groups.

type NextToken

string

param NextToken

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.

rtype

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.

GetGroup (new) Link ¶

Gets a group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.get_group(
    GroupName='string',
    UserPoolId='string'
)
type GroupName

string

param GroupName

[REQUIRED]

The name of the group.

type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

rtype

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.

DeleteGroup (new) Link ¶

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

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.delete_group(
    GroupName='string',
    UserPoolId='string'
)
type GroupName

string

param GroupName

[REQUIRED]

The name of the group.

type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

returns

None

AdminListGroupsForUser (new) Link ¶

Lists the groups that the user belongs to.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.admin_list_groups_for_user(
    Username='string',
    UserPoolId='string',
    Limit=123,
    NextToken='string'
)
type Username

string

param Username

[REQUIRED]

The username for the user.

type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

type Limit

integer

param Limit

The limit of the request to list groups.

type NextToken

string

param NextToken

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.

rtype

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.

ListUsersInGroup (new) Link ¶

Lists the users in the specified group.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.list_users_in_group(
    UserPoolId='string',
    GroupName='string',
    Limit=123,
    NextToken='string'
)
type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

type GroupName

string

param GroupName

[REQUIRED]

The name of the group.

type Limit

integer

param Limit

The limit of the request to list users.

type NextToken

string

param NextToken

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.

rtype

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.

UpdateGroup (new) Link ¶

Updates the specified group with the specified attributes.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.update_group(
    GroupName='string',
    UserPoolId='string',
    Description='string',
    RoleArn='string',
    Precedence=123
)
type GroupName

string

param GroupName

[REQUIRED]

The name of the group.

type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

type Description

string

param Description

A string containing the new description of the group.

type RoleArn

string

param RoleArn

The new role ARN for the group. This is used for setting the cognito:roles and cognito:preferred_role claims in the token.

type Precedence

integer

param Precedence

The new precedence value for the group. For more information about this parameter, see CreateGroupRequest.

rtype

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.

CreateGroup (new) Link ¶

Creates a new group in the specified user pool.

Requires developer credentials.

See also: AWS API Documentation

Request Syntax

client.create_group(
    GroupName='string',
    UserPoolId='string',
    Description='string',
    RoleArn='string',
    Precedence=123
)
type GroupName

string

param GroupName

[REQUIRED]

The name of the group. Must be unique.

type UserPoolId

string

param UserPoolId

[REQUIRED]

The user pool ID for the user pool.

type Description

string

param Description

A string containing the description of the group.

type RoleArn

string

param RoleArn

The role ARN for the group.

type Precedence

integer

param Precedence

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.

rtype

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.

CreateUserPool (updated) Link ¶
Changes (request, response)
Request
{'UserPoolTags': {'string': 'string'}}
Response
{'UserPool': {'UserPoolTags': {'string': 'string'}}}

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

See also: AWS API Documentation

Request Syntax

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'
            }
        },
    ]
)
type PoolName

string

param PoolName

[REQUIRED]

A string used to name the user pool.

type Policies

dict

param Policies

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.

type LambdaConfig

dict

param LambdaConfig

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.

type AutoVerifiedAttributes

list

param AutoVerifiedAttributes

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

  • (string) --

type AliasAttributes

list

param AliasAttributes

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

  • (string) --

type SmsVerificationMessage

string

param SmsVerificationMessage

A string representing the SMS verification message.

type EmailVerificationMessage

string

param EmailVerificationMessage

A string representing the email verification message.

type EmailVerificationSubject

string

param EmailVerificationSubject

A string representing the email verification subject.

type SmsAuthenticationMessage

string

param SmsAuthenticationMessage

A string representing the SMS authentication message.

type MfaConfiguration

string

param MfaConfiguration

Specifies MFA configuration details.

type DeviceConfiguration

dict

param DeviceConfiguration

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.

type EmailConfiguration

dict

param EmailConfiguration

The email configuration.

  • SourceArn (string) --

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

  • ReplyToEmailAddress (string) --

    The REPLY-TO email address.

type SmsConfiguration

dict

param SmsConfiguration

The SMS configuration.

  • SnsCallerArn (string) -- [REQUIRED]

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

  • ExternalId (string) --

    The external ID.

type UserPoolTags

dict

param UserPoolTags

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

  • (string) --

    • (string) --

type AdminCreateUserConfig

dict

param AdminCreateUserConfig

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.

type Schema

list

param Schema

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.

rtype

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.

DescribeUserPool (updated) Link ¶
Changes (response)
{'UserPool': {'UserPoolTags': {'string': 'string'}}}

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

See also: AWS API Documentation

Request Syntax

client.describe_user_pool(
    UserPoolId='string'
)
type UserPoolId

string

param UserPoolId

[REQUIRED]

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

rtype

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.

UpdateUserPool (updated) Link ¶
Changes (request)
{'UserPoolTags': {'string': 'string'}}

Updates the specified user pool with the specified attributes.

See also: AWS API Documentation

Request Syntax

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'
        }
    }
)
type UserPoolId

string

param UserPoolId

[REQUIRED]

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

type Policies

dict

param Policies

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.

type LambdaConfig

dict

param LambdaConfig

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.

type AutoVerifiedAttributes

list

param AutoVerifiedAttributes

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

  • (string) --

type SmsVerificationMessage

string

param SmsVerificationMessage

A container with information about the SMS verification message.

type EmailVerificationMessage

string

param EmailVerificationMessage

The contents of the email verification message.

type EmailVerificationSubject

string

param EmailVerificationSubject

The subject of the email verfication message.

type SmsAuthenticationMessage

string

param SmsAuthenticationMessage

The contents of the SMS authentication message.

type MfaConfiguration

string

param MfaConfiguration

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.

type DeviceConfiguration

dict

param DeviceConfiguration

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.

type EmailConfiguration

dict

param EmailConfiguration

Email configuration.

  • SourceArn (string) --

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

  • ReplyToEmailAddress (string) --

    The REPLY-TO email address.

type SmsConfiguration

dict

param SmsConfiguration

SMS configuration.

  • SnsCallerArn (string) -- [REQUIRED]

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

  • ExternalId (string) --

    The external ID.

type UserPoolTags

dict

param UserPoolTags

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

  • (string) --

    • (string) --

type AdminCreateUserConfig

dict

param AdminCreateUserConfig

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.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

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