Amazon Cognito Identity Provider

2026/11/13 - Amazon Cognito Identity Provider - 11 updated api methods

Changes  Adding support for dynamic client registration.

CreateResourceServer (updated) Link ¶
Changes (response)
{'ResourceServer': {'ManagedBy': 'COGNITO'}}

Creates a new OAuth2.0 resource server and defines custom scopes within it. Resource servers are associated with custom scopes and machine-to-machine (M2M) authorization. For more information, see Access control with resource servers.

See also: AWS API Documentation

Request Syntax

client.create_resource_server(
    UserPoolId='string',
    Identifier='string',
    Name='string',
    Scopes=[
        {
            'ScopeName': 'string',
            'ScopeDescription': 'string'
        },
    ]
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool where you want to create a resource server.

type Identifier:

string

param Identifier:

[REQUIRED]

A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

type Name:

string

param Name:

[REQUIRED]

A friendly name for the resource server.

type Scopes:

list

param Scopes:

A list of custom scopes. Each scope is a key-value map with the keys ScopeName and ScopeDescription. The name of a custom scope is a combination of ScopeName and the resource server Name in this request, for example MyResourceServerName/MyScopeName.

  • (dict) --

    One custom scope associated with a user pool resource server. This data type is a member of ResourceServerScopeType. For more information, see Scopes, M2M, and API authorization with resource servers.

    • ScopeName (string) -- [REQUIRED]

      The name of the scope. Amazon Cognito renders custom scopes in the format resourceServerIdentifier/ScopeName. For example, if this parameter is exampleScope in the resource server with the identifier exampleResourceServer, you request and receive the scope exampleResourceServer/exampleScope.

    • ScopeDescription (string) -- [REQUIRED]

      A friendly description of a custom scope.

rtype:

dict

returns:

Response Syntax

{
    'ResourceServer': {
        'UserPoolId': 'string',
        'Identifier': 'string',
        'Name': 'string',
        'Scopes': [
            {
                'ScopeName': 'string',
                'ScopeDescription': 'string'
            },
        ],
        'ManagedBy': 'COGNITO'
    }
}

Response Structure

  • (dict) --

    • ResourceServer (dict) --

      The details of the new resource server.

      • UserPoolId (string) --

        The ID of the user pool that contains the resource server configuration.

      • Identifier (string) --

        A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

        Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

      • Name (string) --

        The name of the resource server.

      • Scopes (list) --

        A list of scopes that are defined for the resource server.

        • (dict) --

          One custom scope associated with a user pool resource server. This data type is a member of ResourceServerScopeType. For more information, see Scopes, M2M, and API authorization with resource servers.

          • ScopeName (string) --

            The name of the scope. Amazon Cognito renders custom scopes in the format resourceServerIdentifier/ScopeName. For example, if this parameter is exampleScope in the resource server with the identifier exampleResourceServer, you request and receive the scope exampleResourceServer/exampleScope.

          • ScopeDescription (string) --

            A friendly description of a custom scope.

      • ManagedBy (string) --

        This value is reserved for resource servers that Amazon Cognito manages. Resource servers that you create don't have this value.

CreateUserPool (updated) Link ¶
Changes (request, response)
Request
{'DcrConfiguration': {'AllowedScopes': ['string'],
                      'AuthenticatedGrantTypes': ['code | implicit | '
                                                  'client_credentials'],
                      'EnableStatus': 'Enabled | Disabled',
                      'OpenDcrEnabled': 'boolean',
                      'OpenDcrGrantTypes': ['code | implicit | '
                                            'client_credentials']}}
Response
{'UserPool': {'DcrConfiguration': {'AllowedScopes': ['string'],
                                   'AuthenticatedGrantTypes': ['code | '
                                                               'implicit | '
                                                               'client_credentials'],
                                   'EnableStatus': 'Enabled | Disabled',
                                   'OpenDcrEnabled': 'boolean',
                                   'OpenDcrGrantTypes': ['code | implicit | '
                                                         'client_credentials']}}}

Creates a new Amazon Cognito user pool. This operation sets basic and advanced configuration options.

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,
            'PasswordHistorySize': 123,
            'TemporaryPasswordValidityDays': 123
        },
        'SignInPolicy': {
            'AllowedFirstAuthFactors': [
                'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN'|'SOFTWARE_TOKEN',
            ]
        }
    },
    DeletionProtection='ACTIVE'|'INACTIVE',
    LambdaConfig={
        'PreSignUp': 'string',
        'CustomMessage': 'string',
        'PostConfirmation': 'string',
        'PreAuthentication': 'string',
        'PostAuthentication': 'string',
        'DefineAuthChallenge': 'string',
        'CreateAuthChallenge': 'string',
        'VerifyAuthChallengeResponse': 'string',
        'PreTokenGeneration': 'string',
        'UserMigration': 'string',
        'PreTokenGenerationConfig': {
            'LambdaVersion': 'V1_0'|'V2_0'|'V3_0',
            'LambdaArn': 'string'
        },
        'CustomSMSSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'CustomEmailSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'KMSKeyID': 'string',
        'InboundFederation': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        }
    },
    AutoVerifiedAttributes=[
        'phone_number'|'email',
    ],
    AliasAttributes=[
        'phone_number'|'email'|'preferred_username',
    ],
    UsernameAttributes=[
        'phone_number'|'email',
    ],
    SmsVerificationMessage='string',
    EmailVerificationMessage='string',
    EmailVerificationSubject='string',
    VerificationMessageTemplate={
        'SmsMessage': 'string',
        'EmailMessage': 'string',
        'EmailSubject': 'string',
        'EmailMessageByLink': 'string',
        'EmailSubjectByLink': 'string',
        'DefaultEmailOption': 'CONFIRM_WITH_LINK'|'CONFIRM_WITH_CODE'
    },
    SmsAuthenticationMessage='string',
    MfaConfiguration='OFF'|'ON'|'OPTIONAL',
    UserAttributeUpdateSettings={
        'AttributesRequireVerificationBeforeUpdate': [
            'phone_number'|'email',
        ]
    },
    DeviceConfiguration={
        'ChallengeRequiredOnNewDevice': True|False,
        'DeviceOnlyRememberedOnUserPrompt': True|False
    },
    EmailConfiguration={
        'SourceArn': 'string',
        'ReplyToEmailAddress': 'string',
        'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER',
        'From': 'string',
        'ConfigurationSet': 'string'
    },
    SmsConfiguration={
        'SnsCallerArn': 'string',
        'ExternalId': 'string',
        'SnsRegion': 'string',
        'EumsSms': {
            'CallerArn': 'string',
            'ExternalId': 'string',
            'OriginationIdentity': 'string',
            'ConfigurationSetName': 'string',
            'InEntityId': 'string',
            'InTemplateId': 'string',
            'Region': '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'
            }
        },
    ],
    UserPoolAddOns={
        'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED',
        'AdvancedSecurityAdditionalFlows': {
            'CustomAuthMode': 'AUDIT'|'ENFORCED'
        }
    },
    DcrConfiguration={
        'EnableStatus': 'Enabled'|'Disabled',
        'OpenDcrEnabled': True|False,
        'AuthenticatedGrantTypes': [
            'code'|'implicit'|'client_credentials',
        ],
        'OpenDcrGrantTypes': [
            'code'|'implicit'|'client_credentials',
        ],
        'AllowedScopes': [
            'string',
        ]
    },
    UsernameConfiguration={
        'CaseSensitive': True|False
    },
    AccountRecoverySetting={
        'RecoveryMechanisms': [
            {
                'Priority': 123,
                'Name': 'verified_email'|'verified_phone_number'|'admin_only'
            },
        ]
    },
    UserPoolTier='LITE'|'ESSENTIALS'|'PLUS',
    KeyConfiguration={
        'KeyType': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KEY',
        'KmsKeyArn': 'string'
    },
    IssuerConfiguration={
        'Type': 'ORIGINAL'|'UPDATED'
    },
    AcrConfiguration={
        'string': {
            'AcrValue': 'string'
        }
    }
)
type PoolName:

string

param PoolName:

[REQUIRED]

A friendly name for your user pool.

type Policies:

dict

param Policies:

The password policy and sign-in policy in the user pool. The password policy sets options like password complexity requirements and password history. The sign-in policy sets the options available to applications in choice-based authentication.

  • PasswordPolicy (dict) --

    The password policy settings for a user pool, including complexity, history, and length requirements.

    • MinimumLength (integer) --

      The minimum length of the password in the policy that you have set. This value can't be less than 6.

    • RequireUppercase (boolean) --

      The requirement in a password policy that users must include at least one uppercase letter in their password.

    • RequireLowercase (boolean) --

      The requirement in a password policy that users must include at least one lowercase letter in their password.

    • RequireNumbers (boolean) --

      The requirement in a password policy that users must include at least one number in their password.

    • RequireSymbols (boolean) --

      The requirement in a password policy that users must include at least one symbol in their password.

    • PasswordHistorySize (integer) --

      The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of n previous passwords, where n is the value of PasswordHistorySize.

    • TemporaryPasswordValidityDays (integer) --

      The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to 7. If you submit a value of 0, Amazon Cognito treats it as a null value and sets TemporaryPasswordValidityDays to its default value.

  • SignInPolicy (dict) --

    The policy for allowed types of authentication in a user pool.

    • AllowedFirstAuthFactors (list) --

      The sign-in methods that a user pool supports as the first factor. You can permit users to start authentication with a standard username and password, or with other one-time password and hardware factors.

      • (string) --

type DeletionProtection:

string

param DeletionProtection:

When active, DeletionProtection prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.

When you try to delete a protected user pool in a DeleteUserPool API request, Amazon Cognito returns an InvalidParameterException error. To delete a protected user pool, send a new DeleteUserPool request after you deactivate deletion protection in an UpdateUserPool API request.

type LambdaConfig:

dict

param LambdaConfig:

A collection of user pool Lambda triggers. Amazon Cognito invokes triggers at several possible stages of authentication operations. Triggers can modify the outcome of the operations that invoked them.

  • PreSignUp (string) --

    The configuration of a pre sign-up Lambda trigger in a user pool. This trigger evaluates new users and can bypass confirmation, link a federated user profile, or block sign-up requests.

  • CustomMessage (string) --

    A custom message Lambda trigger. This trigger is an opportunity to customize all SMS and email messages from your user pool. When a custom message trigger is active, your user pool routes all messages to a Lambda function that returns a runtime-customized message subject and body for your user pool to deliver to a user.

  • PostConfirmation (string) --

    The configuration of a post confirmation Lambda trigger in a user pool. This trigger can take custom actions after a user confirms their user account and their email address or phone number.

  • PreAuthentication (string) --

    The configuration of a pre authentication trigger in a user pool. This trigger can evaluate and modify user sign-in events.

  • PostAuthentication (string) --

    The configuration of a post authentication Lambda trigger in a user pool. This trigger can take custom actions after a user signs in.

  • DefineAuthChallenge (string) --

    The configuration of a define auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

  • CreateAuthChallenge (string) --

    The configuration of a create auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

  • VerifyAuthChallengeResponse (string) --

    The configuration of a verify auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

  • PreTokenGeneration (string) --

    The legacy configuration of a pre token generation Lambda trigger in a user pool.

    Set this parameter for legacy purposes. If you also set an ARN in PreTokenGenerationConfig, its value must be identical to PreTokenGeneration. For new instances of pre token generation triggers, set the LambdaArn of PreTokenGenerationConfig.

  • UserMigration (string) --

    The configuration of a migrate user Lambda trigger in a user pool. This trigger can create user profiles when users sign in or attempt to reset their password with credentials that don't exist yet.

  • PreTokenGenerationConfig (dict) --

    The detailed configuration of a pre token generation Lambda trigger in a user pool. If you also set an ARN in PreTokenGeneration, its value must be identical to PreTokenGenerationConfig.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

      This parameter and the PreTokenGeneration property of LambdaConfig have the same value. For new instances of pre token generation triggers, set LambdaArn.

  • CustomSMSSender (dict) --

    The configuration of a custom SMS sender Lambda trigger. This trigger routes all SMS notifications from a user pool to a Lambda function that delivers the message using custom logic.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

      You must use a LambdaVersion of V1_0 with a custom sender function.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

  • CustomEmailSender (dict) --

    The configuration of a custom email sender Lambda trigger. This trigger routes all email notifications from a user pool to a Lambda function that delivers the message using custom logic.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

      You must use a LambdaVersion of V1_0 with a custom sender function.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

  • KMSKeyID (string) --

    The ARN of an KMS key. Amazon Cognito uses the key to encrypt codes and temporary passwords sent to custom sender Lambda triggers.

  • InboundFederation (dict) --

    The configuration of an inbound federation Lambda trigger. This trigger can transform federated user attributes during the authentication with external identity providers.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

      You must use a LambdaVersion of V1_0 with an inbound federation function.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

type AutoVerifiedAttributes:

list

param AutoVerifiedAttributes:

The attributes that you want your user pool to automatically verify. For more information, see Verifying contact information at sign-up.

  • (string) --

type AliasAttributes:

list

param AliasAttributes:

Attributes supported as an alias for this user pool. For more information about alias attributes, see Customizing sign-in attributes.

  • (string) --

type UsernameAttributes:

list

param UsernameAttributes:

Specifies whether a user can use an email address or phone number as a username when they sign up. For more information, see Customizing sign-in attributes.

  • (string) --

type SmsVerificationMessage:

string

param SmsVerificationMessage:

This parameter is no longer used.

type EmailVerificationMessage:

string

param EmailVerificationMessage:

This parameter is no longer used.

type EmailVerificationSubject:

string

param EmailVerificationSubject:

This parameter is no longer used.

type VerificationMessageTemplate:

dict

param VerificationMessageTemplate:

The template for the verification message that your user pool delivers to users who set an email address or phone number attribute.

Set the email message type that corresponds to your DefaultEmailOption selection. For CONFIRM_WITH_LINK, specify an EmailMessageByLink and leave EmailMessage blank. For CONFIRM_WITH_CODE, specify an EmailMessage and leave EmailMessageByLink blank. When you supply both parameters with either choice, Amazon Cognito returns an error.

  • SmsMessage (string) --

    The template for SMS messages that Amazon Cognito sends to your users.

  • EmailMessage (string) --

    The template for email messages that Amazon Cognito sends to your users. You can set an EmailMessage template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • EmailSubject (string) --

    The subject line for the email message template. You can set an EmailSubject template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • EmailMessageByLink (string) --

    The email message template for sending a confirmation link to the user. You can set an EmailMessageByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • EmailSubjectByLink (string) --

    The subject line for the email message template for sending a confirmation link to the user. You can set an EmailSubjectByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • DefaultEmailOption (string) --

    The configuration of verification emails to contain a clickable link or a verification code.

    For link, your template body must contain link text in the format {##Click here##}. "Click here" in the example is a customizable string. For code, your template body must contain a code placeholder in the format {####}.

type SmsAuthenticationMessage:

string

param SmsAuthenticationMessage:

The contents of the SMS message that your user pool sends to users in SMS OTP and MFA authentication.

type MfaConfiguration:

string

param MfaConfiguration:

Sets multi-factor authentication (MFA) to be on, off, or optional. When ON, all users must set up MFA before they can sign in. When OPTIONAL, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, choose OPTIONAL.

When MfaConfiguration is OPTIONAL, managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor.

The CreateUserPool operation supports only SMS MFA configuration. If you set MfaConfiguration to either of these values, include an SmsConfiguration in the same request:

  • ON – Requires MFA for all users

  • OPTIONAL – Makes MFA optional for each user

If you omit SmsConfiguration, the operation returns an InvalidParameterException. To configure TOTP or email MFA, use the SetUserPoolMfaConfig operation. You can also use SetUserPoolMfaConfig to add MFA factors later.

type UserAttributeUpdateSettings:

dict

param UserAttributeUpdateSettings:

The settings for updates to user attributes. These settings include the property AttributesRequireVerificationBeforeUpdate, a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers.

  • AttributesRequireVerificationBeforeUpdate (list) --

    Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value.

    When AttributesRequireVerificationBeforeUpdate is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where AttributesRequireVerificationBeforeUpdate is false, API operations that change attribute values can immediately update a user’s email or phone_number attribute.

    • (string) --

type DeviceConfiguration:

dict

param DeviceConfiguration:

The device-remembering configuration for a user pool. Device remembering or device tracking is a "Remember me on this device" option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool. A null value indicates that you have deactivated device remembering in your user pool.

  • ChallengeRequiredOnNewDevice (boolean) --

    When true, a remembered device can sign in with device authentication instead of SMS and time-based one-time password (TOTP) factors for multi-factor authentication (MFA).

  • DeviceOnlyRememberedOnUserPrompt (boolean) --

    When true, Amazon Cognito doesn't automatically remember a user's device when your app sends a ConfirmDevice API request. In your app, create a prompt for your user to choose whether they want to remember their device. Return the user's choice in an UpdateDeviceStatus API request.

    When DeviceOnlyRememberedOnUserPrompt is false, Amazon Cognito immediately remembers devices that you register in a ConfirmDevice API request.

type EmailConfiguration:

dict

param EmailConfiguration:

The email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Web Services Region, and sender for messages from your user pool.

  • SourceArn (string) --

    The ARN of a verified email address or an address from a verified domain in Amazon SES. You can set a SourceArn email from a verified domain only with an API request. You can set a verified email address, but not an address in a verified domain, in the Amazon Cognito console. Amazon Cognito uses the email address that you provide in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:

    • If you specify COGNITO_DEFAULT, Amazon Cognito uses this address as the custom FROM address when it emails your users using its built-in email account.

    • If you specify DEVELOPER, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.

    The Region value of the SourceArn parameter must indicate a supported Amazon Web Services Region of your user pool. Typically, the Region in the SourceArn and the user pool Region are the same. For more information, see Amazon SES email configuration regions in the Amazon Cognito Developer Guide.

  • ReplyToEmailAddress (string) --

    The destination to which the receiver of the email should reply.

  • EmailSendingAccount (string) --

    Specifies whether Amazon Cognito uses its built-in functionality to send your users email messages, or uses your Amazon Simple Email Service email configuration. Specify one of the following values:

    COGNITO_DEFAULT

    When Amazon Cognito emails your users, it uses its built-in email functionality. When you use the default option, Amazon Cognito allows only a limited number of emails each day for your user pool. For typical production environments, the default email limit is less than the required delivery volume. To achieve a higher delivery volume, specify DEVELOPER to use your Amazon SES email configuration.

    To look up the email delivery limit for the default option, see Limits in the Amazon Cognito Developer Guide.

    The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the Amazon Resource Name (ARN) of an Amazon SES verified email address for the SourceArn parameter.

    DEVELOPER

    When Amazon Cognito emails your users, it uses your Amazon SES configuration. Amazon Cognito calls Amazon SES on your behalf to send email from your verified email address. When you use this option, the email delivery limits are the same limits that apply to your Amazon SES verified email address in your Amazon Web Services account.

    If you use this option, provide the ARN of an Amazon SES verified email address for the SourceArn parameter.

    Before Amazon Cognito can email your users, it requires additional permissions to call Amazon SES on your behalf. When you update your user pool with this option, Amazon Cognito creates a service-linked role, which is a type of role in your Amazon Web Services account. This role contains the permissions that allow you to access Amazon SES and send email messages from your email address. For more information about the service-linked role that Amazon Cognito creates, see Using Service-Linked Roles for Amazon Cognito in the Amazon Cognito Developer Guide.

  • From (string) --

    Either the sender’s email address or the sender’s name with their email address. For example, testuser@example.com or Test User <testuser@example.com>. This address appears before the body of the email.

  • ConfigurationSet (string) --

    The set of configuration rules that can be applied to emails sent using Amazon Simple Email Service. A configuration set is applied to an email by including a reference to the configuration set in the headers of the email. Once applied, all of the rules in that configuration set are applied to the email. Configuration sets can be used to apply the following types of rules to emails:

    Event publishing

    Amazon Simple Email Service can track the number of send, delivery, open, click, bounce, and complaint events for each email sent. Use event publishing to send information about these events to other Amazon Web Services services such as and Amazon CloudWatch

    IP pool management

    When leasing dedicated IP addresses with Amazon Simple Email Service, you can create groups of IP addresses, called dedicated IP pools. You can then associate the dedicated IP pools with configuration sets.

type SmsConfiguration:

dict

param SmsConfiguration:

The settings for your Amazon Cognito user pool to send SMS messages with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account. For more information see SMS message settings.

  • SnsCallerArn (string) --

    The Amazon Resource Name (ARN) of the Amazon SNS caller. This is the ARN of the IAM role in your Amazon Web Services account that Amazon Cognito will use to send SMS messages. SMS messages are subject to a spending limit.

  • ExternalId (string) --

    The external ID provides additional security for your IAM role. You can use an ExternalId with the IAM role that you use with Amazon SNS to send SMS messages for your user pool. If you provide an ExternalId, your Amazon Cognito user pool includes it in the request to assume your IAM role. You can configure the role trust policy to require that Amazon Cognito, and any principal, provide the ExternalID. If you use the Amazon Cognito Management Console to create a role for SMS multi-factor authentication (MFA), Amazon Cognito creates a role with the required permissions and a trust policy that demonstrates use of the ExternalId.

    For more information about the ExternalId of a role, see How to use an external ID when granting access to your Amazon Web Services resources to a third party.

  • SnsRegion (string) --

    The Amazon Web Services Region to use with Amazon SNS integration. You can choose the same Region as your user pool, or a supported Legacy Amazon SNS alternate Region.

    Amazon Cognito resources in the Asia Pacific (Seoul) Amazon Web Services Region must use your Amazon SNS configuration in the Asia Pacific (Tokyo) Region. For more information, see SMS message settings for Amazon Cognito user pools.

  • EumsSms (dict) --

    The configuration for sending SMS messages through Amazon Web Services End User Messaging SMS, as an alternative to Amazon SNS. In a user pool, provide either the Amazon SNS configuration ( SnsCallerArn) or this configuration, but not both. In Amazon Web Services Regions where Amazon SNS is not available, this configuration is required.

    • CallerArn (string) -- [REQUIRED]

      The ARN of the IAM role that Amazon Cognito assumes to send SMS messages through Amazon Web Services End User Messaging SMS. The role must grant permission to call the sms-voice:SendTextMessage operation.

    • ExternalId (string) --

      The external ID that Amazon Cognito includes when it assumes the CallerArn role. Use this value as a condition in the role trust policy to prevent the confused deputy problem.

    • OriginationIdentity (string) --

      The origination identity that Amazon Web Services End User Messaging SMS uses to send messages to your users. This value can be one of the following:

      • A phone number – A long code, toll-free number, or short code that is assigned to your account.

      • A sender ID – An alphabetic name that identifies the message sender in supported countries.

      • A phone pool – A group of phone numbers that Amazon Web Services End User Messaging SMS selects from when it sends messages.

      You can provide an E.164 phone number or the ARN of the phone number, sender ID, or phone pool. Amazon Web Services End User Messaging SMS evaluates IAM authorization with the value that you provide. If the permissions policy of your CallerArn role scopes the sms-voice:SendTextMessage resource to a specific ARN, provide that same ARN. If the formats do not match, requests fail with an InvalidSmsRoleAccessPolicyException.

      Depending on the destination country, you must provide an origination identity. For country-specific requirements, see Supported countries and regions for SMS messaging in the Amazon Web Services End User Messaging SMS User Guide.

    • ConfigurationSetName (string) --

      The name of the Amazon Web Services End User Messaging SMS configuration set that Amazon Cognito applies to messages, for logging and event destinations. If you omit this member, Amazon Cognito sends messages without applying a configuration set.

    • InEntityId (string) --

      The principal entity ID required by India's Distributed Ledger Technology (DLT) regulations for SMS messages.

    • InTemplateId (string) --

      The registered template ID for the message template required by India's DLT regulations for SMS messages.

    • Region (string) --

      The Amazon Web Services Region of the Amazon Web Services End User Messaging SMS resources that Amazon Cognito uses to send messages. Amazon Web Services End User Messaging SMS must be available in your user pool's Region.

      If you omit this parameter, Amazon Cognito uses the same Region as your user pool. You can also set this parameter to your user pool's Region explicitly. Amazon Cognito rejects any other value with an InvalidParameterException.

type UserPoolTags:

dict

param UserPoolTags:

The tag keys and values to assign to the user pool. A tag is a label that you can use to categorize and manage user pools in different ways, such as by purpose, owner, environment, or other criteria.

  • (string) --

    • (string) --

type AdminCreateUserConfig:

dict

param AdminCreateUserConfig:

The configuration for administrative creation of users. Includes the template for the invitation message for new users, the duration of temporary passwords, and permitting self-service sign-up.

  • AllowAdminCreateUserOnly (boolean) --

    The setting for allowing self-service sign-up. When true, only administrators can create new user profiles. When false, users can register themselves and create a new user profile with the SignUp operation.

  • UnusedAccountValidityDays (integer) --

    This parameter is no longer in use.

    The password expiration limit in days for administrator-created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call AdminCreateUser again, specifying RESEND for the MessageAction parameter.

    The default value for this parameter is 7.

  • InviteMessageTemplate (dict) --

    The template for the welcome message to new users. This template must include the {####} temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder.

    See also Customizing User Invitation Messages.

    • SMSMessage (string) --

      The message template for SMS messages.

    • EmailMessage (string) --

      The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER.

    • EmailSubject (string) --

      The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER.

type Schema:

list

param Schema:

An array of attributes for the new user pool. You can add custom attributes and modify the properties of default attributes. The specifications in this parameter set the required attributes in your user pool. For more information, see Working with user attributes.

  • (dict) --

    A list of the user attributes and their properties in your user pool. The attribute schema contains standard attributes, custom attributes with a custom: prefix, and developer attributes with a dev: prefix. For more information, see User pool attributes.

    Developer-only dev: attributes are a legacy feature of user pools, and are read-only to all app clients. You can create and update developer-only attributes only with IAM-authenticated API operations. Use app client read/write permissions instead.

    • Name (string) --

      The name of your user pool attribute. When you create or update a user pool, adding a schema attribute creates a custom or developer-only attribute. When you add an attribute with a Name value of MyAttribute, Amazon Cognito creates the custom attribute custom:MyAttribute. When DeveloperOnlyAttribute is true, Amazon Cognito creates your attribute as dev:MyAttribute. In an operation that describes a user pool, Amazon Cognito returns this value as value for standard attributes, custom:value for custom attributes, and dev:value for developer-only attributes..

    • AttributeDataType (string) --

      The data format of the values for your attribute. When you choose an AttributeDataType, Amazon Cognito validates the input against the data type. A custom attribute value in your user's ID token is always a string, for example "custom:isMember" : "true" or "custom:YearsAsMember" : "12".

    • DeveloperOnlyAttribute (boolean) --

      Specifies whether the attribute type is developer only. This attribute can only be modified by an administrator. Users won't be able to modify this attribute using their access token. For example, DeveloperOnlyAttribute can be modified using AdminUpdateUserAttributes but can't be updated using UpdateUserAttributes.

    • Mutable (boolean) --

      Specifies whether the value of the attribute can be changed.

      Any user pool attribute whose value you map from an IdP attribute must be mutable, with a parameter value of true. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute. For more information, see Specifying Identity Provider Attribute Mappings for Your User Pool.

    • Required (boolean) --

      Specifies whether a user pool attribute is required. If the attribute is required and the user doesn't 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 length of a number attribute value. Must be a number less than or equal to 2^1023, represented as a string with a length of 131072 characters or fewer.

    • StringAttributeConstraints (dict) --

      Specifies the constraints for an attribute of the string type.

      • MinLength (string) --

        The minimum length of a string attribute value.

      • MaxLength (string) --

        The maximum length of a string attribute value. Must be a number less than or equal to 2^1023, represented as a string with a length of 131072 characters or fewer.

type UserPoolAddOns:

dict

param UserPoolAddOns:

Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to AUDIT. To configure automatic security responses to potentially unwanted traffic to your user pool, set to ENFORCED.

For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier.

  • AdvancedSecurityMode (string) -- [REQUIRED]

    The operating mode of threat protection for standard authentication types in your user pool, including username-password and secure remote password (SRP) authentication.

  • AdvancedSecurityAdditionalFlows (dict) --

    Threat protection configuration options for additional authentication types in your user pool, including custom authentication.

type DcrConfiguration:

dict

param DcrConfiguration:

The dynamic client registration configuration for the user pool. With dynamic client registration, applications can register their own app clients at runtime through the registration endpoint of your user pool domain. To activate this setting, your user pool must be in the Essentials tier or higher.

  • EnableStatus (string) --

    Specifies whether dynamic client registration is turned on for the user pool. If you provide a dynamic client registration configuration without this value, Amazon Cognito turns dynamic client registration on.

  • OpenDcrEnabled (boolean) --

    Specifies whether open registration is turned on. When open registration is on, applications can register app clients without an initial access token. The default value is false.

  • AuthenticatedGrantTypes (list) --

    The OAuth grant types that an app client created through authenticated registration can request. If you don't set this value, authenticated registration permits the code and client_credentials grant types. If you set an empty list, Amazon Cognito rejects authenticated registration requests. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

    code

    Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

    client_credentials

    Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

    • (string) --

  • OpenDcrGrantTypes (list) --

    The OAuth grant types that an app client created through open registration can request. If you don't set this value, open registration permits only the code grant type. If you set an empty list, Amazon Cognito rejects open registration requests. If you add client_credentials, anyone can register an app client that requests machine-to-machine (M2M) access tokens, and you pay for the M2M token requests that those app clients make. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

    code

    Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

    client_credentials

    Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

    • (string) --

  • AllowedScopes (list) --

    The scopes that an app client created through dynamic client registration can request, in addition to the standard OpenID Connect (OIDC) scopes. You can include custom scopes from your resource servers and aws.cognito.signin.user.admin. Registered app clients can request the OIDC scopes openid, email, phone, and profile without listing them here. If you don't set this value, registered app clients can request only the OIDC scopes. A registered app client can't request the aws.cognito/dcr/register scope, even if you include it in this list.

    • (string) --

type UsernameConfiguration:

dict

param UsernameConfiguration:

Sets the case sensitivity option for sign-in usernames. When CaseSensitive is false (case insensitive), users can sign in with any combination of capital and lowercase letters. For example, username, USERNAME, or UserName, or for email, email@example.com or EMaiL@eXamplE.Com. For most use cases, set case sensitivity to false as a best practice. When usernames and email addresses are case insensitive, Amazon Cognito treats any variation in case as the same user, and prevents a case variation from being assigned to the same attribute for a different user.

When CaseSensitive is true (case sensitive), Amazon Cognito interprets USERNAME and UserName as distinct users.

This configuration is immutable after you set it.

  • CaseSensitive (boolean) -- [REQUIRED]

    Specifies whether user name case sensitivity will be applied for all users in the user pool through Amazon Cognito APIs. For most use cases, set case sensitivity to False (case insensitive) as a best practice. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name.

    Valid values include:

    true

    Enables case sensitivity for all username input. When this option is set to true, users must sign in using the exact capitalization of their given username, such as “UserName”. This is the default value.

    false

    Enables case insensitivity for all username input. For example, when this option is set to false, users can sign in using username, USERNAME, or UserName. This option also enables both preferred_username and email alias to be case insensitive, in addition to the username attribute.

type AccountRecoverySetting:

dict

param AccountRecoverySetting:

The available verified method a user can use to recover their password when they call ForgotPassword. You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. Email MFA is also disqualifying for account recovery with email. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred over email.

As a best practice, configure both verified_email and verified_phone_number, with one having a higher priority than the other.

  • RecoveryMechanisms (list) --

    The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators.

    • (dict) --

      A recovery option for a user. The AccountRecoverySettingType data type is an array of this object. Each RecoveryOptionType has a priority property that determines whether it is a primary or secondary option.

      For example, if verified_email has a priority of 1 and verified_phone_number has a priority of 2, your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The admin_only option prevents self-service account recovery.

      • Priority (integer) -- [REQUIRED]

        Your priority preference for using the specified attribute in account recovery. The highest priority is 1.

      • Name (string) -- [REQUIRED]

        The recovery method that this object sets a recovery option for.

type UserPoolTier:

string

param UserPoolTier:

The user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to ESSENTIALS.

type KeyConfiguration:

dict

param KeyConfiguration:

The key configuration for the user pool. Specifies the key type and KMS key ARN for encryption.

  • KeyType (string) --

    The type of encryption key used for the user pool.

    AWS_OWNED_KEY

    A key owned by Amazon Web Services in Key Management Service.

    CUSTOMER_MANAGED_KEY

    A key managed by the customer in Key Management Service. You must use a multi-region key to enable multi-region replication for a user pool.

  • KmsKeyArn (string) --

    The Amazon Resource Name (ARN) of the KMS key used for encryption. If not specified, Amazon Web Services managed keys are used.

type IssuerConfiguration:

dict

param IssuerConfiguration:

The issuer configuration for the user pool. Specifies the issuer type for token generation.

  • Type (string) --

    The type of issuer configuration. Determines the token issuing behavior for the user pool.

    ORIGINAL

    The original issuer configuration for user pools. The issuer URL is hosted in the user pool’s region and provides OIDC endpoints specific to that region.

    Original issuers have the format of https://cognito-idp.[region].amazonaws.com/[userPoolId]

    UPDATED

    Recommended for all user pools, including for multi-Region replication. Updated issuers host the same JWKS content in multiple regions, resulting in improved resilience and efficiency.

    Updated issuers have the format of https://issuer-cognito-idp.[region].amazonaws.com/[userPoolId], where region is the primary Amazon Web Services Region of your user pool.

type AcrConfiguration:

dict

param AcrConfiguration:

The custom names for the authentication context class reference (ACR) levels in your user pool. Amazon Cognito defines four fixed ACR levels that represent increasing authentication assurance. The combination of authentication factors that satisfies each level is fixed and you can't change it. With this configuration, you customize only the URI name that Amazon Cognito reports for each level in the acr token claim.

You can override a subset of the levels. By default, the levels are named urn:cognito:loa:1 through urn:cognito:loa:4, and Amazon Cognito applies the default name to any level that you don't specify. Each name must be unique across all four levels, including any default names that apply to levels you don't override. A name can contain any character that is valid in a URL or a URN.

Configuring custom ACR level names requires the Essentials or Plus feature plan. To activate this setting, your user pool must be in the Essentials tier or higher.

  • (string) --

    • (dict) --

      The configuration for a single authentication context class reference (ACR) level in a user pool. Each entry in an AcrConfiguration map associates a level ( Level1 through Level4) with this configuration, which provides the custom name that Amazon Cognito reports for that level in the acr token claim.

      • AcrValue (string) -- [REQUIRED]

        The custom name for this authentication context class reference (ACR) level. This value is the URI that Amazon Cognito reports in the acr token claim when a user meets this level. The name must be unique across all levels in the user pool, including default names.

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,
                'PasswordHistorySize': 123,
                'TemporaryPasswordValidityDays': 123
            },
            'SignInPolicy': {
                'AllowedFirstAuthFactors': [
                    'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN'|'SOFTWARE_TOKEN',
                ]
            }
        },
        'DeletionProtection': 'ACTIVE'|'INACTIVE',
        'LambdaConfig': {
            'PreSignUp': 'string',
            'CustomMessage': 'string',
            'PostConfirmation': 'string',
            'PreAuthentication': 'string',
            'PostAuthentication': 'string',
            'DefineAuthChallenge': 'string',
            'CreateAuthChallenge': 'string',
            'VerifyAuthChallengeResponse': 'string',
            'PreTokenGeneration': 'string',
            'UserMigration': 'string',
            'PreTokenGenerationConfig': {
                'LambdaVersion': 'V1_0'|'V2_0'|'V3_0',
                'LambdaArn': 'string'
            },
            'CustomSMSSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'CustomEmailSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'KMSKeyID': 'string',
            'InboundFederation': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': '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',
        ],
        'UsernameAttributes': [
            'phone_number'|'email',
        ],
        'SmsVerificationMessage': 'string',
        'EmailVerificationMessage': 'string',
        'EmailVerificationSubject': 'string',
        'VerificationMessageTemplate': {
            'SmsMessage': 'string',
            'EmailMessage': 'string',
            'EmailSubject': 'string',
            'EmailMessageByLink': 'string',
            'EmailSubjectByLink': 'string',
            'DefaultEmailOption': 'CONFIRM_WITH_LINK'|'CONFIRM_WITH_CODE'
        },
        'SmsAuthenticationMessage': 'string',
        'UserAttributeUpdateSettings': {
            'AttributesRequireVerificationBeforeUpdate': [
                'phone_number'|'email',
            ]
        },
        'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
        'DeviceConfiguration': {
            'ChallengeRequiredOnNewDevice': True|False,
            'DeviceOnlyRememberedOnUserPrompt': True|False
        },
        'EstimatedNumberOfUsers': 123,
        'EmailConfiguration': {
            'SourceArn': 'string',
            'ReplyToEmailAddress': 'string',
            'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER',
            'From': 'string',
            'ConfigurationSet': 'string'
        },
        'SmsConfiguration': {
            'SnsCallerArn': 'string',
            'ExternalId': 'string',
            'SnsRegion': 'string',
            'EumsSms': {
                'CallerArn': 'string',
                'ExternalId': 'string',
                'OriginationIdentity': 'string',
                'ConfigurationSetName': 'string',
                'InEntityId': 'string',
                'InTemplateId': 'string',
                'Region': 'string'
            }
        },
        'UserPoolTags': {
            'string': 'string'
        },
        'SmsConfigurationFailure': 'string',
        'EmailConfigurationFailure': 'string',
        'Domain': 'string',
        'CustomDomain': 'string',
        'AdminCreateUserConfig': {
            'AllowAdminCreateUserOnly': True|False,
            'UnusedAccountValidityDays': 123,
            'InviteMessageTemplate': {
                'SMSMessage': 'string',
                'EmailMessage': 'string',
                'EmailSubject': 'string'
            }
        },
        'UserPoolAddOns': {
            'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED',
            'AdvancedSecurityAdditionalFlows': {
                'CustomAuthMode': 'AUDIT'|'ENFORCED'
            }
        },
        'DcrConfiguration': {
            'EnableStatus': 'Enabled'|'Disabled',
            'OpenDcrEnabled': True|False,
            'AuthenticatedGrantTypes': [
                'code'|'implicit'|'client_credentials',
            ],
            'OpenDcrGrantTypes': [
                'code'|'implicit'|'client_credentials',
            ],
            'AllowedScopes': [
                'string',
            ]
        },
        'UsernameConfiguration': {
            'CaseSensitive': True|False
        },
        'Arn': 'string',
        'AccountRecoverySetting': {
            'RecoveryMechanisms': [
                {
                    'Priority': 123,
                    'Name': 'verified_email'|'verified_phone_number'|'admin_only'
                },
            ]
        },
        'UserPoolTier': 'LITE'|'ESSENTIALS'|'PLUS',
        'KeyConfiguration': {
            'KeyType': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KEY',
            'KmsKeyArn': 'string'
        },
        'IssuerConfiguration': {
            'Type': 'ORIGINAL'|'UPDATED'
        },
        'AcrConfiguration': {
            'string': {
                'AcrValue': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

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

    • UserPool (dict) --

      The details of the created user pool.

      • Id (string) --

        The ID of the user pool.

      • Name (string) --

        The name of the user pool.

      • Policies (dict) --

        A list of user pool policies. Contains the policy that sets password-complexity requirements.

        • PasswordPolicy (dict) --

          The password policy settings for a user pool, including complexity, history, and length requirements.

          • MinimumLength (integer) --

            The minimum length of the password in the policy that you have set. This value can't be less than 6.

          • RequireUppercase (boolean) --

            The requirement in a password policy that users must include at least one uppercase letter in their password.

          • RequireLowercase (boolean) --

            The requirement in a password policy that users must include at least one lowercase letter in their password.

          • RequireNumbers (boolean) --

            The requirement in a password policy that users must include at least one number in their password.

          • RequireSymbols (boolean) --

            The requirement in a password policy that users must include at least one symbol in their password.

          • PasswordHistorySize (integer) --

            The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of n previous passwords, where n is the value of PasswordHistorySize.

          • TemporaryPasswordValidityDays (integer) --

            The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to 7. If you submit a value of 0, Amazon Cognito treats it as a null value and sets TemporaryPasswordValidityDays to its default value.

        • SignInPolicy (dict) --

          The policy for allowed types of authentication in a user pool.

          • AllowedFirstAuthFactors (list) --

            The sign-in methods that a user pool supports as the first factor. You can permit users to start authentication with a standard username and password, or with other one-time password and hardware factors.

            • (string) --

      • DeletionProtection (string) --

        When active, DeletionProtection prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.

        When you try to delete a protected user pool in a DeleteUserPool API request, Amazon Cognito returns an InvalidParameterException error. To delete a protected user pool, send a new DeleteUserPool request after you deactivate deletion protection in an UpdateUserPool API request.

      • LambdaConfig (dict) --

        A collection of user pool Lambda triggers. Amazon Cognito invokes triggers at several possible stages of user pool operations. Triggers can modify the outcome of the operations that invoked them.

        • PreSignUp (string) --

          The configuration of a pre sign-up Lambda trigger in a user pool. This trigger evaluates new users and can bypass confirmation, link a federated user profile, or block sign-up requests.

        • CustomMessage (string) --

          A custom message Lambda trigger. This trigger is an opportunity to customize all SMS and email messages from your user pool. When a custom message trigger is active, your user pool routes all messages to a Lambda function that returns a runtime-customized message subject and body for your user pool to deliver to a user.

        • PostConfirmation (string) --

          The configuration of a post confirmation Lambda trigger in a user pool. This trigger can take custom actions after a user confirms their user account and their email address or phone number.

        • PreAuthentication (string) --

          The configuration of a pre authentication trigger in a user pool. This trigger can evaluate and modify user sign-in events.

        • PostAuthentication (string) --

          The configuration of a post authentication Lambda trigger in a user pool. This trigger can take custom actions after a user signs in.

        • DefineAuthChallenge (string) --

          The configuration of a define auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

        • CreateAuthChallenge (string) --

          The configuration of a create auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

        • VerifyAuthChallengeResponse (string) --

          The configuration of a verify auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

        • PreTokenGeneration (string) --

          The legacy configuration of a pre token generation Lambda trigger in a user pool.

          Set this parameter for legacy purposes. If you also set an ARN in PreTokenGenerationConfig, its value must be identical to PreTokenGeneration. For new instances of pre token generation triggers, set the LambdaArn of PreTokenGenerationConfig.

        • UserMigration (string) --

          The configuration of a migrate user Lambda trigger in a user pool. This trigger can create user profiles when users sign in or attempt to reset their password with credentials that don't exist yet.

        • PreTokenGenerationConfig (dict) --

          The detailed configuration of a pre token generation Lambda trigger in a user pool. If you also set an ARN in PreTokenGeneration, its value must be identical to PreTokenGenerationConfig.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

            This parameter and the PreTokenGeneration property of LambdaConfig have the same value. For new instances of pre token generation triggers, set LambdaArn.

        • CustomSMSSender (dict) --

          The configuration of a custom SMS sender Lambda trigger. This trigger routes all SMS notifications from a user pool to a Lambda function that delivers the message using custom logic.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

            You must use a LambdaVersion of V1_0 with a custom sender function.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

        • CustomEmailSender (dict) --

          The configuration of a custom email sender Lambda trigger. This trigger routes all email notifications from a user pool to a Lambda function that delivers the message using custom logic.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

            You must use a LambdaVersion of V1_0 with a custom sender function.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

        • KMSKeyID (string) --

          The ARN of an KMS key. Amazon Cognito uses the key to encrypt codes and temporary passwords sent to custom sender Lambda triggers.

        • InboundFederation (dict) --

          The configuration of an inbound federation Lambda trigger. This trigger can transform federated user attributes during the authentication with external identity providers.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

            You must use a LambdaVersion of V1_0 with an inbound federation function.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

      • Status (string) --

        This parameter is no longer used.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • SchemaAttributes (list) --

        A list of the user attributes and their properties in your user pool. The attribute schema contains standard attributes, custom attributes with a custom: prefix, and developer attributes with a dev: prefix. For more information, see User pool attributes.

        Developer-only attributes are a legacy feature of user pools, and are read-only to all app clients. You can create and update developer-only attributes only with IAM-authenticated API operations. Use app client read/write permissions instead.

        • (dict) --

          A list of the user attributes and their properties in your user pool. The attribute schema contains standard attributes, custom attributes with a custom: prefix, and developer attributes with a dev: prefix. For more information, see User pool attributes.

          Developer-only dev: attributes are a legacy feature of user pools, and are read-only to all app clients. You can create and update developer-only attributes only with IAM-authenticated API operations. Use app client read/write permissions instead.

          • Name (string) --

            The name of your user pool attribute. When you create or update a user pool, adding a schema attribute creates a custom or developer-only attribute. When you add an attribute with a Name value of MyAttribute, Amazon Cognito creates the custom attribute custom:MyAttribute. When DeveloperOnlyAttribute is true, Amazon Cognito creates your attribute as dev:MyAttribute. In an operation that describes a user pool, Amazon Cognito returns this value as value for standard attributes, custom:value for custom attributes, and dev:value for developer-only attributes..

          • AttributeDataType (string) --

            The data format of the values for your attribute. When you choose an AttributeDataType, Amazon Cognito validates the input against the data type. A custom attribute value in your user's ID token is always a string, for example "custom:isMember" : "true" or "custom:YearsAsMember" : "12".

          • DeveloperOnlyAttribute (boolean) --

            Specifies whether the attribute type is developer only. This attribute can only be modified by an administrator. Users won't be able to modify this attribute using their access token. For example, DeveloperOnlyAttribute can be modified using AdminUpdateUserAttributes but can't be updated using UpdateUserAttributes.

          • Mutable (boolean) --

            Specifies whether the value of the attribute can be changed.

            Any user pool attribute whose value you map from an IdP attribute must be mutable, with a parameter value of true. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute. For more information, see Specifying Identity Provider Attribute Mappings for Your User Pool.

          • Required (boolean) --

            Specifies whether a user pool attribute is required. If the attribute is required and the user doesn't 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 length of a number attribute value. Must be a number less than or equal to 2^1023, represented as a string with a length of 131072 characters or fewer.

          • StringAttributeConstraints (dict) --

            Specifies the constraints for an attribute of the string type.

            • MinLength (string) --

              The minimum length of a string attribute value.

            • MaxLength (string) --

              The maximum length of a string attribute value. Must be a number less than or equal to 2^1023, represented as a string with a length of 131072 characters or fewer.

      • AutoVerifiedAttributes (list) --

        The attributes that are auto-verified in a user pool.

        • (string) --

      • AliasAttributes (list) --

        Attributes supported as an alias for this user pool. An alias is an attribute that users can enter as an alternative username. Possible values: phone_number, email, or preferred_username.

        • (string) --

      • UsernameAttributes (list) --

        Specifies whether a user can use an email address or phone number as a username when they sign up.

        • (string) --

      • SmsVerificationMessage (string) --

        This parameter is no longer used.

      • EmailVerificationMessage (string) --

        This parameter is no longer used.

      • EmailVerificationSubject (string) --

        This parameter is no longer used.

      • VerificationMessageTemplate (dict) --

        The template for the verification message that your user pool delivers to users who set an email address or phone number attribute.

        • SmsMessage (string) --

          The template for SMS messages that Amazon Cognito sends to your users.

        • EmailMessage (string) --

          The template for email messages that Amazon Cognito sends to your users. You can set an EmailMessage template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • EmailSubject (string) --

          The subject line for the email message template. You can set an EmailSubject template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • EmailMessageByLink (string) --

          The email message template for sending a confirmation link to the user. You can set an EmailMessageByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • EmailSubjectByLink (string) --

          The subject line for the email message template for sending a confirmation link to the user. You can set an EmailSubjectByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • DefaultEmailOption (string) --

          The configuration of verification emails to contain a clickable link or a verification code.

          For link, your template body must contain link text in the format {##Click here##}. "Click here" in the example is a customizable string. For code, your template body must contain a code placeholder in the format {####}.

      • SmsAuthenticationMessage (string) --

        The contents of the SMS authentication message.

      • UserAttributeUpdateSettings (dict) --

        The settings for updates to user attributes. These settings include the property AttributesRequireVerificationBeforeUpdate, a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers.

        • AttributesRequireVerificationBeforeUpdate (list) --

          Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value.

          When AttributesRequireVerificationBeforeUpdate is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where AttributesRequireVerificationBeforeUpdate is false, API operations that change attribute values can immediately update a user’s email or phone_number attribute.

          • (string) --

      • MfaConfiguration (string) --

        Can be one of the following values:

        • OFF - MFA tokens aren't required and can't be specified during user registration.

        • ON - MFA tokens are required for all user registrations. You can only specify required when you're initially creating a user pool.

        • OPTIONAL - Users have the option when registering to create an MFA token.

      • DeviceConfiguration (dict) --

        The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool.

        • ChallengeRequiredOnNewDevice (boolean) --

          When true, a remembered device can sign in with device authentication instead of SMS and time-based one-time password (TOTP) factors for multi-factor authentication (MFA).

        • DeviceOnlyRememberedOnUserPrompt (boolean) --

          When true, Amazon Cognito doesn't automatically remember a user's device when your app sends a ConfirmDevice API request. In your app, create a prompt for your user to choose whether they want to remember their device. Return the user's choice in an UpdateDeviceStatus API request.

          When DeviceOnlyRememberedOnUserPrompt is false, Amazon Cognito immediately remembers devices that you register in a ConfirmDevice API request.

      • EstimatedNumberOfUsers (integer) --

        A number estimating the size of the user pool.

      • EmailConfiguration (dict) --

        The email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Web Services Region, and sender for messages from your user pool.

        • SourceArn (string) --

          The ARN of a verified email address or an address from a verified domain in Amazon SES. You can set a SourceArn email from a verified domain only with an API request. You can set a verified email address, but not an address in a verified domain, in the Amazon Cognito console. Amazon Cognito uses the email address that you provide in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:

          • If you specify COGNITO_DEFAULT, Amazon Cognito uses this address as the custom FROM address when it emails your users using its built-in email account.

          • If you specify DEVELOPER, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.

          The Region value of the SourceArn parameter must indicate a supported Amazon Web Services Region of your user pool. Typically, the Region in the SourceArn and the user pool Region are the same. For more information, see Amazon SES email configuration regions in the Amazon Cognito Developer Guide.

        • ReplyToEmailAddress (string) --

          The destination to which the receiver of the email should reply.

        • EmailSendingAccount (string) --

          Specifies whether Amazon Cognito uses its built-in functionality to send your users email messages, or uses your Amazon Simple Email Service email configuration. Specify one of the following values:

          COGNITO_DEFAULT

          When Amazon Cognito emails your users, it uses its built-in email functionality. When you use the default option, Amazon Cognito allows only a limited number of emails each day for your user pool. For typical production environments, the default email limit is less than the required delivery volume. To achieve a higher delivery volume, specify DEVELOPER to use your Amazon SES email configuration.

          To look up the email delivery limit for the default option, see Limits in the Amazon Cognito Developer Guide.

          The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the Amazon Resource Name (ARN) of an Amazon SES verified email address for the SourceArn parameter.

          DEVELOPER

          When Amazon Cognito emails your users, it uses your Amazon SES configuration. Amazon Cognito calls Amazon SES on your behalf to send email from your verified email address. When you use this option, the email delivery limits are the same limits that apply to your Amazon SES verified email address in your Amazon Web Services account.

          If you use this option, provide the ARN of an Amazon SES verified email address for the SourceArn parameter.

          Before Amazon Cognito can email your users, it requires additional permissions to call Amazon SES on your behalf. When you update your user pool with this option, Amazon Cognito creates a service-linked role, which is a type of role in your Amazon Web Services account. This role contains the permissions that allow you to access Amazon SES and send email messages from your email address. For more information about the service-linked role that Amazon Cognito creates, see Using Service-Linked Roles for Amazon Cognito in the Amazon Cognito Developer Guide.

        • From (string) --

          Either the sender’s email address or the sender’s name with their email address. For example, testuser@example.com or Test User <testuser@example.com>. This address appears before the body of the email.

        • ConfigurationSet (string) --

          The set of configuration rules that can be applied to emails sent using Amazon Simple Email Service. A configuration set is applied to an email by including a reference to the configuration set in the headers of the email. Once applied, all of the rules in that configuration set are applied to the email. Configuration sets can be used to apply the following types of rules to emails:

          Event publishing

          Amazon Simple Email Service can track the number of send, delivery, open, click, bounce, and complaint events for each email sent. Use event publishing to send information about these events to other Amazon Web Services services such as and Amazon CloudWatch

          IP pool management

          When leasing dedicated IP addresses with Amazon Simple Email Service, you can create groups of IP addresses, called dedicated IP pools. You can then associate the dedicated IP pools with configuration sets.

      • SmsConfiguration (dict) --

        User pool configuration for delivery of SMS messages with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account.

        • SnsCallerArn (string) --

          The Amazon Resource Name (ARN) of the Amazon SNS caller. This is the ARN of the IAM role in your Amazon Web Services account that Amazon Cognito will use to send SMS messages. SMS messages are subject to a spending limit.

        • ExternalId (string) --

          The external ID provides additional security for your IAM role. You can use an ExternalId with the IAM role that you use with Amazon SNS to send SMS messages for your user pool. If you provide an ExternalId, your Amazon Cognito user pool includes it in the request to assume your IAM role. You can configure the role trust policy to require that Amazon Cognito, and any principal, provide the ExternalID. If you use the Amazon Cognito Management Console to create a role for SMS multi-factor authentication (MFA), Amazon Cognito creates a role with the required permissions and a trust policy that demonstrates use of the ExternalId.

          For more information about the ExternalId of a role, see How to use an external ID when granting access to your Amazon Web Services resources to a third party.

        • SnsRegion (string) --

          The Amazon Web Services Region to use with Amazon SNS integration. You can choose the same Region as your user pool, or a supported Legacy Amazon SNS alternate Region.

          Amazon Cognito resources in the Asia Pacific (Seoul) Amazon Web Services Region must use your Amazon SNS configuration in the Asia Pacific (Tokyo) Region. For more information, see SMS message settings for Amazon Cognito user pools.

        • EumsSms (dict) --

          The configuration for sending SMS messages through Amazon Web Services End User Messaging SMS, as an alternative to Amazon SNS. In a user pool, provide either the Amazon SNS configuration ( SnsCallerArn) or this configuration, but not both. In Amazon Web Services Regions where Amazon SNS is not available, this configuration is required.

          • CallerArn (string) --

            The ARN of the IAM role that Amazon Cognito assumes to send SMS messages through Amazon Web Services End User Messaging SMS. The role must grant permission to call the sms-voice:SendTextMessage operation.

          • ExternalId (string) --

            The external ID that Amazon Cognito includes when it assumes the CallerArn role. Use this value as a condition in the role trust policy to prevent the confused deputy problem.

          • OriginationIdentity (string) --

            The origination identity that Amazon Web Services End User Messaging SMS uses to send messages to your users. This value can be one of the following:

            • A phone number – A long code, toll-free number, or short code that is assigned to your account.

            • A sender ID – An alphabetic name that identifies the message sender in supported countries.

            • A phone pool – A group of phone numbers that Amazon Web Services End User Messaging SMS selects from when it sends messages.

            You can provide an E.164 phone number or the ARN of the phone number, sender ID, or phone pool. Amazon Web Services End User Messaging SMS evaluates IAM authorization with the value that you provide. If the permissions policy of your CallerArn role scopes the sms-voice:SendTextMessage resource to a specific ARN, provide that same ARN. If the formats do not match, requests fail with an InvalidSmsRoleAccessPolicyException.

            Depending on the destination country, you must provide an origination identity. For country-specific requirements, see Supported countries and regions for SMS messaging in the Amazon Web Services End User Messaging SMS User Guide.

          • ConfigurationSetName (string) --

            The name of the Amazon Web Services End User Messaging SMS configuration set that Amazon Cognito applies to messages, for logging and event destinations. If you omit this member, Amazon Cognito sends messages without applying a configuration set.

          • InEntityId (string) --

            The principal entity ID required by India's Distributed Ledger Technology (DLT) regulations for SMS messages.

          • InTemplateId (string) --

            The registered template ID for the message template required by India's DLT regulations for SMS messages.

          • Region (string) --

            The Amazon Web Services Region of the Amazon Web Services End User Messaging SMS resources that Amazon Cognito uses to send messages. Amazon Web Services End User Messaging SMS must be available in your user pool's Region.

            If you omit this parameter, Amazon Cognito uses the same Region as your user pool. You can also set this parameter to your user pool's Region explicitly. Amazon Cognito rejects any other value with an InvalidParameterException.

      • UserPoolTags (dict) --

        The tags that are assigned to the user pool. A tag is a label that you can apply to user pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

        • (string) --

          • (string) --

      • SmsConfigurationFailure (string) --

        The reason why the SMS configuration can't send the messages to your users.

        This message might include comma-separated values to describe why your SMS configuration can't send messages to user pool end users.

        InvalidSmsRoleAccessPolicyException

        The Identity and Access Management role that Amazon Cognito uses to send SMS messages isn't properly configured. For more information, see SmsConfigurationType.

        SNSSandbox

        The Amazon Web Services account is in the SNS SMS Sandbox and messages will only reach verified end users. This parameter won’t get populated with SNSSandbox if the user creating the user pool doesn’t have SNS permissions. To learn how to move your Amazon Web Services account out of the sandbox, see Moving out of the SMS sandbox.

      • EmailConfigurationFailure (string) --

        Deprecated. Review error codes from API requests with EventSource:cognito-idp.amazonaws.com in CloudTrail for information about problems with user pool email configuration.

      • Domain (string) --

        The domain prefix, if the user pool has a domain associated with it.

      • CustomDomain (string) --

        A custom domain name that you provide to Amazon Cognito. This parameter applies only if you use a custom domain to host the sign-up and sign-in pages for your application. An example of a custom domain name might be auth.example.com.

        For more information about adding a custom domain to your user pool, see Using Your Own Domain for the Hosted UI.

      • AdminCreateUserConfig (dict) --

        The configuration for AdminCreateUser requests.

        • AllowAdminCreateUserOnly (boolean) --

          The setting for allowing self-service sign-up. When true, only administrators can create new user profiles. When false, users can register themselves and create a new user profile with the SignUp operation.

        • UnusedAccountValidityDays (integer) --

          This parameter is no longer in use.

          The password expiration limit in days for administrator-created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call AdminCreateUser again, specifying RESEND for the MessageAction parameter.

          The default value for this parameter is 7.

        • InviteMessageTemplate (dict) --

          The template for the welcome message to new users. This template must include the {####} temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder.

          See also Customizing User Invitation Messages.

          • SMSMessage (string) --

            The message template for SMS messages.

          • EmailMessage (string) --

            The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER.

          • EmailSubject (string) --

            The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER.

      • UserPoolAddOns (dict) --

        Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to AUDIT. To configure automatic security responses to potentially unwanted traffic to your user pool, set to ENFORCED.

        For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier.

        • AdvancedSecurityMode (string) --

          The operating mode of threat protection for standard authentication types in your user pool, including username-password and secure remote password (SRP) authentication.

        • AdvancedSecurityAdditionalFlows (dict) --

          Threat protection configuration options for additional authentication types in your user pool, including custom authentication.

      • DcrConfiguration (dict) --

        The dynamic client registration configuration for the user pool. With dynamic client registration, applications can register their own app clients at runtime through the registration endpoint of your user pool domain. To activate this setting, your user pool must be in the Essentials tier or higher.

        • EnableStatus (string) --

          Specifies whether dynamic client registration is turned on for the user pool. If you provide a dynamic client registration configuration without this value, Amazon Cognito turns dynamic client registration on.

        • OpenDcrEnabled (boolean) --

          Specifies whether open registration is turned on. When open registration is on, applications can register app clients without an initial access token. The default value is false.

        • AuthenticatedGrantTypes (list) --

          The OAuth grant types that an app client created through authenticated registration can request. If you don't set this value, authenticated registration permits the code and client_credentials grant types. If you set an empty list, Amazon Cognito rejects authenticated registration requests. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

          code

          Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

          client_credentials

          Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

          • (string) --

        • OpenDcrGrantTypes (list) --

          The OAuth grant types that an app client created through open registration can request. If you don't set this value, open registration permits only the code grant type. If you set an empty list, Amazon Cognito rejects open registration requests. If you add client_credentials, anyone can register an app client that requests machine-to-machine (M2M) access tokens, and you pay for the M2M token requests that those app clients make. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

          code

          Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

          client_credentials

          Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

          • (string) --

        • AllowedScopes (list) --

          The scopes that an app client created through dynamic client registration can request, in addition to the standard OpenID Connect (OIDC) scopes. You can include custom scopes from your resource servers and aws.cognito.signin.user.admin. Registered app clients can request the OIDC scopes openid, email, phone, and profile without listing them here. If you don't set this value, registered app clients can request only the OIDC scopes. A registered app client can't request the aws.cognito/dcr/register scope, even if you include it in this list.

          • (string) --

      • UsernameConfiguration (dict) --

        Case sensitivity of the username input for the selected sign-in option. When case sensitivity is set to False (case insensitive), users can sign in with any combination of capital and lowercase letters. For example, username, USERNAME, or UserName, or for email, email@example.com or EMaiL@eXamplE.Com. For most use cases, set case sensitivity to False (case insensitive) as a best practice. When usernames and email addresses are case insensitive, Amazon Cognito treats any variation in case as the same user, and prevents a case variation from being assigned to the same attribute for a different user.

        • CaseSensitive (boolean) --

          Specifies whether user name case sensitivity will be applied for all users in the user pool through Amazon Cognito APIs. For most use cases, set case sensitivity to False (case insensitive) as a best practice. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name.

          Valid values include:

          true

          Enables case sensitivity for all username input. When this option is set to true, users must sign in using the exact capitalization of their given username, such as “UserName”. This is the default value.

          false

          Enables case insensitivity for all username input. For example, when this option is set to false, users can sign in using username, USERNAME, or UserName. This option also enables both preferred_username and email alias to be case insensitive, in addition to the username attribute.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the user pool.

      • AccountRecoverySetting (dict) --

        The available verified method a user can use to recover their password when they call ForgotPassword. You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email.

        • RecoveryMechanisms (list) --

          The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators.

          • (dict) --

            A recovery option for a user. The AccountRecoverySettingType data type is an array of this object. Each RecoveryOptionType has a priority property that determines whether it is a primary or secondary option.

            For example, if verified_email has a priority of 1 and verified_phone_number has a priority of 2, your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The admin_only option prevents self-service account recovery.

            • Priority (integer) --

              Your priority preference for using the specified attribute in account recovery. The highest priority is 1.

            • Name (string) --

              The recovery method that this object sets a recovery option for.

      • UserPoolTier (string) --

        The user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to ESSENTIALS.

      • KeyConfiguration (dict) --

        The key configuration for the user pool, including encryption settings.

        • KeyType (string) --

          The type of encryption key used for the user pool.

          AWS_OWNED_KEY

          A key owned by Amazon Web Services in Key Management Service.

          CUSTOMER_MANAGED_KEY

          A key managed by the customer in Key Management Service. You must use a multi-region key to enable multi-region replication for a user pool.

        • KmsKeyArn (string) --

          The Amazon Resource Name (ARN) of the KMS key used for encryption. If not specified, Amazon Web Services managed keys are used.

      • IssuerConfiguration (dict) --

        The issuer configuration for the user pool, including token issuing settings.

        • Type (string) --

          The type of issuer configuration. Determines the token issuing behavior for the user pool.

          ORIGINAL

          The original issuer configuration for user pools. The issuer URL is hosted in the user pool’s region and provides OIDC endpoints specific to that region.

          Original issuers have the format of https://cognito-idp.[region].amazonaws.com/[userPoolId]

          UPDATED

          Recommended for all user pools, including for multi-Region replication. Updated issuers host the same JWKS content in multiple regions, resulting in improved resilience and efficiency.

          Updated issuers have the format of https://issuer-cognito-idp.[region].amazonaws.com/[userPoolId], where region is the primary Amazon Web Services Region of your user pool.

      • AcrConfiguration (dict) --

        The names of the authentication context class reference (ACR) levels for the user pool. Amazon Cognito always returns the effective configuration, with default names merged in for any level that you haven't customized.

        Configuring custom ACR level names requires the Essentials or Plus feature plan. To activate this setting, your user pool must be in the Essentials tier or higher.

        • (string) --

          • (dict) --

            The configuration for a single authentication context class reference (ACR) level in a user pool. Each entry in an AcrConfiguration map associates a level ( Level1 through Level4) with this configuration, which provides the custom name that Amazon Cognito reports for that level in the acr token claim.

            • AcrValue (string) --

              The custom name for this authentication context class reference (ACR) level. This value is the URI that Amazon Cognito reports in the acr token claim when a user meets this level. The name must be unique across all levels in the user pool, including default names.

CreateUserPoolClient (updated) Link ¶
Changes (response)
{'UserPoolClient': {'ClientType': 'REGULAR | DCR'}}

Creates an app client in a user pool. This operation sets basic and advanced configuration options.

Unlike app clients created in the console, Amazon Cognito doesn't automatically assign a branding style to app clients that you configure with this API operation. Managed login and classic hosted UI pages aren't available for your client until after you apply a branding style.

See also: AWS API Documentation

Request Syntax

client.create_user_pool_client(
    UserPoolId='string',
    ClientName='string',
    GenerateSecret=True|False,
    ClientSecret='string',
    RefreshTokenValidity=123,
    AccessTokenValidity=123,
    IdTokenValidity=123,
    TokenValidityUnits={
        'AccessToken': 'seconds'|'minutes'|'hours'|'days',
        'IdToken': 'seconds'|'minutes'|'hours'|'days',
        'RefreshToken': 'seconds'|'minutes'|'hours'|'days'
    },
    ReadAttributes=[
        'string',
    ],
    WriteAttributes=[
        'string',
    ],
    ExplicitAuthFlows=[
        'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH',
    ],
    SupportedIdentityProviders=[
        'string',
    ],
    CallbackURLs=[
        'string',
    ],
    LogoutURLs=[
        'string',
    ],
    DefaultRedirectURI='string',
    AllowedOAuthFlows=[
        'code'|'implicit'|'client_credentials',
    ],
    AllowedOAuthScopes=[
        'string',
    ],
    AllowedOAuthFlowsUserPoolClient=True|False,
    AnalyticsConfiguration={
        'ApplicationId': 'string',
        'ApplicationArn': 'string',
        'RoleArn': 'string',
        'ExternalId': 'string',
        'UserDataShared': True|False
    },
    PreventUserExistenceErrors='LEGACY'|'ENABLED',
    EnableTokenRevocation=True|False,
    EnablePropagateAdditionalUserContextData=True|False,
    AuthSessionValidity=123,
    RefreshTokenRotation={
        'Feature': 'ENABLED'|'DISABLED',
        'RetryGracePeriodSeconds': 123
    }
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool where you want to create an app client.

type ClientName:

string

param ClientName:

[REQUIRED]

A friendly name for the app client that you want to create.

type GenerateSecret:

boolean

param GenerateSecret:

When true, generates a client secret for the app client. Client secrets are used with server-side and machine-to-machine applications. Client secrets are automatically generated; you can't specify a secret value. For more information, see App client types.

type ClientSecret:

string

param ClientSecret:

A custom client secret that you want to use for the app client. You cannot specify both GenerateSecret as true and provide a ClientSecret value.

type RefreshTokenValidity:

integer

param RefreshTokenValidity:

The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for RefreshTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

For example, when you set RefreshTokenValidity as 10 and TokenValidityUnits as days, your user can refresh their session and retrieve new access and ID tokens for 10 days.

The default time unit for RefreshTokenValidity in an API request is days. You can't set RefreshTokenValidity to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. Valid range is displayed below in seconds.

If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days.

type AccessTokenValidity:

integer

param AccessTokenValidity:

The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for AccessTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

For example, when you set AccessTokenValidity to 10 and TokenValidityUnits to hours, your user can authorize access with their access token for 10 hours.

The default time unit for AccessTokenValidity in an API request is hours. Valid range is displayed below in seconds.

If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour.

type IdTokenValidity:

integer

param IdTokenValidity:

The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for IdTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

For example, when you set IdTokenValidity as 10 and TokenValidityUnits as hours, your user can authenticate their session with their ID token for 10 hours.

The default time unit for IdTokenValidity in an API request is hours. Valid range is displayed below in seconds.

If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour.

type TokenValidityUnits:

dict

param TokenValidityUnits:

The units that validity times are represented in. The default unit for refresh tokens is days, and the default for ID and access tokens are hours.

  • AccessToken (string) --

    A time unit for the value that you set in the AccessTokenValidity parameter. The default AccessTokenValidity time unit is hours. AccessTokenValidity duration can range from five minutes to one day.

  • IdToken (string) --

    A time unit for the value that you set in the IdTokenValidity parameter. The default IdTokenValidity time unit is hours. IdTokenValidity duration can range from five minutes to one day.

  • RefreshToken (string) --

    A time unit for the value that you set in the RefreshTokenValidity parameter. The default RefreshTokenValidity time unit is days. RefreshTokenValidity duration can range from 60 minutes to 10 years.

type ReadAttributes:

list

param ReadAttributes:

The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list.

When you don't specify the ReadAttributes for your app client, your app can read the values of email_verified, phone_number_verified, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, ReadAttributes doesn't return any information. Amazon Cognito only populates ReadAttributes in the API response if you have specified your own custom set of read attributes.

  • (string) --

type WriteAttributes:

list

param WriteAttributes:

The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list.

When you don't specify the WriteAttributes for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, WriteAttributes doesn't return any information. Amazon Cognito only populates WriteAttributes in the API response if you have specified your own custom set of write attributes.

If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool.

  • (string) --

type ExplicitAuthFlows:

list

param ExplicitAuthFlows:

The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.

The values for authentication flow options include the following.

  • ALLOW_USER_AUTH: Enable selection-based sign-in with USER_AUTH. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without other ExplicitAuthFlows permitting them. For example users can complete an SRP challenge through USER_AUTH without the flow USER_SRP_AUTH being active for the app client. This flow doesn't include CUSTOM_AUTH. To activate this setting, your user pool must be in the Essentials tier or higher.

  • ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password.

  • ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication.

  • ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords.

  • ALLOW_USER_SRP_AUTH: Enable SRP-based authentication.

  • ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens.

In some environments, you will see the values ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, or USER_PASSWORD_AUTH. You can't assign these legacy ExplicitAuthFlows values to user pool clients at the same time as values that begin with ALLOW_, like ALLOW_USER_SRP_AUTH.

  • (string) --

type SupportedIdentityProviders:

list

param SupportedIdentityProviders:

A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: COGNITO, Facebook, Google, SignInWithApple, and LoginWithAmazon. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example MySAMLIdP or MyOIDCIdP.

This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of COGNITO from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule.

  • (string) --

type CallbackURLs:

list

param CallbackURLs:

A list of allowed redirect, or callback, URLs for managed login authentication. These URLs are the paths where you want to send your users' browsers after they complete authentication with managed login or a third-party IdP. Typically, callback URLs are the home of an application that uses OAuth or OIDC libraries to process authentication outcomes.

A redirect URI must meet the following requirements:

  • Be an absolute URI.

  • Be registered with the authorization server. Amazon Cognito doesn't accept authorization requests with redirect_uri values that aren't in the list of CallbackURLs that you provide in this parameter.

  • Not include a fragment component.

See OAuth 2.0 - Redirection Endpoint.

Amazon Cognito requires HTTPS over HTTP except for callback URLs to http://localhost, http://127.0.0.1 and http://[::1]. These callback URLs are for testing purposes only. You can specify custom TCP ports for your callback URLs.

App callback URLs such as myapp://example are also supported.

  • (string) --

type LogoutURLs:

list

param LogoutURLs:

A list of allowed logout URLs for managed login authentication. When you pass logout_uri and client_id parameters to /logout, Amazon Cognito signs out your user and redirects them to the logout URL. This parameter describes the URLs that you want to be the permitted targets of logout_uri. A typical use of these URLs is when a user selects "Sign out" and you redirect them to your public homepage. For more information, see Logout endpoint.

  • (string) --

type DefaultRedirectURI:

string

param DefaultRedirectURI:

The default redirect URI. In app clients with one assigned IdP, replaces redirect_uri in authentication requests. Must be in the CallbackURLs list.

type AllowedOAuthFlows:

list

param AllowedOAuthFlows:

The OAuth grant types that you want your app client to generate for clients in managed login authentication. To create an app client that generates client credentials grants, you must add client_credentials as the only allowed OAuth flow.

code

Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

implicit

Issue the access token, and the ID token when scopes like openid and profile are requested, directly to your user.

client_credentials

Issue the access token from the /oauth2/token endpoint directly to a non-person user, authorized by a combination of the client ID and client secret.

  • (string) --

type AllowedOAuthScopes:

list

param AllowedOAuthScopes:

The OAuth, OpenID Connect (OIDC), and custom scopes that you want to permit your app client to authorize access with. Scopes govern access control to user pool self-service API operations, user data from the userInfo endpoint, and third-party APIs. Scope values include phone, email, openid, and profile. The aws.cognito.signin.user.admin scope authorizes user self-service operations. Custom scopes with resource servers authorize access to external APIs.

  • (string) --

type AllowedOAuthFlowsUserPoolClient:

boolean

param AllowedOAuthFlowsUserPoolClient:

Set to true to use OAuth 2.0 authorization server features in your app client.

This parameter must have a value of true before you can configure the following features in your app client.

  • CallBackURLs: Callback URLs.

  • LogoutURLs: Sign-out redirect URLs.

  • AllowedOAuthScopes: OAuth 2.0 scopes.

  • AllowedOAuthFlows: Support for authorization code, implicit, and client credentials OAuth 2.0 grants.

To use authorization server features, configure one of these features in the Amazon Cognito console or set AllowedOAuthFlowsUserPoolClient to true in a CreateUserPoolClient or UpdateUserPoolClient API request. If you don't set a value for AllowedOAuthFlowsUserPoolClient in a request with the CLI or SDKs, it defaults to false. When false, only SDK-based API sign-in is permitted.

type AnalyticsConfiguration:

dict

param AnalyticsConfiguration:

The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.

In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools might not have access to analytics or might be configurable with campaigns in the US East (N. Virginia) Region. For more information, see Using Amazon Pinpoint analytics.

  • ApplicationId (string) --

    Your Amazon Pinpoint project ID.

  • ApplicationArn (string) --

    The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that ApplicationArn declares. You can also configure your application to pass an endpoint ID in the AnalyticsMetadata parameter of sign-in operations. The endpoint ID is information about the destination for push notifications

  • RoleArn (string) --

    The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics.

  • ExternalId (string) --

    The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint.

  • UserDataShared (boolean) --

    If UserDataShared is true, Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics.

type PreventUserExistenceErrors:

string

param PreventUserExistenceErrors:

When ENABLED, suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to ENABLED and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs return a UserNotFoundException exception if the user doesn't exist in the user pool.

Defaults to LEGACY.

type EnableTokenRevocation:

boolean

param EnableTokenRevocation:

Activates or deactivates token revocation in the target app client.

If you don't include this parameter, token revocation is automatically activated for the new user pool client.

type EnablePropagateAdditionalUserContextData:

boolean

param EnablePropagateAdditionalUserContextData:

When true, your application can include additional UserContextData in authentication requests. This data includes the IP address, and contributes to analysis by threat protection features. For more information about propagation of user context data, see Adding session data to API requests. If you don’t include this parameter, you can't send the source IP address to Amazon Cognito threat protection features. You can only activate EnablePropagateAdditionalUserContextData in an app client that has a client secret.

type AuthSessionValidity:

integer

param AuthSessionValidity:

Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires.

type RefreshTokenRotation:

dict

param RefreshTokenRotation:

The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens.

  • Feature (string) -- [REQUIRED]

    The state of refresh token rotation for the current app client.

  • RetryGracePeriodSeconds (integer) --

    When you request a token refresh with GetTokensFromRefreshToken, the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When RetryGracePeriodSeconds is 0, the grace period is disabled and a successful request immediately invalidates the submitted refresh token.

rtype:

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,
        'AccessTokenValidity': 123,
        'IdTokenValidity': 123,
        'TokenValidityUnits': {
            'AccessToken': 'seconds'|'minutes'|'hours'|'days',
            'IdToken': 'seconds'|'minutes'|'hours'|'days',
            'RefreshToken': 'seconds'|'minutes'|'hours'|'days'
        },
        'ReadAttributes': [
            'string',
        ],
        'WriteAttributes': [
            'string',
        ],
        'ExplicitAuthFlows': [
            'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH',
        ],
        'SupportedIdentityProviders': [
            'string',
        ],
        'CallbackURLs': [
            'string',
        ],
        'LogoutURLs': [
            'string',
        ],
        'DefaultRedirectURI': 'string',
        'AllowedOAuthFlows': [
            'code'|'implicit'|'client_credentials',
        ],
        'AllowedOAuthScopes': [
            'string',
        ],
        'AllowedOAuthFlowsUserPoolClient': True|False,
        'AnalyticsConfiguration': {
            'ApplicationId': 'string',
            'ApplicationArn': 'string',
            'RoleArn': 'string',
            'ExternalId': 'string',
            'UserDataShared': True|False
        },
        'PreventUserExistenceErrors': 'LEGACY'|'ENABLED',
        'EnableTokenRevocation': True|False,
        'EnablePropagateAdditionalUserContextData': True|False,
        'AuthSessionValidity': 123,
        'RefreshTokenRotation': {
            'Feature': 'ENABLED'|'DISABLED',
            'RetryGracePeriodSeconds': 123
        },
        'ClientType': 'REGULAR'|'DCR'
    }
}

Response Structure

  • (dict) --

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

    • UserPoolClient (dict) --

      The details of the new app client.

      • UserPoolId (string) --

        The ID of the user pool associated with the app client.

      • ClientName (string) --

        The name of the app client.

      • ClientId (string) --

        The ID of the app client.

      • ClientSecret (string) --

        The app client secret.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • RefreshTokenValidity (integer) --

        The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for RefreshTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set RefreshTokenValidity as 10 and TokenValidityUnits as days, your user can refresh their session and retrieve new access and ID tokens for 10 days.

        The default time unit for RefreshTokenValidity in an API request is days. You can't set RefreshTokenValidity to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days.

      • AccessTokenValidity (integer) --

        The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for AccessTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set AccessTokenValidity to 10 and TokenValidityUnits to hours, your user can authorize access with their access token for 10 hours.

        The default time unit for AccessTokenValidity in an API request is hours. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour.

      • IdTokenValidity (integer) --

        The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for IdTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set IdTokenValidity as 10 and TokenValidityUnits as hours, your user can authenticate their session with their ID token for 10 hours.

        The default time unit for IdTokenValidity in an API request is hours. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour.

      • TokenValidityUnits (dict) --

        The time units that, with IdTokenValidity, AccessTokenValidity, and RefreshTokenValidity, set and display the duration of ID, access, and refresh tokens for an app client. You can assign a separate token validity unit to each type of token.

        • AccessToken (string) --

          A time unit for the value that you set in the AccessTokenValidity parameter. The default AccessTokenValidity time unit is hours. AccessTokenValidity duration can range from five minutes to one day.

        • IdToken (string) --

          A time unit for the value that you set in the IdTokenValidity parameter. The default IdTokenValidity time unit is hours. IdTokenValidity duration can range from five minutes to one day.

        • RefreshToken (string) --

          A time unit for the value that you set in the RefreshTokenValidity parameter. The default RefreshTokenValidity time unit is days. RefreshTokenValidity duration can range from 60 minutes to 10 years.

      • ReadAttributes (list) --

        The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list.

        When you don't specify the ReadAttributes for your app client, your app can read the values of email_verified, phone_number_verified, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, ReadAttributes doesn't return any information. Amazon Cognito only populates ReadAttributes in the API response if you have specified your own custom set of read attributes.

        • (string) --

      • WriteAttributes (list) --

        The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list.

        When you don't specify the WriteAttributes for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, WriteAttributes doesn't return any information. Amazon Cognito only populates WriteAttributes in the API response if you have specified your own custom set of write attributes.

        If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool.

        • (string) --

      • ExplicitAuthFlows (list) --

        The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.

        The values for authentication flow options include the following.

        • ALLOW_USER_AUTH: Enable selection-based sign-in with USER_AUTH. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without other ExplicitAuthFlows permitting them. For example users can complete an SRP challenge through USER_AUTH without the flow USER_SRP_AUTH being active for the app client. This flow doesn't include CUSTOM_AUTH. To activate this setting, your user pool must be in the Essentials tier or higher.

        • ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password.

        • ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication.

        • ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords.

        • ALLOW_USER_SRP_AUTH: Enable SRP-based authentication.

        • ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens.

        In some environments, you will see the values ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, or USER_PASSWORD_AUTH. You can't assign these legacy ExplicitAuthFlows values to user pool clients at the same time as values that begin with ALLOW_, like ALLOW_USER_SRP_AUTH.

        • (string) --

      • SupportedIdentityProviders (list) --

        A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: COGNITO, Facebook, Google, SignInWithApple, and LoginWithAmazon. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example MySAMLIdP or MyOIDCIdP.

        This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of COGNITO from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule.

        • (string) --

      • CallbackURLs (list) --

        A list of allowed redirect (callback) URLs for the IdPs.

        A redirect URI must:

        • Be an absolute URI.

        • Be registered with the authorization server.

        • Not include a fragment component.

        See OAuth 2.0 - Redirection Endpoint.

        Amazon Cognito requires HTTPS over HTTP for callback URLs to http://localhost, http://127.0.0.1 and http://[::1]. These callback URLs are for testing purposes only. You can specify custom TCP ports for your callback URLs.

        App callback URLs such as myapp://example are also supported.

        • (string) --

      • LogoutURLs (list) --

        A list of allowed logout URLs for the IdPs.

        • (string) --

      • DefaultRedirectURI (string) --

        The default redirect URI. Must be in the CallbackURLs list.

        A redirect URI must:

        • Be an absolute URI.

        • Be registered with the authorization server.

        • Not include a fragment component.

        See OAuth 2.0 - Redirection Endpoint.

        Amazon Cognito requires HTTPS over HTTP for callback URLs to http://localhost, http://127.0.0.1 and http://[::1]. These callback URLs are for testing purposes only. You can specify custom TCP ports for your callback URLs.

        App callback URLs such as myapp://example are also supported.

      • AllowedOAuthFlows (list) --

        The OAuth grant types that you want your app client to generate. To create an app client that generates client credentials grants, you must add client_credentials as the only allowed OAuth flow.

        code

        Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

        implicit

        Issue the access token (and, optionally, ID token, based on scopes) directly to your user.

        client_credentials

        Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

        • (string) --

      • AllowedOAuthScopes (list) --

        The OAuth 2.0 scopes that you want your app client to support. Can include standard OAuth scopes like phone, email, openid, and profile. Can also include the aws.cognito.signin.user.admin scope that authorizes user profile self-service operations and custom scopes from resource servers.

        • (string) --

      • AllowedOAuthFlowsUserPoolClient (boolean) --

        Set to true to use OAuth 2.0 authorization server features in your app client.

        This parameter must have a value of true before you can configure the following features in your app client.

        • CallBackURLs: Callback URLs.

        • LogoutURLs: Sign-out redirect URLs.

        • AllowedOAuthScopes: OAuth 2.0 scopes.

        • AllowedOAuthFlows: Support for authorization code, implicit, and client credentials OAuth 2.0 grants.

        To use authorization server features, configure one of these features in the Amazon Cognito console or set AllowedOAuthFlowsUserPoolClient to true in a CreateUserPoolClient or UpdateUserPoolClient API request. If you don't set a value for AllowedOAuthFlowsUserPoolClient in a request with the CLI or SDKs, it defaults to false. When false, only SDK-based API sign-in is permitted.

      • AnalyticsConfiguration (dict) --

        The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.

        • ApplicationId (string) --

          Your Amazon Pinpoint project ID.

        • ApplicationArn (string) --

          The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that ApplicationArn declares. You can also configure your application to pass an endpoint ID in the AnalyticsMetadata parameter of sign-in operations. The endpoint ID is information about the destination for push notifications

        • RoleArn (string) --

          The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics.

        • ExternalId (string) --

          The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint.

        • UserDataShared (boolean) --

          If UserDataShared is true, Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics.

      • PreventUserExistenceErrors (string) --

        When ENABLED, suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to ENABLED and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs return a UserNotFoundException exception if the user doesn't exist in the user pool.

        Defaults to LEGACY.

      • EnableTokenRevocation (boolean) --

        Indicates whether token revocation is activated for the user pool client. When you create a new user pool client, token revocation is activated by default.

      • EnablePropagateAdditionalUserContextData (boolean) --

        When EnablePropagateAdditionalUserContextData is true, Amazon Cognito accepts an IpAddress value that you send in the UserContextData parameter. The UserContextData parameter sends information to Amazon Cognito threat protection for risk analysis. You can send UserContextData when you sign in Amazon Cognito native users with the InitiateAuth and RespondToAuthChallenge API operations.

        When EnablePropagateAdditionalUserContextData is false, you can't send your user's source IP address to Amazon Cognito threat protection with unauthenticated API operations. EnablePropagateAdditionalUserContextData doesn't affect whether you can send a source IP address in a ContextData parameter with the authenticated API operations AdminInitiateAuth and AdminRespondToAuthChallenge.

        You can only activate EnablePropagateAdditionalUserContextData in an app client that has a client secret. For more information about propagation of user context data, see Adding user device and session data to API requests.

      • AuthSessionValidity (integer) --

        Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires.

      • RefreshTokenRotation (dict) --

        The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens.

        • Feature (string) --

          The state of refresh token rotation for the current app client.

        • RetryGracePeriodSeconds (integer) --

          When you request a token refresh with GetTokensFromRefreshToken, the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When RetryGracePeriodSeconds is 0, the grace period is disabled and a successful request immediately invalidates the submitted refresh token.

      • ClientType (string) --

        How the app client was created.

        REGULAR

        The app client wasn't created through dynamic client registration. For example, you created it with CreateUserPoolClient.

        DCR

        An application registered the app client through dynamic client registration. These app clients don't support client secret operations such as AddUserPoolClientSecret, and they can't hold the aws.cognito/dcr/register scope.

DescribeResourceServer (updated) Link ¶
Changes (response)
{'ResourceServer': {'ManagedBy': 'COGNITO'}}

Describes a resource server. For more information about resource servers, see Access control with resource servers.

See also: AWS API Documentation

Request Syntax

client.describe_resource_server(
    UserPoolId='string',
    Identifier='string'
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that hosts the resource server.

type Identifier:

string

param Identifier:

[REQUIRED]

A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

rtype:

dict

returns:

Response Syntax

{
    'ResourceServer': {
        'UserPoolId': 'string',
        'Identifier': 'string',
        'Name': 'string',
        'Scopes': [
            {
                'ScopeName': 'string',
                'ScopeDescription': 'string'
            },
        ],
        'ManagedBy': 'COGNITO'
    }
}

Response Structure

  • (dict) --

    • ResourceServer (dict) --

      The details of the requested resource server.

      • UserPoolId (string) --

        The ID of the user pool that contains the resource server configuration.

      • Identifier (string) --

        A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

        Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

      • Name (string) --

        The name of the resource server.

      • Scopes (list) --

        A list of scopes that are defined for the resource server.

        • (dict) --

          One custom scope associated with a user pool resource server. This data type is a member of ResourceServerScopeType. For more information, see Scopes, M2M, and API authorization with resource servers.

          • ScopeName (string) --

            The name of the scope. Amazon Cognito renders custom scopes in the format resourceServerIdentifier/ScopeName. For example, if this parameter is exampleScope in the resource server with the identifier exampleResourceServer, you request and receive the scope exampleResourceServer/exampleScope.

          • ScopeDescription (string) --

            A friendly description of a custom scope.

      • ManagedBy (string) --

        This value is reserved for resource servers that Amazon Cognito manages. Resource servers that you create don't have this value.

DescribeUserPool (updated) Link ¶
Changes (response)
{'UserPool': {'DcrConfiguration': {'AllowedScopes': ['string'],
                                   'AuthenticatedGrantTypes': ['code | '
                                                               'implicit | '
                                                               'client_credentials'],
                                   'EnableStatus': 'Enabled | Disabled',
                                   'OpenDcrEnabled': 'boolean',
                                   'OpenDcrGrantTypes': ['code | implicit | '
                                                         'client_credentials']}}}

Given a user pool ID, returns configuration information. This operation is useful when you want to inspect an existing user pool and programmatically replicate the configuration to another user pool.

See also: AWS API Documentation

Request Syntax

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

string

param UserPoolId:

[REQUIRED]

The ID of 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,
                'PasswordHistorySize': 123,
                'TemporaryPasswordValidityDays': 123
            },
            'SignInPolicy': {
                'AllowedFirstAuthFactors': [
                    'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN'|'SOFTWARE_TOKEN',
                ]
            }
        },
        'DeletionProtection': 'ACTIVE'|'INACTIVE',
        'LambdaConfig': {
            'PreSignUp': 'string',
            'CustomMessage': 'string',
            'PostConfirmation': 'string',
            'PreAuthentication': 'string',
            'PostAuthentication': 'string',
            'DefineAuthChallenge': 'string',
            'CreateAuthChallenge': 'string',
            'VerifyAuthChallengeResponse': 'string',
            'PreTokenGeneration': 'string',
            'UserMigration': 'string',
            'PreTokenGenerationConfig': {
                'LambdaVersion': 'V1_0'|'V2_0'|'V3_0',
                'LambdaArn': 'string'
            },
            'CustomSMSSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'CustomEmailSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'KMSKeyID': 'string',
            'InboundFederation': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': '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',
        ],
        'UsernameAttributes': [
            'phone_number'|'email',
        ],
        'SmsVerificationMessage': 'string',
        'EmailVerificationMessage': 'string',
        'EmailVerificationSubject': 'string',
        'VerificationMessageTemplate': {
            'SmsMessage': 'string',
            'EmailMessage': 'string',
            'EmailSubject': 'string',
            'EmailMessageByLink': 'string',
            'EmailSubjectByLink': 'string',
            'DefaultEmailOption': 'CONFIRM_WITH_LINK'|'CONFIRM_WITH_CODE'
        },
        'SmsAuthenticationMessage': 'string',
        'UserAttributeUpdateSettings': {
            'AttributesRequireVerificationBeforeUpdate': [
                'phone_number'|'email',
            ]
        },
        'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
        'DeviceConfiguration': {
            'ChallengeRequiredOnNewDevice': True|False,
            'DeviceOnlyRememberedOnUserPrompt': True|False
        },
        'EstimatedNumberOfUsers': 123,
        'EmailConfiguration': {
            'SourceArn': 'string',
            'ReplyToEmailAddress': 'string',
            'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER',
            'From': 'string',
            'ConfigurationSet': 'string'
        },
        'SmsConfiguration': {
            'SnsCallerArn': 'string',
            'ExternalId': 'string',
            'SnsRegion': 'string',
            'EumsSms': {
                'CallerArn': 'string',
                'ExternalId': 'string',
                'OriginationIdentity': 'string',
                'ConfigurationSetName': 'string',
                'InEntityId': 'string',
                'InTemplateId': 'string',
                'Region': 'string'
            }
        },
        'UserPoolTags': {
            'string': 'string'
        },
        'SmsConfigurationFailure': 'string',
        'EmailConfigurationFailure': 'string',
        'Domain': 'string',
        'CustomDomain': 'string',
        'AdminCreateUserConfig': {
            'AllowAdminCreateUserOnly': True|False,
            'UnusedAccountValidityDays': 123,
            'InviteMessageTemplate': {
                'SMSMessage': 'string',
                'EmailMessage': 'string',
                'EmailSubject': 'string'
            }
        },
        'UserPoolAddOns': {
            'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED',
            'AdvancedSecurityAdditionalFlows': {
                'CustomAuthMode': 'AUDIT'|'ENFORCED'
            }
        },
        'DcrConfiguration': {
            'EnableStatus': 'Enabled'|'Disabled',
            'OpenDcrEnabled': True|False,
            'AuthenticatedGrantTypes': [
                'code'|'implicit'|'client_credentials',
            ],
            'OpenDcrGrantTypes': [
                'code'|'implicit'|'client_credentials',
            ],
            'AllowedScopes': [
                'string',
            ]
        },
        'UsernameConfiguration': {
            'CaseSensitive': True|False
        },
        'Arn': 'string',
        'AccountRecoverySetting': {
            'RecoveryMechanisms': [
                {
                    'Priority': 123,
                    'Name': 'verified_email'|'verified_phone_number'|'admin_only'
                },
            ]
        },
        'UserPoolTier': 'LITE'|'ESSENTIALS'|'PLUS',
        'KeyConfiguration': {
            'KeyType': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KEY',
            'KmsKeyArn': 'string'
        },
        'IssuerConfiguration': {
            'Type': 'ORIGINAL'|'UPDATED'
        },
        'AcrConfiguration': {
            'string': {
                'AcrValue': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    Represents the response to describe the user pool.

    • UserPool (dict) --

      The details of the requested user pool.

      • Id (string) --

        The ID of the user pool.

      • Name (string) --

        The name of the user pool.

      • Policies (dict) --

        A list of user pool policies. Contains the policy that sets password-complexity requirements.

        • PasswordPolicy (dict) --

          The password policy settings for a user pool, including complexity, history, and length requirements.

          • MinimumLength (integer) --

            The minimum length of the password in the policy that you have set. This value can't be less than 6.

          • RequireUppercase (boolean) --

            The requirement in a password policy that users must include at least one uppercase letter in their password.

          • RequireLowercase (boolean) --

            The requirement in a password policy that users must include at least one lowercase letter in their password.

          • RequireNumbers (boolean) --

            The requirement in a password policy that users must include at least one number in their password.

          • RequireSymbols (boolean) --

            The requirement in a password policy that users must include at least one symbol in their password.

          • PasswordHistorySize (integer) --

            The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of n previous passwords, where n is the value of PasswordHistorySize.

          • TemporaryPasswordValidityDays (integer) --

            The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to 7. If you submit a value of 0, Amazon Cognito treats it as a null value and sets TemporaryPasswordValidityDays to its default value.

        • SignInPolicy (dict) --

          The policy for allowed types of authentication in a user pool.

          • AllowedFirstAuthFactors (list) --

            The sign-in methods that a user pool supports as the first factor. You can permit users to start authentication with a standard username and password, or with other one-time password and hardware factors.

            • (string) --

      • DeletionProtection (string) --

        When active, DeletionProtection prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.

        When you try to delete a protected user pool in a DeleteUserPool API request, Amazon Cognito returns an InvalidParameterException error. To delete a protected user pool, send a new DeleteUserPool request after you deactivate deletion protection in an UpdateUserPool API request.

      • LambdaConfig (dict) --

        A collection of user pool Lambda triggers. Amazon Cognito invokes triggers at several possible stages of user pool operations. Triggers can modify the outcome of the operations that invoked them.

        • PreSignUp (string) --

          The configuration of a pre sign-up Lambda trigger in a user pool. This trigger evaluates new users and can bypass confirmation, link a federated user profile, or block sign-up requests.

        • CustomMessage (string) --

          A custom message Lambda trigger. This trigger is an opportunity to customize all SMS and email messages from your user pool. When a custom message trigger is active, your user pool routes all messages to a Lambda function that returns a runtime-customized message subject and body for your user pool to deliver to a user.

        • PostConfirmation (string) --

          The configuration of a post confirmation Lambda trigger in a user pool. This trigger can take custom actions after a user confirms their user account and their email address or phone number.

        • PreAuthentication (string) --

          The configuration of a pre authentication trigger in a user pool. This trigger can evaluate and modify user sign-in events.

        • PostAuthentication (string) --

          The configuration of a post authentication Lambda trigger in a user pool. This trigger can take custom actions after a user signs in.

        • DefineAuthChallenge (string) --

          The configuration of a define auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

        • CreateAuthChallenge (string) --

          The configuration of a create auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

        • VerifyAuthChallengeResponse (string) --

          The configuration of a verify auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

        • PreTokenGeneration (string) --

          The legacy configuration of a pre token generation Lambda trigger in a user pool.

          Set this parameter for legacy purposes. If you also set an ARN in PreTokenGenerationConfig, its value must be identical to PreTokenGeneration. For new instances of pre token generation triggers, set the LambdaArn of PreTokenGenerationConfig.

        • UserMigration (string) --

          The configuration of a migrate user Lambda trigger in a user pool. This trigger can create user profiles when users sign in or attempt to reset their password with credentials that don't exist yet.

        • PreTokenGenerationConfig (dict) --

          The detailed configuration of a pre token generation Lambda trigger in a user pool. If you also set an ARN in PreTokenGeneration, its value must be identical to PreTokenGenerationConfig.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

            This parameter and the PreTokenGeneration property of LambdaConfig have the same value. For new instances of pre token generation triggers, set LambdaArn.

        • CustomSMSSender (dict) --

          The configuration of a custom SMS sender Lambda trigger. This trigger routes all SMS notifications from a user pool to a Lambda function that delivers the message using custom logic.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

            You must use a LambdaVersion of V1_0 with a custom sender function.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

        • CustomEmailSender (dict) --

          The configuration of a custom email sender Lambda trigger. This trigger routes all email notifications from a user pool to a Lambda function that delivers the message using custom logic.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

            You must use a LambdaVersion of V1_0 with a custom sender function.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

        • KMSKeyID (string) --

          The ARN of an KMS key. Amazon Cognito uses the key to encrypt codes and temporary passwords sent to custom sender Lambda triggers.

        • InboundFederation (dict) --

          The configuration of an inbound federation Lambda trigger. This trigger can transform federated user attributes during the authentication with external identity providers.

          • LambdaVersion (string) --

            The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

            You must use a LambdaVersion of V1_0 with an inbound federation function.

          • LambdaArn (string) --

            The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

      • Status (string) --

        This parameter is no longer used.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • SchemaAttributes (list) --

        A list of the user attributes and their properties in your user pool. The attribute schema contains standard attributes, custom attributes with a custom: prefix, and developer attributes with a dev: prefix. For more information, see User pool attributes.

        Developer-only attributes are a legacy feature of user pools, and are read-only to all app clients. You can create and update developer-only attributes only with IAM-authenticated API operations. Use app client read/write permissions instead.

        • (dict) --

          A list of the user attributes and their properties in your user pool. The attribute schema contains standard attributes, custom attributes with a custom: prefix, and developer attributes with a dev: prefix. For more information, see User pool attributes.

          Developer-only dev: attributes are a legacy feature of user pools, and are read-only to all app clients. You can create and update developer-only attributes only with IAM-authenticated API operations. Use app client read/write permissions instead.

          • Name (string) --

            The name of your user pool attribute. When you create or update a user pool, adding a schema attribute creates a custom or developer-only attribute. When you add an attribute with a Name value of MyAttribute, Amazon Cognito creates the custom attribute custom:MyAttribute. When DeveloperOnlyAttribute is true, Amazon Cognito creates your attribute as dev:MyAttribute. In an operation that describes a user pool, Amazon Cognito returns this value as value for standard attributes, custom:value for custom attributes, and dev:value for developer-only attributes..

          • AttributeDataType (string) --

            The data format of the values for your attribute. When you choose an AttributeDataType, Amazon Cognito validates the input against the data type. A custom attribute value in your user's ID token is always a string, for example "custom:isMember" : "true" or "custom:YearsAsMember" : "12".

          • DeveloperOnlyAttribute (boolean) --

            Specifies whether the attribute type is developer only. This attribute can only be modified by an administrator. Users won't be able to modify this attribute using their access token. For example, DeveloperOnlyAttribute can be modified using AdminUpdateUserAttributes but can't be updated using UpdateUserAttributes.

          • Mutable (boolean) --

            Specifies whether the value of the attribute can be changed.

            Any user pool attribute whose value you map from an IdP attribute must be mutable, with a parameter value of true. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute. For more information, see Specifying Identity Provider Attribute Mappings for Your User Pool.

          • Required (boolean) --

            Specifies whether a user pool attribute is required. If the attribute is required and the user doesn't 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 length of a number attribute value. Must be a number less than or equal to 2^1023, represented as a string with a length of 131072 characters or fewer.

          • StringAttributeConstraints (dict) --

            Specifies the constraints for an attribute of the string type.

            • MinLength (string) --

              The minimum length of a string attribute value.

            • MaxLength (string) --

              The maximum length of a string attribute value. Must be a number less than or equal to 2^1023, represented as a string with a length of 131072 characters or fewer.

      • AutoVerifiedAttributes (list) --

        The attributes that are auto-verified in a user pool.

        • (string) --

      • AliasAttributes (list) --

        Attributes supported as an alias for this user pool. An alias is an attribute that users can enter as an alternative username. Possible values: phone_number, email, or preferred_username.

        • (string) --

      • UsernameAttributes (list) --

        Specifies whether a user can use an email address or phone number as a username when they sign up.

        • (string) --

      • SmsVerificationMessage (string) --

        This parameter is no longer used.

      • EmailVerificationMessage (string) --

        This parameter is no longer used.

      • EmailVerificationSubject (string) --

        This parameter is no longer used.

      • VerificationMessageTemplate (dict) --

        The template for the verification message that your user pool delivers to users who set an email address or phone number attribute.

        • SmsMessage (string) --

          The template for SMS messages that Amazon Cognito sends to your users.

        • EmailMessage (string) --

          The template for email messages that Amazon Cognito sends to your users. You can set an EmailMessage template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • EmailSubject (string) --

          The subject line for the email message template. You can set an EmailSubject template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • EmailMessageByLink (string) --

          The email message template for sending a confirmation link to the user. You can set an EmailMessageByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • EmailSubjectByLink (string) --

          The subject line for the email message template for sending a confirmation link to the user. You can set an EmailSubjectByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

        • DefaultEmailOption (string) --

          The configuration of verification emails to contain a clickable link or a verification code.

          For link, your template body must contain link text in the format {##Click here##}. "Click here" in the example is a customizable string. For code, your template body must contain a code placeholder in the format {####}.

      • SmsAuthenticationMessage (string) --

        The contents of the SMS authentication message.

      • UserAttributeUpdateSettings (dict) --

        The settings for updates to user attributes. These settings include the property AttributesRequireVerificationBeforeUpdate, a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers.

        • AttributesRequireVerificationBeforeUpdate (list) --

          Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value.

          When AttributesRequireVerificationBeforeUpdate is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where AttributesRequireVerificationBeforeUpdate is false, API operations that change attribute values can immediately update a user’s email or phone_number attribute.

          • (string) --

      • MfaConfiguration (string) --

        Can be one of the following values:

        • OFF - MFA tokens aren't required and can't be specified during user registration.

        • ON - MFA tokens are required for all user registrations. You can only specify required when you're initially creating a user pool.

        • OPTIONAL - Users have the option when registering to create an MFA token.

      • DeviceConfiguration (dict) --

        The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool.

        • ChallengeRequiredOnNewDevice (boolean) --

          When true, a remembered device can sign in with device authentication instead of SMS and time-based one-time password (TOTP) factors for multi-factor authentication (MFA).

        • DeviceOnlyRememberedOnUserPrompt (boolean) --

          When true, Amazon Cognito doesn't automatically remember a user's device when your app sends a ConfirmDevice API request. In your app, create a prompt for your user to choose whether they want to remember their device. Return the user's choice in an UpdateDeviceStatus API request.

          When DeviceOnlyRememberedOnUserPrompt is false, Amazon Cognito immediately remembers devices that you register in a ConfirmDevice API request.

      • EstimatedNumberOfUsers (integer) --

        A number estimating the size of the user pool.

      • EmailConfiguration (dict) --

        The email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Web Services Region, and sender for messages from your user pool.

        • SourceArn (string) --

          The ARN of a verified email address or an address from a verified domain in Amazon SES. You can set a SourceArn email from a verified domain only with an API request. You can set a verified email address, but not an address in a verified domain, in the Amazon Cognito console. Amazon Cognito uses the email address that you provide in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:

          • If you specify COGNITO_DEFAULT, Amazon Cognito uses this address as the custom FROM address when it emails your users using its built-in email account.

          • If you specify DEVELOPER, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.

          The Region value of the SourceArn parameter must indicate a supported Amazon Web Services Region of your user pool. Typically, the Region in the SourceArn and the user pool Region are the same. For more information, see Amazon SES email configuration regions in the Amazon Cognito Developer Guide.

        • ReplyToEmailAddress (string) --

          The destination to which the receiver of the email should reply.

        • EmailSendingAccount (string) --

          Specifies whether Amazon Cognito uses its built-in functionality to send your users email messages, or uses your Amazon Simple Email Service email configuration. Specify one of the following values:

          COGNITO_DEFAULT

          When Amazon Cognito emails your users, it uses its built-in email functionality. When you use the default option, Amazon Cognito allows only a limited number of emails each day for your user pool. For typical production environments, the default email limit is less than the required delivery volume. To achieve a higher delivery volume, specify DEVELOPER to use your Amazon SES email configuration.

          To look up the email delivery limit for the default option, see Limits in the Amazon Cognito Developer Guide.

          The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the Amazon Resource Name (ARN) of an Amazon SES verified email address for the SourceArn parameter.

          DEVELOPER

          When Amazon Cognito emails your users, it uses your Amazon SES configuration. Amazon Cognito calls Amazon SES on your behalf to send email from your verified email address. When you use this option, the email delivery limits are the same limits that apply to your Amazon SES verified email address in your Amazon Web Services account.

          If you use this option, provide the ARN of an Amazon SES verified email address for the SourceArn parameter.

          Before Amazon Cognito can email your users, it requires additional permissions to call Amazon SES on your behalf. When you update your user pool with this option, Amazon Cognito creates a service-linked role, which is a type of role in your Amazon Web Services account. This role contains the permissions that allow you to access Amazon SES and send email messages from your email address. For more information about the service-linked role that Amazon Cognito creates, see Using Service-Linked Roles for Amazon Cognito in the Amazon Cognito Developer Guide.

        • From (string) --

          Either the sender’s email address or the sender’s name with their email address. For example, testuser@example.com or Test User <testuser@example.com>. This address appears before the body of the email.

        • ConfigurationSet (string) --

          The set of configuration rules that can be applied to emails sent using Amazon Simple Email Service. A configuration set is applied to an email by including a reference to the configuration set in the headers of the email. Once applied, all of the rules in that configuration set are applied to the email. Configuration sets can be used to apply the following types of rules to emails:

          Event publishing

          Amazon Simple Email Service can track the number of send, delivery, open, click, bounce, and complaint events for each email sent. Use event publishing to send information about these events to other Amazon Web Services services such as and Amazon CloudWatch

          IP pool management

          When leasing dedicated IP addresses with Amazon Simple Email Service, you can create groups of IP addresses, called dedicated IP pools. You can then associate the dedicated IP pools with configuration sets.

      • SmsConfiguration (dict) --

        User pool configuration for delivery of SMS messages with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account.

        • SnsCallerArn (string) --

          The Amazon Resource Name (ARN) of the Amazon SNS caller. This is the ARN of the IAM role in your Amazon Web Services account that Amazon Cognito will use to send SMS messages. SMS messages are subject to a spending limit.

        • ExternalId (string) --

          The external ID provides additional security for your IAM role. You can use an ExternalId with the IAM role that you use with Amazon SNS to send SMS messages for your user pool. If you provide an ExternalId, your Amazon Cognito user pool includes it in the request to assume your IAM role. You can configure the role trust policy to require that Amazon Cognito, and any principal, provide the ExternalID. If you use the Amazon Cognito Management Console to create a role for SMS multi-factor authentication (MFA), Amazon Cognito creates a role with the required permissions and a trust policy that demonstrates use of the ExternalId.

          For more information about the ExternalId of a role, see How to use an external ID when granting access to your Amazon Web Services resources to a third party.

        • SnsRegion (string) --

          The Amazon Web Services Region to use with Amazon SNS integration. You can choose the same Region as your user pool, or a supported Legacy Amazon SNS alternate Region.

          Amazon Cognito resources in the Asia Pacific (Seoul) Amazon Web Services Region must use your Amazon SNS configuration in the Asia Pacific (Tokyo) Region. For more information, see SMS message settings for Amazon Cognito user pools.

        • EumsSms (dict) --

          The configuration for sending SMS messages through Amazon Web Services End User Messaging SMS, as an alternative to Amazon SNS. In a user pool, provide either the Amazon SNS configuration ( SnsCallerArn) or this configuration, but not both. In Amazon Web Services Regions where Amazon SNS is not available, this configuration is required.

          • CallerArn (string) --

            The ARN of the IAM role that Amazon Cognito assumes to send SMS messages through Amazon Web Services End User Messaging SMS. The role must grant permission to call the sms-voice:SendTextMessage operation.

          • ExternalId (string) --

            The external ID that Amazon Cognito includes when it assumes the CallerArn role. Use this value as a condition in the role trust policy to prevent the confused deputy problem.

          • OriginationIdentity (string) --

            The origination identity that Amazon Web Services End User Messaging SMS uses to send messages to your users. This value can be one of the following:

            • A phone number – A long code, toll-free number, or short code that is assigned to your account.

            • A sender ID – An alphabetic name that identifies the message sender in supported countries.

            • A phone pool – A group of phone numbers that Amazon Web Services End User Messaging SMS selects from when it sends messages.

            You can provide an E.164 phone number or the ARN of the phone number, sender ID, or phone pool. Amazon Web Services End User Messaging SMS evaluates IAM authorization with the value that you provide. If the permissions policy of your CallerArn role scopes the sms-voice:SendTextMessage resource to a specific ARN, provide that same ARN. If the formats do not match, requests fail with an InvalidSmsRoleAccessPolicyException.

            Depending on the destination country, you must provide an origination identity. For country-specific requirements, see Supported countries and regions for SMS messaging in the Amazon Web Services End User Messaging SMS User Guide.

          • ConfigurationSetName (string) --

            The name of the Amazon Web Services End User Messaging SMS configuration set that Amazon Cognito applies to messages, for logging and event destinations. If you omit this member, Amazon Cognito sends messages without applying a configuration set.

          • InEntityId (string) --

            The principal entity ID required by India's Distributed Ledger Technology (DLT) regulations for SMS messages.

          • InTemplateId (string) --

            The registered template ID for the message template required by India's DLT regulations for SMS messages.

          • Region (string) --

            The Amazon Web Services Region of the Amazon Web Services End User Messaging SMS resources that Amazon Cognito uses to send messages. Amazon Web Services End User Messaging SMS must be available in your user pool's Region.

            If you omit this parameter, Amazon Cognito uses the same Region as your user pool. You can also set this parameter to your user pool's Region explicitly. Amazon Cognito rejects any other value with an InvalidParameterException.

      • UserPoolTags (dict) --

        The tags that are assigned to the user pool. A tag is a label that you can apply to user pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

        • (string) --

          • (string) --

      • SmsConfigurationFailure (string) --

        The reason why the SMS configuration can't send the messages to your users.

        This message might include comma-separated values to describe why your SMS configuration can't send messages to user pool end users.

        InvalidSmsRoleAccessPolicyException

        The Identity and Access Management role that Amazon Cognito uses to send SMS messages isn't properly configured. For more information, see SmsConfigurationType.

        SNSSandbox

        The Amazon Web Services account is in the SNS SMS Sandbox and messages will only reach verified end users. This parameter won’t get populated with SNSSandbox if the user creating the user pool doesn’t have SNS permissions. To learn how to move your Amazon Web Services account out of the sandbox, see Moving out of the SMS sandbox.

      • EmailConfigurationFailure (string) --

        Deprecated. Review error codes from API requests with EventSource:cognito-idp.amazonaws.com in CloudTrail for information about problems with user pool email configuration.

      • Domain (string) --

        The domain prefix, if the user pool has a domain associated with it.

      • CustomDomain (string) --

        A custom domain name that you provide to Amazon Cognito. This parameter applies only if you use a custom domain to host the sign-up and sign-in pages for your application. An example of a custom domain name might be auth.example.com.

        For more information about adding a custom domain to your user pool, see Using Your Own Domain for the Hosted UI.

      • AdminCreateUserConfig (dict) --

        The configuration for AdminCreateUser requests.

        • AllowAdminCreateUserOnly (boolean) --

          The setting for allowing self-service sign-up. When true, only administrators can create new user profiles. When false, users can register themselves and create a new user profile with the SignUp operation.

        • UnusedAccountValidityDays (integer) --

          This parameter is no longer in use.

          The password expiration limit in days for administrator-created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call AdminCreateUser again, specifying RESEND for the MessageAction parameter.

          The default value for this parameter is 7.

        • InviteMessageTemplate (dict) --

          The template for the welcome message to new users. This template must include the {####} temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder.

          See also Customizing User Invitation Messages.

          • SMSMessage (string) --

            The message template for SMS messages.

          • EmailMessage (string) --

            The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER.

          • EmailSubject (string) --

            The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER.

      • UserPoolAddOns (dict) --

        Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to AUDIT. To configure automatic security responses to potentially unwanted traffic to your user pool, set to ENFORCED.

        For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier.

        • AdvancedSecurityMode (string) --

          The operating mode of threat protection for standard authentication types in your user pool, including username-password and secure remote password (SRP) authentication.

        • AdvancedSecurityAdditionalFlows (dict) --

          Threat protection configuration options for additional authentication types in your user pool, including custom authentication.

      • DcrConfiguration (dict) --

        The dynamic client registration configuration for the user pool. With dynamic client registration, applications can register their own app clients at runtime through the registration endpoint of your user pool domain. To activate this setting, your user pool must be in the Essentials tier or higher.

        • EnableStatus (string) --

          Specifies whether dynamic client registration is turned on for the user pool. If you provide a dynamic client registration configuration without this value, Amazon Cognito turns dynamic client registration on.

        • OpenDcrEnabled (boolean) --

          Specifies whether open registration is turned on. When open registration is on, applications can register app clients without an initial access token. The default value is false.

        • AuthenticatedGrantTypes (list) --

          The OAuth grant types that an app client created through authenticated registration can request. If you don't set this value, authenticated registration permits the code and client_credentials grant types. If you set an empty list, Amazon Cognito rejects authenticated registration requests. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

          code

          Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

          client_credentials

          Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

          • (string) --

        • OpenDcrGrantTypes (list) --

          The OAuth grant types that an app client created through open registration can request. If you don't set this value, open registration permits only the code grant type. If you set an empty list, Amazon Cognito rejects open registration requests. If you add client_credentials, anyone can register an app client that requests machine-to-machine (M2M) access tokens, and you pay for the M2M token requests that those app clients make. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

          code

          Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

          client_credentials

          Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

          • (string) --

        • AllowedScopes (list) --

          The scopes that an app client created through dynamic client registration can request, in addition to the standard OpenID Connect (OIDC) scopes. You can include custom scopes from your resource servers and aws.cognito.signin.user.admin. Registered app clients can request the OIDC scopes openid, email, phone, and profile without listing them here. If you don't set this value, registered app clients can request only the OIDC scopes. A registered app client can't request the aws.cognito/dcr/register scope, even if you include it in this list.

          • (string) --

      • UsernameConfiguration (dict) --

        Case sensitivity of the username input for the selected sign-in option. When case sensitivity is set to False (case insensitive), users can sign in with any combination of capital and lowercase letters. For example, username, USERNAME, or UserName, or for email, email@example.com or EMaiL@eXamplE.Com. For most use cases, set case sensitivity to False (case insensitive) as a best practice. When usernames and email addresses are case insensitive, Amazon Cognito treats any variation in case as the same user, and prevents a case variation from being assigned to the same attribute for a different user.

        • CaseSensitive (boolean) --

          Specifies whether user name case sensitivity will be applied for all users in the user pool through Amazon Cognito APIs. For most use cases, set case sensitivity to False (case insensitive) as a best practice. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name.

          Valid values include:

          true

          Enables case sensitivity for all username input. When this option is set to true, users must sign in using the exact capitalization of their given username, such as “UserName”. This is the default value.

          false

          Enables case insensitivity for all username input. For example, when this option is set to false, users can sign in using username, USERNAME, or UserName. This option also enables both preferred_username and email alias to be case insensitive, in addition to the username attribute.

      • Arn (string) --

        The Amazon Resource Name (ARN) of the user pool.

      • AccountRecoverySetting (dict) --

        The available verified method a user can use to recover their password when they call ForgotPassword. You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email.

        • RecoveryMechanisms (list) --

          The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators.

          • (dict) --

            A recovery option for a user. The AccountRecoverySettingType data type is an array of this object. Each RecoveryOptionType has a priority property that determines whether it is a primary or secondary option.

            For example, if verified_email has a priority of 1 and verified_phone_number has a priority of 2, your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The admin_only option prevents self-service account recovery.

            • Priority (integer) --

              Your priority preference for using the specified attribute in account recovery. The highest priority is 1.

            • Name (string) --

              The recovery method that this object sets a recovery option for.

      • UserPoolTier (string) --

        The user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to ESSENTIALS.

      • KeyConfiguration (dict) --

        The key configuration for the user pool, including encryption settings.

        • KeyType (string) --

          The type of encryption key used for the user pool.

          AWS_OWNED_KEY

          A key owned by Amazon Web Services in Key Management Service.

          CUSTOMER_MANAGED_KEY

          A key managed by the customer in Key Management Service. You must use a multi-region key to enable multi-region replication for a user pool.

        • KmsKeyArn (string) --

          The Amazon Resource Name (ARN) of the KMS key used for encryption. If not specified, Amazon Web Services managed keys are used.

      • IssuerConfiguration (dict) --

        The issuer configuration for the user pool, including token issuing settings.

        • Type (string) --

          The type of issuer configuration. Determines the token issuing behavior for the user pool.

          ORIGINAL

          The original issuer configuration for user pools. The issuer URL is hosted in the user pool’s region and provides OIDC endpoints specific to that region.

          Original issuers have the format of https://cognito-idp.[region].amazonaws.com/[userPoolId]

          UPDATED

          Recommended for all user pools, including for multi-Region replication. Updated issuers host the same JWKS content in multiple regions, resulting in improved resilience and efficiency.

          Updated issuers have the format of https://issuer-cognito-idp.[region].amazonaws.com/[userPoolId], where region is the primary Amazon Web Services Region of your user pool.

      • AcrConfiguration (dict) --

        The names of the authentication context class reference (ACR) levels for the user pool. Amazon Cognito always returns the effective configuration, with default names merged in for any level that you haven't customized.

        Configuring custom ACR level names requires the Essentials or Plus feature plan. To activate this setting, your user pool must be in the Essentials tier or higher.

        • (string) --

          • (dict) --

            The configuration for a single authentication context class reference (ACR) level in a user pool. Each entry in an AcrConfiguration map associates a level ( Level1 through Level4) with this configuration, which provides the custom name that Amazon Cognito reports for that level in the acr token claim.

            • AcrValue (string) --

              The custom name for this authentication context class reference (ACR) level. This value is the URI that Amazon Cognito reports in the acr token claim when a user meets this level. The name must be unique across all levels in the user pool, including default names.

DescribeUserPoolClient (updated) Link ¶
Changes (response)
{'UserPoolClient': {'ClientType': 'REGULAR | DCR'}}

Given an app client ID, returns configuration information. This operation is useful when you want to inspect an existing app client and programmatically replicate the configuration to another app client. For more information about app clients, see App clients.

See also: AWS API Documentation

Request Syntax

client.describe_user_pool_client(
    UserPoolId='string',
    ClientId='string'
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the app client you want to describe.

type ClientId:

string

param ClientId:

[REQUIRED]

The ID of the app client that you want to describe.

rtype:

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,
        'AccessTokenValidity': 123,
        'IdTokenValidity': 123,
        'TokenValidityUnits': {
            'AccessToken': 'seconds'|'minutes'|'hours'|'days',
            'IdToken': 'seconds'|'minutes'|'hours'|'days',
            'RefreshToken': 'seconds'|'minutes'|'hours'|'days'
        },
        'ReadAttributes': [
            'string',
        ],
        'WriteAttributes': [
            'string',
        ],
        'ExplicitAuthFlows': [
            'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH',
        ],
        'SupportedIdentityProviders': [
            'string',
        ],
        'CallbackURLs': [
            'string',
        ],
        'LogoutURLs': [
            'string',
        ],
        'DefaultRedirectURI': 'string',
        'AllowedOAuthFlows': [
            'code'|'implicit'|'client_credentials',
        ],
        'AllowedOAuthScopes': [
            'string',
        ],
        'AllowedOAuthFlowsUserPoolClient': True|False,
        'AnalyticsConfiguration': {
            'ApplicationId': 'string',
            'ApplicationArn': 'string',
            'RoleArn': 'string',
            'ExternalId': 'string',
            'UserDataShared': True|False
        },
        'PreventUserExistenceErrors': 'LEGACY'|'ENABLED',
        'EnableTokenRevocation': True|False,
        'EnablePropagateAdditionalUserContextData': True|False,
        'AuthSessionValidity': 123,
        'RefreshTokenRotation': {
            'Feature': 'ENABLED'|'DISABLED',
            'RetryGracePeriodSeconds': 123
        },
        'ClientType': 'REGULAR'|'DCR'
    }
}

Response Structure

  • (dict) --

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

    • UserPoolClient (dict) --

      The details of the request app client.

      • UserPoolId (string) --

        The ID of the user pool associated with the app client.

      • ClientName (string) --

        The name of the app client.

      • ClientId (string) --

        The ID of the app client.

      • ClientSecret (string) --

        The app client secret.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • RefreshTokenValidity (integer) --

        The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for RefreshTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set RefreshTokenValidity as 10 and TokenValidityUnits as days, your user can refresh their session and retrieve new access and ID tokens for 10 days.

        The default time unit for RefreshTokenValidity in an API request is days. You can't set RefreshTokenValidity to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days.

      • AccessTokenValidity (integer) --

        The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for AccessTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set AccessTokenValidity to 10 and TokenValidityUnits to hours, your user can authorize access with their access token for 10 hours.

        The default time unit for AccessTokenValidity in an API request is hours. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour.

      • IdTokenValidity (integer) --

        The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for IdTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set IdTokenValidity as 10 and TokenValidityUnits as hours, your user can authenticate their session with their ID token for 10 hours.

        The default time unit for IdTokenValidity in an API request is hours. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour.

      • TokenValidityUnits (dict) --

        The time units that, with IdTokenValidity, AccessTokenValidity, and RefreshTokenValidity, set and display the duration of ID, access, and refresh tokens for an app client. You can assign a separate token validity unit to each type of token.

        • AccessToken (string) --

          A time unit for the value that you set in the AccessTokenValidity parameter. The default AccessTokenValidity time unit is hours. AccessTokenValidity duration can range from five minutes to one day.

        • IdToken (string) --

          A time unit for the value that you set in the IdTokenValidity parameter. The default IdTokenValidity time unit is hours. IdTokenValidity duration can range from five minutes to one day.

        • RefreshToken (string) --

          A time unit for the value that you set in the RefreshTokenValidity parameter. The default RefreshTokenValidity time unit is days. RefreshTokenValidity duration can range from 60 minutes to 10 years.

      • ReadAttributes (list) --

        The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list.

        When you don't specify the ReadAttributes for your app client, your app can read the values of email_verified, phone_number_verified, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, ReadAttributes doesn't return any information. Amazon Cognito only populates ReadAttributes in the API response if you have specified your own custom set of read attributes.

        • (string) --

      • WriteAttributes (list) --

        The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list.

        When you don't specify the WriteAttributes for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, WriteAttributes doesn't return any information. Amazon Cognito only populates WriteAttributes in the API response if you have specified your own custom set of write attributes.

        If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool.

        • (string) --

      • ExplicitAuthFlows (list) --

        The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.

        The values for authentication flow options include the following.

        • ALLOW_USER_AUTH: Enable selection-based sign-in with USER_AUTH. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without other ExplicitAuthFlows permitting them. For example users can complete an SRP challenge through USER_AUTH without the flow USER_SRP_AUTH being active for the app client. This flow doesn't include CUSTOM_AUTH. To activate this setting, your user pool must be in the Essentials tier or higher.

        • ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password.

        • ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication.

        • ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords.

        • ALLOW_USER_SRP_AUTH: Enable SRP-based authentication.

        • ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens.

        In some environments, you will see the values ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, or USER_PASSWORD_AUTH. You can't assign these legacy ExplicitAuthFlows values to user pool clients at the same time as values that begin with ALLOW_, like ALLOW_USER_SRP_AUTH.

        • (string) --

      • SupportedIdentityProviders (list) --

        A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: COGNITO, Facebook, Google, SignInWithApple, and LoginWithAmazon. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example MySAMLIdP or MyOIDCIdP.

        This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of COGNITO from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule.

        • (string) --

      • CallbackURLs (list) --

        A list of allowed redirect (callback) URLs for the IdPs.

        A redirect URI must:

        • Be an absolute URI.

        • Be registered with the authorization server.

        • Not include a fragment component.

        See OAuth 2.0 - Redirection Endpoint.

        Amazon Cognito requires HTTPS over HTTP for callback URLs to http://localhost, http://127.0.0.1 and http://[::1]. These callback URLs are for testing purposes only. You can specify custom TCP ports for your callback URLs.

        App callback URLs such as myapp://example are also supported.

        • (string) --

      • LogoutURLs (list) --

        A list of allowed logout URLs for the IdPs.

        • (string) --

      • DefaultRedirectURI (string) --

        The default redirect URI. Must be in the CallbackURLs list.

        A redirect URI must:

        • Be an absolute URI.

        • Be registered with the authorization server.

        • Not include a fragment component.

        See OAuth 2.0 - Redirection Endpoint.

        Amazon Cognito requires HTTPS over HTTP for callback URLs to http://localhost, http://127.0.0.1 and http://[::1]. These callback URLs are for testing purposes only. You can specify custom TCP ports for your callback URLs.

        App callback URLs such as myapp://example are also supported.

      • AllowedOAuthFlows (list) --

        The OAuth grant types that you want your app client to generate. To create an app client that generates client credentials grants, you must add client_credentials as the only allowed OAuth flow.

        code

        Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

        implicit

        Issue the access token (and, optionally, ID token, based on scopes) directly to your user.

        client_credentials

        Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

        • (string) --

      • AllowedOAuthScopes (list) --

        The OAuth 2.0 scopes that you want your app client to support. Can include standard OAuth scopes like phone, email, openid, and profile. Can also include the aws.cognito.signin.user.admin scope that authorizes user profile self-service operations and custom scopes from resource servers.

        • (string) --

      • AllowedOAuthFlowsUserPoolClient (boolean) --

        Set to true to use OAuth 2.0 authorization server features in your app client.

        This parameter must have a value of true before you can configure the following features in your app client.

        • CallBackURLs: Callback URLs.

        • LogoutURLs: Sign-out redirect URLs.

        • AllowedOAuthScopes: OAuth 2.0 scopes.

        • AllowedOAuthFlows: Support for authorization code, implicit, and client credentials OAuth 2.0 grants.

        To use authorization server features, configure one of these features in the Amazon Cognito console or set AllowedOAuthFlowsUserPoolClient to true in a CreateUserPoolClient or UpdateUserPoolClient API request. If you don't set a value for AllowedOAuthFlowsUserPoolClient in a request with the CLI or SDKs, it defaults to false. When false, only SDK-based API sign-in is permitted.

      • AnalyticsConfiguration (dict) --

        The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.

        • ApplicationId (string) --

          Your Amazon Pinpoint project ID.

        • ApplicationArn (string) --

          The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that ApplicationArn declares. You can also configure your application to pass an endpoint ID in the AnalyticsMetadata parameter of sign-in operations. The endpoint ID is information about the destination for push notifications

        • RoleArn (string) --

          The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics.

        • ExternalId (string) --

          The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint.

        • UserDataShared (boolean) --

          If UserDataShared is true, Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics.

      • PreventUserExistenceErrors (string) --

        When ENABLED, suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to ENABLED and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs return a UserNotFoundException exception if the user doesn't exist in the user pool.

        Defaults to LEGACY.

      • EnableTokenRevocation (boolean) --

        Indicates whether token revocation is activated for the user pool client. When you create a new user pool client, token revocation is activated by default.

      • EnablePropagateAdditionalUserContextData (boolean) --

        When EnablePropagateAdditionalUserContextData is true, Amazon Cognito accepts an IpAddress value that you send in the UserContextData parameter. The UserContextData parameter sends information to Amazon Cognito threat protection for risk analysis. You can send UserContextData when you sign in Amazon Cognito native users with the InitiateAuth and RespondToAuthChallenge API operations.

        When EnablePropagateAdditionalUserContextData is false, you can't send your user's source IP address to Amazon Cognito threat protection with unauthenticated API operations. EnablePropagateAdditionalUserContextData doesn't affect whether you can send a source IP address in a ContextData parameter with the authenticated API operations AdminInitiateAuth and AdminRespondToAuthChallenge.

        You can only activate EnablePropagateAdditionalUserContextData in an app client that has a client secret. For more information about propagation of user context data, see Adding user device and session data to API requests.

      • AuthSessionValidity (integer) --

        Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires.

      • RefreshTokenRotation (dict) --

        The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens.

        • Feature (string) --

          The state of refresh token rotation for the current app client.

        • RetryGracePeriodSeconds (integer) --

          When you request a token refresh with GetTokensFromRefreshToken, the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When RetryGracePeriodSeconds is 0, the grace period is disabled and a successful request immediately invalidates the submitted refresh token.

      • ClientType (string) --

        How the app client was created.

        REGULAR

        The app client wasn't created through dynamic client registration. For example, you created it with CreateUserPoolClient.

        DCR

        An application registered the app client through dynamic client registration. These app clients don't support client secret operations such as AddUserPoolClientSecret, and they can't hold the aws.cognito/dcr/register scope.

ListResourceServers (updated) Link ¶
Changes (response)
{'ResourceServers': {'ManagedBy': 'COGNITO'}}

Given a user pool ID, returns all resource servers and their details. For more information about resource servers, see Access control with resource servers.

See also: AWS API Documentation

Request Syntax

client.list_resource_servers(
    UserPoolId='string',
    MaxResults=123,
    NextToken='string'
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool where you want to list resource servers.

type MaxResults:

integer

param MaxResults:

The maximum number of resource servers that you want Amazon Cognito to return in the response.

type NextToken:

string

param NextToken:

This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.

rtype:

dict

returns:

Response Syntax

{
    'ResourceServers': [
        {
            'UserPoolId': 'string',
            'Identifier': 'string',
            'Name': 'string',
            'Scopes': [
                {
                    'ScopeName': 'string',
                    'ScopeDescription': 'string'
                },
            ],
            'ManagedBy': 'COGNITO'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • ResourceServers (list) --

      An array of resource servers and the details of their configuration. For each, the response includes names, identifiers, and custom scopes.

      • (dict) --

        The details of a resource server configuration and associated custom scopes in a user pool.

        • UserPoolId (string) --

          The ID of the user pool that contains the resource server configuration.

        • Identifier (string) --

          A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

          Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

        • Name (string) --

          The name of the resource server.

        • Scopes (list) --

          A list of scopes that are defined for the resource server.

          • (dict) --

            One custom scope associated with a user pool resource server. This data type is a member of ResourceServerScopeType. For more information, see Scopes, M2M, and API authorization with resource servers.

            • ScopeName (string) --

              The name of the scope. Amazon Cognito renders custom scopes in the format resourceServerIdentifier/ScopeName. For example, if this parameter is exampleScope in the resource server with the identifier exampleResourceServer, you request and receive the scope exampleResourceServer/exampleScope.

            • ScopeDescription (string) --

              A friendly description of a custom scope.

        • ManagedBy (string) --

          This value is reserved for resource servers that Amazon Cognito manages. Resource servers that you create don't have this value.

    • NextToken (string) --

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

ListUserPoolClients (updated) Link ¶
Changes (request)
{'ClientType': 'REGULAR | DCR'}

Given a user pool ID, lists app clients. App clients are sets of rules for the access that you want a user pool to grant to one application. For more information, see App clients.

See also: AWS API Documentation

Request Syntax

client.list_user_pool_clients(
    UserPoolId='string',
    MaxResults=123,
    NextToken='string',
    ClientType='REGULAR'|'DCR'
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

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

type MaxResults:

integer

param MaxResults:

The maximum number of app clients that you want Amazon Cognito to return in the response.

type NextToken:

string

param NextToken:

This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items.

type ClientType:

string

param ClientType:

Returns only app clients of this type. For dynamic client registration ( DCR) and other app clients, the following values are valid.

REGULAR

An app client not created through dynamic client registration.

DCR

An app client created through dynamic client registration.

If you omit ClientType, the response includes app clients of all types. When you set this filter, a page of results can contain fewer app clients than MaxResults, or none, while the response still includes a NextToken. Continue to request pages until the response has no NextToken. The app clients in the response don't include their type. To get the type of an app client, call DescribeUserPoolClient.

rtype:

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) --

      An array of app clients and their details. Includes app client ID and name.

      • (dict) --

        A short description of a user pool app client.

        • ClientId (string) --

          The app client ID.

        • UserPoolId (string) --

          The ID of the user pool that's associated with the app client.

        • ClientName (string) --

          The app client name.

    • NextToken (string) --

      The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items.

UpdateResourceServer (updated) Link ¶
Changes (response)
{'ResourceServer': {'ManagedBy': 'COGNITO'}}

Updates the name and scopes of a resource server. All other fields are read-only. For more information about resource servers, see Access control with resource servers.

See also: AWS API Documentation

Request Syntax

client.update_resource_server(
    UserPoolId='string',
    Identifier='string',
    Name='string',
    Scopes=[
        {
            'ScopeName': 'string',
            'ScopeDescription': 'string'
        },
    ]
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the resource server that you want to update.

type Identifier:

string

param Identifier:

[REQUIRED]

A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

type Name:

string

param Name:

[REQUIRED]

The updated name of the resource server.

type Scopes:

list

param Scopes:

An array of updated custom scope names and descriptions that you want to associate with your resource server.

  • (dict) --

    One custom scope associated with a user pool resource server. This data type is a member of ResourceServerScopeType. For more information, see Scopes, M2M, and API authorization with resource servers.

    • ScopeName (string) -- [REQUIRED]

      The name of the scope. Amazon Cognito renders custom scopes in the format resourceServerIdentifier/ScopeName. For example, if this parameter is exampleScope in the resource server with the identifier exampleResourceServer, you request and receive the scope exampleResourceServer/exampleScope.

    • ScopeDescription (string) -- [REQUIRED]

      A friendly description of a custom scope.

rtype:

dict

returns:

Response Syntax

{
    'ResourceServer': {
        'UserPoolId': 'string',
        'Identifier': 'string',
        'Name': 'string',
        'Scopes': [
            {
                'ScopeName': 'string',
                'ScopeDescription': 'string'
            },
        ],
        'ManagedBy': 'COGNITO'
    }
}

Response Structure

  • (dict) --

    • ResourceServer (dict) --

      The updated details of the requested resource server.

      • UserPoolId (string) --

        The ID of the user pool that contains the resource server configuration.

      • Identifier (string) --

        A unique resource server identifier for the resource server. The identifier can be an API friendly name like solar-system-data. You can also set an API URL like https://solar-system-data-api.example.com as your identifier.

        Amazon Cognito represents scopes in the access token in the format $resource-server-identifier/$scope. Longer scope-identifier strings increase the size of your access tokens.

      • Name (string) --

        The name of the resource server.

      • Scopes (list) --

        A list of scopes that are defined for the resource server.

        • (dict) --

          One custom scope associated with a user pool resource server. This data type is a member of ResourceServerScopeType. For more information, see Scopes, M2M, and API authorization with resource servers.

          • ScopeName (string) --

            The name of the scope. Amazon Cognito renders custom scopes in the format resourceServerIdentifier/ScopeName. For example, if this parameter is exampleScope in the resource server with the identifier exampleResourceServer, you request and receive the scope exampleResourceServer/exampleScope.

          • ScopeDescription (string) --

            A friendly description of a custom scope.

      • ManagedBy (string) --

        This value is reserved for resource servers that Amazon Cognito manages. Resource servers that you create don't have this value.

UpdateUserPool (updated) Link ¶
Changes (request)
{'DcrConfiguration': {'AllowedScopes': ['string'],
                      'AuthenticatedGrantTypes': ['code | implicit | '
                                                  'client_credentials'],
                      'EnableStatus': 'Enabled | Disabled',
                      'OpenDcrEnabled': 'boolean',
                      'OpenDcrGrantTypes': ['code | implicit | '
                                            'client_credentials']}}

Updates the configuration of a user pool. To avoid setting parameters to Amazon Cognito defaults, construct this API request to pass the existing configuration of your user pool, modified to include the changes that you want to make.

In secondary regions for user pools with multi-region replication, regional configurations for email, SMS, Lambda functions, and tags can be updated. Both global and regional settings must be provided as inputs, with global settings required to match existing values to maintain consistency across replicas.

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,
            'PasswordHistorySize': 123,
            'TemporaryPasswordValidityDays': 123
        },
        'SignInPolicy': {
            'AllowedFirstAuthFactors': [
                'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN'|'SOFTWARE_TOKEN',
            ]
        }
    },
    DeletionProtection='ACTIVE'|'INACTIVE',
    LambdaConfig={
        'PreSignUp': 'string',
        'CustomMessage': 'string',
        'PostConfirmation': 'string',
        'PreAuthentication': 'string',
        'PostAuthentication': 'string',
        'DefineAuthChallenge': 'string',
        'CreateAuthChallenge': 'string',
        'VerifyAuthChallengeResponse': 'string',
        'PreTokenGeneration': 'string',
        'UserMigration': 'string',
        'PreTokenGenerationConfig': {
            'LambdaVersion': 'V1_0'|'V2_0'|'V3_0',
            'LambdaArn': 'string'
        },
        'CustomSMSSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'CustomEmailSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'KMSKeyID': 'string',
        'InboundFederation': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        }
    },
    AutoVerifiedAttributes=[
        'phone_number'|'email',
    ],
    SmsVerificationMessage='string',
    EmailVerificationMessage='string',
    EmailVerificationSubject='string',
    VerificationMessageTemplate={
        'SmsMessage': 'string',
        'EmailMessage': 'string',
        'EmailSubject': 'string',
        'EmailMessageByLink': 'string',
        'EmailSubjectByLink': 'string',
        'DefaultEmailOption': 'CONFIRM_WITH_LINK'|'CONFIRM_WITH_CODE'
    },
    SmsAuthenticationMessage='string',
    UserAttributeUpdateSettings={
        'AttributesRequireVerificationBeforeUpdate': [
            'phone_number'|'email',
        ]
    },
    MfaConfiguration='OFF'|'ON'|'OPTIONAL',
    DeviceConfiguration={
        'ChallengeRequiredOnNewDevice': True|False,
        'DeviceOnlyRememberedOnUserPrompt': True|False
    },
    EmailConfiguration={
        'SourceArn': 'string',
        'ReplyToEmailAddress': 'string',
        'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER',
        'From': 'string',
        'ConfigurationSet': 'string'
    },
    SmsConfiguration={
        'SnsCallerArn': 'string',
        'ExternalId': 'string',
        'SnsRegion': 'string',
        'EumsSms': {
            'CallerArn': 'string',
            'ExternalId': 'string',
            'OriginationIdentity': 'string',
            'ConfigurationSetName': 'string',
            'InEntityId': 'string',
            'InTemplateId': 'string',
            'Region': 'string'
        }
    },
    UserPoolTags={
        'string': 'string'
    },
    AdminCreateUserConfig={
        'AllowAdminCreateUserOnly': True|False,
        'UnusedAccountValidityDays': 123,
        'InviteMessageTemplate': {
            'SMSMessage': 'string',
            'EmailMessage': 'string',
            'EmailSubject': 'string'
        }
    },
    UserPoolAddOns={
        'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED',
        'AdvancedSecurityAdditionalFlows': {
            'CustomAuthMode': 'AUDIT'|'ENFORCED'
        }
    },
    DcrConfiguration={
        'EnableStatus': 'Enabled'|'Disabled',
        'OpenDcrEnabled': True|False,
        'AuthenticatedGrantTypes': [
            'code'|'implicit'|'client_credentials',
        ],
        'OpenDcrGrantTypes': [
            'code'|'implicit'|'client_credentials',
        ],
        'AllowedScopes': [
            'string',
        ]
    },
    AccountRecoverySetting={
        'RecoveryMechanisms': [
            {
                'Priority': 123,
                'Name': 'verified_email'|'verified_phone_number'|'admin_only'
            },
        ]
    },
    PoolName='string',
    UserPoolTier='LITE'|'ESSENTIALS'|'PLUS',
    KeyConfiguration={
        'KeyType': 'AWS_OWNED_KEY'|'CUSTOMER_MANAGED_KEY',
        'KmsKeyArn': 'string'
    },
    IssuerConfiguration={
        'Type': 'ORIGINAL'|'UPDATED'
    },
    AcrConfiguration={
        'string': {
            'AcrValue': 'string'
        }
    }
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool you want to update.

type Policies:

dict

param Policies:

The password policy and sign-in policy in the user pool. The password policy sets options like password complexity requirements and password history. The sign-in policy sets the options available to applications in choice-based authentication.

  • PasswordPolicy (dict) --

    The password policy settings for a user pool, including complexity, history, and length requirements.

    • MinimumLength (integer) --

      The minimum length of the password in the policy that you have set. This value can't be less than 6.

    • RequireUppercase (boolean) --

      The requirement in a password policy that users must include at least one uppercase letter in their password.

    • RequireLowercase (boolean) --

      The requirement in a password policy that users must include at least one lowercase letter in their password.

    • RequireNumbers (boolean) --

      The requirement in a password policy that users must include at least one number in their password.

    • RequireSymbols (boolean) --

      The requirement in a password policy that users must include at least one symbol in their password.

    • PasswordHistorySize (integer) --

      The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of n previous passwords, where n is the value of PasswordHistorySize.

    • TemporaryPasswordValidityDays (integer) --

      The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to 7. If you submit a value of 0, Amazon Cognito treats it as a null value and sets TemporaryPasswordValidityDays to its default value.

  • SignInPolicy (dict) --

    The policy for allowed types of authentication in a user pool.

    • AllowedFirstAuthFactors (list) --

      The sign-in methods that a user pool supports as the first factor. You can permit users to start authentication with a standard username and password, or with other one-time password and hardware factors.

      • (string) --

type DeletionProtection:

string

param DeletionProtection:

When active, DeletionProtection prevents accidental deletion of your user pool. Before you can delete a user pool that you have protected against deletion, you must deactivate this feature.

When you try to delete a protected user pool in a DeleteUserPool API request, Amazon Cognito returns an InvalidParameterException error. To delete a protected user pool, send a new DeleteUserPool request after you deactivate deletion protection in an UpdateUserPool API request.

type LambdaConfig:

dict

param LambdaConfig:

A collection of user pool Lambda triggers. Amazon Cognito invokes triggers at several possible stages of authentication operations. Triggers can modify the outcome of the operations that invoked them.

  • PreSignUp (string) --

    The configuration of a pre sign-up Lambda trigger in a user pool. This trigger evaluates new users and can bypass confirmation, link a federated user profile, or block sign-up requests.

  • CustomMessage (string) --

    A custom message Lambda trigger. This trigger is an opportunity to customize all SMS and email messages from your user pool. When a custom message trigger is active, your user pool routes all messages to a Lambda function that returns a runtime-customized message subject and body for your user pool to deliver to a user.

  • PostConfirmation (string) --

    The configuration of a post confirmation Lambda trigger in a user pool. This trigger can take custom actions after a user confirms their user account and their email address or phone number.

  • PreAuthentication (string) --

    The configuration of a pre authentication trigger in a user pool. This trigger can evaluate and modify user sign-in events.

  • PostAuthentication (string) --

    The configuration of a post authentication Lambda trigger in a user pool. This trigger can take custom actions after a user signs in.

  • DefineAuthChallenge (string) --

    The configuration of a define auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

  • CreateAuthChallenge (string) --

    The configuration of a create auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

  • VerifyAuthChallengeResponse (string) --

    The configuration of a verify auth challenge Lambda trigger, one of three triggers in the sequence of the custom authentication challenge triggers.

  • PreTokenGeneration (string) --

    The legacy configuration of a pre token generation Lambda trigger in a user pool.

    Set this parameter for legacy purposes. If you also set an ARN in PreTokenGenerationConfig, its value must be identical to PreTokenGeneration. For new instances of pre token generation triggers, set the LambdaArn of PreTokenGenerationConfig.

  • UserMigration (string) --

    The configuration of a migrate user Lambda trigger in a user pool. This trigger can create user profiles when users sign in or attempt to reset their password with credentials that don't exist yet.

  • PreTokenGenerationConfig (dict) --

    The detailed configuration of a pre token generation Lambda trigger in a user pool. If you also set an ARN in PreTokenGeneration, its value must be identical to PreTokenGenerationConfig.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

      This parameter and the PreTokenGeneration property of LambdaConfig have the same value. For new instances of pre token generation triggers, set LambdaArn.

  • CustomSMSSender (dict) --

    The configuration of a custom SMS sender Lambda trigger. This trigger routes all SMS notifications from a user pool to a Lambda function that delivers the message using custom logic.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

      You must use a LambdaVersion of V1_0 with a custom sender function.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

  • CustomEmailSender (dict) --

    The configuration of a custom email sender Lambda trigger. This trigger routes all email notifications from a user pool to a Lambda function that delivers the message using custom logic.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

      You must use a LambdaVersion of V1_0 with a custom sender function.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

  • KMSKeyID (string) --

    The ARN of an KMS key. Amazon Cognito uses the key to encrypt codes and temporary passwords sent to custom sender Lambda triggers.

  • InboundFederation (dict) --

    The configuration of an inbound federation Lambda trigger. This trigger can transform federated user attributes during the authentication with external identity providers.

    • LambdaVersion (string) -- [REQUIRED]

      The user pool trigger version of the request that Amazon Cognito sends to your Lambda function. Higher-numbered versions add fields that support new features.

      You must use a LambdaVersion of V1_0 with an inbound federation function.

    • LambdaArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) of the function that you want to assign to your Lambda trigger.

type AutoVerifiedAttributes:

list

param AutoVerifiedAttributes:

The attributes that you want your user pool to automatically verify. Possible values: email, phone_number. For more information see Verifying contact information at sign-up.

  • (string) --

type SmsVerificationMessage:

string

param SmsVerificationMessage:

This parameter is no longer used.

type EmailVerificationMessage:

string

param EmailVerificationMessage:

This parameter is no longer used.

type EmailVerificationSubject:

string

param EmailVerificationSubject:

This parameter is no longer used.

type VerificationMessageTemplate:

dict

param VerificationMessageTemplate:

The template for the verification message that your user pool delivers to users who set an email address or phone number attribute.

Set the email message type that corresponds to your DefaultEmailOption selection. For CONFIRM_WITH_LINK, specify an EmailMessageByLink and leave EmailMessage blank. For CONFIRM_WITH_CODE, specify an EmailMessage and leave EmailMessageByLink blank. When you supply both parameters with either choice, Amazon Cognito returns an error.

  • SmsMessage (string) --

    The template for SMS messages that Amazon Cognito sends to your users.

  • EmailMessage (string) --

    The template for email messages that Amazon Cognito sends to your users. You can set an EmailMessage template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • EmailSubject (string) --

    The subject line for the email message template. You can set an EmailSubject template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • EmailMessageByLink (string) --

    The email message template for sending a confirmation link to the user. You can set an EmailMessageByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • EmailSubjectByLink (string) --

    The subject line for the email message template for sending a confirmation link to the user. You can set an EmailSubjectByLink template only if the value of EmailSendingAccount is DEVELOPER. When your EmailSendingAccount is DEVELOPER, your user pool sends email messages with your own Amazon SES configuration.

  • DefaultEmailOption (string) --

    The configuration of verification emails to contain a clickable link or a verification code.

    For link, your template body must contain link text in the format {##Click here##}. "Click here" in the example is a customizable string. For code, your template body must contain a code placeholder in the format {####}.

type SmsAuthenticationMessage:

string

param SmsAuthenticationMessage:

The contents of the SMS message that your user pool sends to users in SMS authentication.

type UserAttributeUpdateSettings:

dict

param UserAttributeUpdateSettings:

The settings for updates to user attributes. These settings include the property AttributesRequireVerificationBeforeUpdate, a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers.

  • AttributesRequireVerificationBeforeUpdate (list) --

    Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value.

    When AttributesRequireVerificationBeforeUpdate is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where AttributesRequireVerificationBeforeUpdate is false, API operations that change attribute values can immediately update a user’s email or phone_number attribute.

    • (string) --

type MfaConfiguration:

string

param MfaConfiguration:

Sets multi-factor authentication (MFA) to be on, off, or optional. When ON, all users must set up MFA before they can sign in. When OPTIONAL, your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, choose OPTIONAL.

When MfaConfiguration is OPTIONAL, managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor.

type DeviceConfiguration:

dict

param DeviceConfiguration:

The device-remembering configuration for a user pool. Device remembering or device tracking is a "Remember me on this device" option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool. A null value indicates that you have deactivated device remembering in your user pool.

  • ChallengeRequiredOnNewDevice (boolean) --

    When true, a remembered device can sign in with device authentication instead of SMS and time-based one-time password (TOTP) factors for multi-factor authentication (MFA).

  • DeviceOnlyRememberedOnUserPrompt (boolean) --

    When true, Amazon Cognito doesn't automatically remember a user's device when your app sends a ConfirmDevice API request. In your app, create a prompt for your user to choose whether they want to remember their device. Return the user's choice in an UpdateDeviceStatus API request.

    When DeviceOnlyRememberedOnUserPrompt is false, Amazon Cognito immediately remembers devices that you register in a ConfirmDevice API request.

type EmailConfiguration:

dict

param EmailConfiguration:

The email configuration of your user pool. The email configuration type sets your preferred sending method, Amazon Web Services Region, and sender for email invitation and verification messages from your user pool.

  • SourceArn (string) --

    The ARN of a verified email address or an address from a verified domain in Amazon SES. You can set a SourceArn email from a verified domain only with an API request. You can set a verified email address, but not an address in a verified domain, in the Amazon Cognito console. Amazon Cognito uses the email address that you provide in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:

    • If you specify COGNITO_DEFAULT, Amazon Cognito uses this address as the custom FROM address when it emails your users using its built-in email account.

    • If you specify DEVELOPER, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.

    The Region value of the SourceArn parameter must indicate a supported Amazon Web Services Region of your user pool. Typically, the Region in the SourceArn and the user pool Region are the same. For more information, see Amazon SES email configuration regions in the Amazon Cognito Developer Guide.

  • ReplyToEmailAddress (string) --

    The destination to which the receiver of the email should reply.

  • EmailSendingAccount (string) --

    Specifies whether Amazon Cognito uses its built-in functionality to send your users email messages, or uses your Amazon Simple Email Service email configuration. Specify one of the following values:

    COGNITO_DEFAULT

    When Amazon Cognito emails your users, it uses its built-in email functionality. When you use the default option, Amazon Cognito allows only a limited number of emails each day for your user pool. For typical production environments, the default email limit is less than the required delivery volume. To achieve a higher delivery volume, specify DEVELOPER to use your Amazon SES email configuration.

    To look up the email delivery limit for the default option, see Limits in the Amazon Cognito Developer Guide.

    The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the Amazon Resource Name (ARN) of an Amazon SES verified email address for the SourceArn parameter.

    DEVELOPER

    When Amazon Cognito emails your users, it uses your Amazon SES configuration. Amazon Cognito calls Amazon SES on your behalf to send email from your verified email address. When you use this option, the email delivery limits are the same limits that apply to your Amazon SES verified email address in your Amazon Web Services account.

    If you use this option, provide the ARN of an Amazon SES verified email address for the SourceArn parameter.

    Before Amazon Cognito can email your users, it requires additional permissions to call Amazon SES on your behalf. When you update your user pool with this option, Amazon Cognito creates a service-linked role, which is a type of role in your Amazon Web Services account. This role contains the permissions that allow you to access Amazon SES and send email messages from your email address. For more information about the service-linked role that Amazon Cognito creates, see Using Service-Linked Roles for Amazon Cognito in the Amazon Cognito Developer Guide.

  • From (string) --

    Either the sender’s email address or the sender’s name with their email address. For example, testuser@example.com or Test User <testuser@example.com>. This address appears before the body of the email.

  • ConfigurationSet (string) --

    The set of configuration rules that can be applied to emails sent using Amazon Simple Email Service. A configuration set is applied to an email by including a reference to the configuration set in the headers of the email. Once applied, all of the rules in that configuration set are applied to the email. Configuration sets can be used to apply the following types of rules to emails:

    Event publishing

    Amazon Simple Email Service can track the number of send, delivery, open, click, bounce, and complaint events for each email sent. Use event publishing to send information about these events to other Amazon Web Services services such as and Amazon CloudWatch

    IP pool management

    When leasing dedicated IP addresses with Amazon Simple Email Service, you can create groups of IP addresses, called dedicated IP pools. You can then associate the dedicated IP pools with configuration sets.

type SmsConfiguration:

dict

param SmsConfiguration:

The SMS configuration with the settings for your Amazon Cognito user pool to send SMS message with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account. For more information see SMS message settings.

  • SnsCallerArn (string) --

    The Amazon Resource Name (ARN) of the Amazon SNS caller. This is the ARN of the IAM role in your Amazon Web Services account that Amazon Cognito will use to send SMS messages. SMS messages are subject to a spending limit.

  • ExternalId (string) --

    The external ID provides additional security for your IAM role. You can use an ExternalId with the IAM role that you use with Amazon SNS to send SMS messages for your user pool. If you provide an ExternalId, your Amazon Cognito user pool includes it in the request to assume your IAM role. You can configure the role trust policy to require that Amazon Cognito, and any principal, provide the ExternalID. If you use the Amazon Cognito Management Console to create a role for SMS multi-factor authentication (MFA), Amazon Cognito creates a role with the required permissions and a trust policy that demonstrates use of the ExternalId.

    For more information about the ExternalId of a role, see How to use an external ID when granting access to your Amazon Web Services resources to a third party.

  • SnsRegion (string) --

    The Amazon Web Services Region to use with Amazon SNS integration. You can choose the same Region as your user pool, or a supported Legacy Amazon SNS alternate Region.

    Amazon Cognito resources in the Asia Pacific (Seoul) Amazon Web Services Region must use your Amazon SNS configuration in the Asia Pacific (Tokyo) Region. For more information, see SMS message settings for Amazon Cognito user pools.

  • EumsSms (dict) --

    The configuration for sending SMS messages through Amazon Web Services End User Messaging SMS, as an alternative to Amazon SNS. In a user pool, provide either the Amazon SNS configuration ( SnsCallerArn) or this configuration, but not both. In Amazon Web Services Regions where Amazon SNS is not available, this configuration is required.

    • CallerArn (string) -- [REQUIRED]

      The ARN of the IAM role that Amazon Cognito assumes to send SMS messages through Amazon Web Services End User Messaging SMS. The role must grant permission to call the sms-voice:SendTextMessage operation.

    • ExternalId (string) --

      The external ID that Amazon Cognito includes when it assumes the CallerArn role. Use this value as a condition in the role trust policy to prevent the confused deputy problem.

    • OriginationIdentity (string) --

      The origination identity that Amazon Web Services End User Messaging SMS uses to send messages to your users. This value can be one of the following:

      • A phone number – A long code, toll-free number, or short code that is assigned to your account.

      • A sender ID – An alphabetic name that identifies the message sender in supported countries.

      • A phone pool – A group of phone numbers that Amazon Web Services End User Messaging SMS selects from when it sends messages.

      You can provide an E.164 phone number or the ARN of the phone number, sender ID, or phone pool. Amazon Web Services End User Messaging SMS evaluates IAM authorization with the value that you provide. If the permissions policy of your CallerArn role scopes the sms-voice:SendTextMessage resource to a specific ARN, provide that same ARN. If the formats do not match, requests fail with an InvalidSmsRoleAccessPolicyException.

      Depending on the destination country, you must provide an origination identity. For country-specific requirements, see Supported countries and regions for SMS messaging in the Amazon Web Services End User Messaging SMS User Guide.

    • ConfigurationSetName (string) --

      The name of the Amazon Web Services End User Messaging SMS configuration set that Amazon Cognito applies to messages, for logging and event destinations. If you omit this member, Amazon Cognito sends messages without applying a configuration set.

    • InEntityId (string) --

      The principal entity ID required by India's Distributed Ledger Technology (DLT) regulations for SMS messages.

    • InTemplateId (string) --

      The registered template ID for the message template required by India's DLT regulations for SMS messages.

    • Region (string) --

      The Amazon Web Services Region of the Amazon Web Services End User Messaging SMS resources that Amazon Cognito uses to send messages. Amazon Web Services End User Messaging SMS must be available in your user pool's Region.

      If you omit this parameter, Amazon Cognito uses the same Region as your user pool. You can also set this parameter to your user pool's Region explicitly. Amazon Cognito rejects any other value with an InvalidParameterException.

type UserPoolTags:

dict

param UserPoolTags:

The tag keys and values to assign to the user pool. A tag is a label that you can use to categorize and manage user pools in different ways, such as by purpose, owner, environment, or other criteria.

  • (string) --

    • (string) --

type AdminCreateUserConfig:

dict

param AdminCreateUserConfig:

The configuration for administrative creation of users. Includes the template for the invitation message for new users, the duration of temporary passwords, and permitting self-service sign-up.

  • AllowAdminCreateUserOnly (boolean) --

    The setting for allowing self-service sign-up. When true, only administrators can create new user profiles. When false, users can register themselves and create a new user profile with the SignUp operation.

  • UnusedAccountValidityDays (integer) --

    This parameter is no longer in use.

    The password expiration limit in days for administrator-created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call AdminCreateUser again, specifying RESEND for the MessageAction parameter.

    The default value for this parameter is 7.

  • InviteMessageTemplate (dict) --

    The template for the welcome message to new users. This template must include the {####} temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder.

    See also Customizing User Invitation Messages.

    • SMSMessage (string) --

      The message template for SMS messages.

    • EmailMessage (string) --

      The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER.

    • EmailSubject (string) --

      The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER.

type UserPoolAddOns:

dict

param UserPoolAddOns:

Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to AUDIT. To configure automatic security responses to potentially unwanted traffic to your user pool, set to ENFORCED.

For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier.

  • AdvancedSecurityMode (string) -- [REQUIRED]

    The operating mode of threat protection for standard authentication types in your user pool, including username-password and secure remote password (SRP) authentication.

  • AdvancedSecurityAdditionalFlows (dict) --

    Threat protection configuration options for additional authentication types in your user pool, including custom authentication.

type DcrConfiguration:

dict

param DcrConfiguration:

The dynamic client registration configuration for the user pool. With dynamic client registration, applications can register their own app clients at runtime through the registration endpoint of your user pool domain. To activate this setting, your user pool must be in the Essentials tier or higher.

If you omit this parameter, Amazon Cognito keeps the existing configuration. If you include it, Amazon Cognito replaces the existing configuration with the one that you provide. Members that you omit revert to their default values, and an omitted EnableStatus turns dynamic client registration on.

To change the feature plan of the user pool to Lite, you must also set EnableStatus to Disabled.

  • EnableStatus (string) --

    Specifies whether dynamic client registration is turned on for the user pool. If you provide a dynamic client registration configuration without this value, Amazon Cognito turns dynamic client registration on.

  • OpenDcrEnabled (boolean) --

    Specifies whether open registration is turned on. When open registration is on, applications can register app clients without an initial access token. The default value is false.

  • AuthenticatedGrantTypes (list) --

    The OAuth grant types that an app client created through authenticated registration can request. If you don't set this value, authenticated registration permits the code and client_credentials grant types. If you set an empty list, Amazon Cognito rejects authenticated registration requests. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

    code

    Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

    client_credentials

    Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

    • (string) --

  • OpenDcrGrantTypes (list) --

    The OAuth grant types that an app client created through open registration can request. If you don't set this value, open registration permits only the code grant type. If you set an empty list, Amazon Cognito rejects open registration requests. If you add client_credentials, anyone can register an app client that requests machine-to-machine (M2M) access tokens, and you pay for the M2M token requests that those app clients make. Dynamic client registration supports the following values. Amazon Cognito accepts implicit in this list but ignores it.

    code

    Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

    client_credentials

    Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

    • (string) --

  • AllowedScopes (list) --

    The scopes that an app client created through dynamic client registration can request, in addition to the standard OpenID Connect (OIDC) scopes. You can include custom scopes from your resource servers and aws.cognito.signin.user.admin. Registered app clients can request the OIDC scopes openid, email, phone, and profile without listing them here. If you don't set this value, registered app clients can request only the OIDC scopes. A registered app client can't request the aws.cognito/dcr/register scope, even if you include it in this list.

    • (string) --

type AccountRecoverySetting:

dict

param AccountRecoverySetting:

The available verified method a user can use to recover their password when they call ForgotPassword. You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email.

  • RecoveryMechanisms (list) --

    The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators.

    • (dict) --

      A recovery option for a user. The AccountRecoverySettingType data type is an array of this object. Each RecoveryOptionType has a priority property that determines whether it is a primary or secondary option.

      For example, if verified_email has a priority of 1 and verified_phone_number has a priority of 2, your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The admin_only option prevents self-service account recovery.

      • Priority (integer) -- [REQUIRED]

        Your priority preference for using the specified attribute in account recovery. The highest priority is 1.

      • Name (string) -- [REQUIRED]

        The recovery method that this object sets a recovery option for.

type PoolName:

string

param PoolName:

The updated name of your user pool.

type UserPoolTier:

string

param UserPoolTier:

The user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to ESSENTIALS.

type KeyConfiguration:

dict

param KeyConfiguration:

The key configuration for the user pool. In secondary regions, this parameter must match the existing configuration and cannot be modified.

  • KeyType (string) --

    The type of encryption key used for the user pool.

    AWS_OWNED_KEY

    A key owned by Amazon Web Services in Key Management Service.

    CUSTOMER_MANAGED_KEY

    A key managed by the customer in Key Management Service. You must use a multi-region key to enable multi-region replication for a user pool.

  • KmsKeyArn (string) --

    The Amazon Resource Name (ARN) of the KMS key used for encryption. If not specified, Amazon Web Services managed keys are used.

type IssuerConfiguration:

dict

param IssuerConfiguration:

The issuer configuration for the user pool. In secondary regions, this parameter must match the existing configuration and cannot be modified.

  • Type (string) --

    The type of issuer configuration. Determines the token issuing behavior for the user pool.

    ORIGINAL

    The original issuer configuration for user pools. The issuer URL is hosted in the user pool’s region and provides OIDC endpoints specific to that region.

    Original issuers have the format of https://cognito-idp.[region].amazonaws.com/[userPoolId]

    UPDATED

    Recommended for all user pools, including for multi-Region replication. Updated issuers host the same JWKS content in multiple regions, resulting in improved resilience and efficiency.

    Updated issuers have the format of https://issuer-cognito-idp.[region].amazonaws.com/[userPoolId], where region is the primary Amazon Web Services Region of your user pool.

type AcrConfiguration:

dict

param AcrConfiguration:

The custom names for the authentication context class reference (ACR) levels in your user pool. This configuration has the same behavior as it does when you create a user pool: you customize only the URI name that Amazon Cognito reports for each of the four fixed ACR levels, and any level that you don't specify keeps its default name. Each name must be unique across all four levels, including default names.

Configuring custom ACR level names requires the Essentials or Plus feature plan. To activate this setting, your user pool must be in the Essentials tier or higher.

  • (string) --

    • (dict) --

      The configuration for a single authentication context class reference (ACR) level in a user pool. Each entry in an AcrConfiguration map associates a level ( Level1 through Level4) with this configuration, which provides the custom name that Amazon Cognito reports for that level in the acr token claim.

      • AcrValue (string) -- [REQUIRED]

        The custom name for this authentication context class reference (ACR) level. This value is the URI that Amazon Cognito reports in the acr token claim when a user meets this level. The name must be unique across all levels in the user pool, including default names.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

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

UpdateUserPoolClient (updated) Link ¶
Changes (response)
{'UserPoolClient': {'ClientType': 'REGULAR | DCR'}}

Given a user pool app client ID, updates the configuration. To avoid setting parameters to Amazon Cognito defaults, construct this API request to pass the existing configuration of your app client, modified to include the changes that you want to make.

Unlike app clients created in the console, Amazon Cognito doesn't automatically assign a branding style to app clients that you configure with this API operation. Managed login and classic hosted UI pages aren't available for your client until after you apply a branding style.

See also: AWS API Documentation

Request Syntax

client.update_user_pool_client(
    UserPoolId='string',
    ClientId='string',
    ClientName='string',
    RefreshTokenValidity=123,
    AccessTokenValidity=123,
    IdTokenValidity=123,
    TokenValidityUnits={
        'AccessToken': 'seconds'|'minutes'|'hours'|'days',
        'IdToken': 'seconds'|'minutes'|'hours'|'days',
        'RefreshToken': 'seconds'|'minutes'|'hours'|'days'
    },
    ReadAttributes=[
        'string',
    ],
    WriteAttributes=[
        'string',
    ],
    ExplicitAuthFlows=[
        'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH',
    ],
    SupportedIdentityProviders=[
        'string',
    ],
    CallbackURLs=[
        'string',
    ],
    LogoutURLs=[
        'string',
    ],
    DefaultRedirectURI='string',
    AllowedOAuthFlows=[
        'code'|'implicit'|'client_credentials',
    ],
    AllowedOAuthScopes=[
        'string',
    ],
    AllowedOAuthFlowsUserPoolClient=True|False,
    AnalyticsConfiguration={
        'ApplicationId': 'string',
        'ApplicationArn': 'string',
        'RoleArn': 'string',
        'ExternalId': 'string',
        'UserDataShared': True|False
    },
    PreventUserExistenceErrors='LEGACY'|'ENABLED',
    EnableTokenRevocation=True|False,
    EnablePropagateAdditionalUserContextData=True|False,
    AuthSessionValidity=123,
    RefreshTokenRotation={
        'Feature': 'ENABLED'|'DISABLED',
        'RetryGracePeriodSeconds': 123
    }
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

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

type ClientId:

string

param ClientId:

[REQUIRED]

The ID of the app client that you want to update.

type ClientName:

string

param ClientName:

A friendly name for the app client.

type RefreshTokenValidity:

integer

param RefreshTokenValidity:

The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for RefreshTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

For example, when you set RefreshTokenValidity as 10 and TokenValidityUnits as days, your user can refresh their session and retrieve new access and ID tokens for 10 days.

The default time unit for RefreshTokenValidity in an API request is days. You can't set RefreshTokenValidity to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. Valid range is displayed below in seconds.

If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days.

type AccessTokenValidity:

integer

param AccessTokenValidity:

The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for AccessTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

For example, when you set AccessTokenValidity to 10 and TokenValidityUnits to hours, your user can authorize access with their access token for 10 hours.

The default time unit for AccessTokenValidity in an API request is hours. Valid range is displayed below in seconds.

If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour.

type IdTokenValidity:

integer

param IdTokenValidity:

The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for IdTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

For example, when you set IdTokenValidity as 10 and TokenValidityUnits as hours, your user can authenticate their session with their ID token for 10 hours.

The default time unit for IdTokenValidity in an API request is hours. Valid range is displayed below in seconds.

If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour.

type TokenValidityUnits:

dict

param TokenValidityUnits:

The units that validity times are represented in. The default unit for refresh tokens is days, and the default for ID and access tokens are hours.

  • AccessToken (string) --

    A time unit for the value that you set in the AccessTokenValidity parameter. The default AccessTokenValidity time unit is hours. AccessTokenValidity duration can range from five minutes to one day.

  • IdToken (string) --

    A time unit for the value that you set in the IdTokenValidity parameter. The default IdTokenValidity time unit is hours. IdTokenValidity duration can range from five minutes to one day.

  • RefreshToken (string) --

    A time unit for the value that you set in the RefreshTokenValidity parameter. The default RefreshTokenValidity time unit is days. RefreshTokenValidity duration can range from 60 minutes to 10 years.

type ReadAttributes:

list

param ReadAttributes:

The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list.

When you don't specify the ReadAttributes for your app client, your app can read the values of email_verified, phone_number_verified, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, ReadAttributes doesn't return any information. Amazon Cognito only populates ReadAttributes in the API response if you have specified your own custom set of read attributes.

  • (string) --

type WriteAttributes:

list

param WriteAttributes:

The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list.

When you don't specify the WriteAttributes for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, WriteAttributes doesn't return any information. Amazon Cognito only populates WriteAttributes in the API response if you have specified your own custom set of write attributes.

If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool.

  • (string) --

type ExplicitAuthFlows:

list

param ExplicitAuthFlows:

The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.

The values for authentication flow options include the following.

  • ALLOW_USER_AUTH: Enable selection-based sign-in with USER_AUTH. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without other ExplicitAuthFlows permitting them. For example users can complete an SRP challenge through USER_AUTH without the flow USER_SRP_AUTH being active for the app client. This flow doesn't include CUSTOM_AUTH. To activate this setting, your user pool must be in the Essentials tier or higher.

  • ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password.

  • ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication.

  • ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords.

  • ALLOW_USER_SRP_AUTH: Enable SRP-based authentication.

  • ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens.

In some environments, you will see the values ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, or USER_PASSWORD_AUTH. You can't assign these legacy ExplicitAuthFlows values to user pool clients at the same time as values that begin with ALLOW_, like ALLOW_USER_SRP_AUTH.

  • (string) --

type SupportedIdentityProviders:

list

param SupportedIdentityProviders:

A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: COGNITO, Facebook, Google, SignInWithApple, and LoginWithAmazon. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example MySAMLIdP or MyOIDCIdP.

This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of COGNITO from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule.

  • (string) --

type CallbackURLs:

list

param CallbackURLs:

A list of allowed redirect, or callback, URLs for managed login authentication. These URLs are the paths where you want to send your users' browsers after they complete authentication with managed login or a third-party IdP. Typically, callback URLs are the home of an application that uses OAuth or OIDC libraries to process authentication outcomes.

A redirect URI must meet the following requirements:

  • Be an absolute URI.

  • Be registered with the authorization server. Amazon Cognito doesn't accept authorization requests with redirect_uri values that aren't in the list of CallbackURLs that you provide in this parameter.

  • Not include a fragment component.

See OAuth 2.0 - Redirection Endpoint.

Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.

App callback URLs such as myapp://example are also supported.

  • (string) --

type LogoutURLs:

list

param LogoutURLs:

A list of allowed logout URLs for managed login authentication. When you pass logout_uri and client_id parameters to /logout, Amazon Cognito signs out your user and redirects them to the logout URL. This parameter describes the URLs that you want to be the permitted targets of logout_uri. A typical use of these URLs is when a user selects "Sign out" and you redirect them to your public homepage. For more information, see Logout endpoint.

  • (string) --

type DefaultRedirectURI:

string

param DefaultRedirectURI:

The default redirect URI. In app clients with one assigned IdP, replaces redirect_uri in authentication requests. Must be in the CallbackURLs list.

type AllowedOAuthFlows:

list

param AllowedOAuthFlows:

The OAuth grant types that you want your app client to generate. To create an app client that generates client credentials grants, you must add client_credentials as the only allowed OAuth flow.

code

Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

implicit

Issue the access token (and, optionally, ID token, based on scopes) directly to your user.

client_credentials

Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

  • (string) --

type AllowedOAuthScopes:

list

param AllowedOAuthScopes:

The OAuth, OpenID Connect (OIDC), and custom scopes that you want to permit your app client to authorize access with. Scopes govern access control to user pool self-service API operations, user data from the userInfo endpoint, and third-party APIs. Scope values include phone, email, openid, and profile. The aws.cognito.signin.user.admin scope authorizes user self-service operations. Custom scopes with resource servers authorize access to external APIs.

  • (string) --

type AllowedOAuthFlowsUserPoolClient:

boolean

param AllowedOAuthFlowsUserPoolClient:

Set to true to use OAuth 2.0 authorization server features in your app client.

This parameter must have a value of true before you can configure the following features in your app client.

  • CallBackURLs: Callback URLs.

  • LogoutURLs: Sign-out redirect URLs.

  • AllowedOAuthScopes: OAuth 2.0 scopes.

  • AllowedOAuthFlows: Support for authorization code, implicit, and client credentials OAuth 2.0 grants.

To use authorization server features, configure one of these features in the Amazon Cognito console or set AllowedOAuthFlowsUserPoolClient to true in a CreateUserPoolClient or UpdateUserPoolClient API request. If you don't set a value for AllowedOAuthFlowsUserPoolClient in a request with the CLI or SDKs, it defaults to false. When false, only SDK-based API sign-in is permitted.

type AnalyticsConfiguration:

dict

param AnalyticsConfiguration:

The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.

In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools might not have access to analytics or might be configurable with campaigns in the US East (N. Virginia) Region. For more information, see Using Amazon Pinpoint analytics.

  • ApplicationId (string) --

    Your Amazon Pinpoint project ID.

  • ApplicationArn (string) --

    The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that ApplicationArn declares. You can also configure your application to pass an endpoint ID in the AnalyticsMetadata parameter of sign-in operations. The endpoint ID is information about the destination for push notifications

  • RoleArn (string) --

    The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics.

  • ExternalId (string) --

    The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint.

  • UserDataShared (boolean) --

    If UserDataShared is true, Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics.

type PreventUserExistenceErrors:

string

param PreventUserExistenceErrors:

When ENABLED, suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to ENABLED and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs return a UserNotFoundException exception if the user doesn't exist in the user pool.

Defaults to LEGACY.

type EnableTokenRevocation:

boolean

param EnableTokenRevocation:

Activates or deactivates token revocation in the target app client.

type EnablePropagateAdditionalUserContextData:

boolean

param EnablePropagateAdditionalUserContextData:

When true, your application can include additional UserContextData in authentication requests. This data includes the IP address, and contributes to analysis by threat protection features. For more information about propagation of user context data, see Adding session data to API requests. If you don’t include this parameter, you can't send the source IP address to Amazon Cognito threat protection features. You can only activate EnablePropagateAdditionalUserContextData in an app client that has a client secret.

type AuthSessionValidity:

integer

param AuthSessionValidity:

Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires.

type RefreshTokenRotation:

dict

param RefreshTokenRotation:

The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens.

  • Feature (string) -- [REQUIRED]

    The state of refresh token rotation for the current app client.

  • RetryGracePeriodSeconds (integer) --

    When you request a token refresh with GetTokensFromRefreshToken, the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When RetryGracePeriodSeconds is 0, the grace period is disabled and a successful request immediately invalidates the submitted refresh token.

rtype:

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,
        'AccessTokenValidity': 123,
        'IdTokenValidity': 123,
        'TokenValidityUnits': {
            'AccessToken': 'seconds'|'minutes'|'hours'|'days',
            'IdToken': 'seconds'|'minutes'|'hours'|'days',
            'RefreshToken': 'seconds'|'minutes'|'hours'|'days'
        },
        'ReadAttributes': [
            'string',
        ],
        'WriteAttributes': [
            'string',
        ],
        'ExplicitAuthFlows': [
            'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH',
        ],
        'SupportedIdentityProviders': [
            'string',
        ],
        'CallbackURLs': [
            'string',
        ],
        'LogoutURLs': [
            'string',
        ],
        'DefaultRedirectURI': 'string',
        'AllowedOAuthFlows': [
            'code'|'implicit'|'client_credentials',
        ],
        'AllowedOAuthScopes': [
            'string',
        ],
        'AllowedOAuthFlowsUserPoolClient': True|False,
        'AnalyticsConfiguration': {
            'ApplicationId': 'string',
            'ApplicationArn': 'string',
            'RoleArn': 'string',
            'ExternalId': 'string',
            'UserDataShared': True|False
        },
        'PreventUserExistenceErrors': 'LEGACY'|'ENABLED',
        'EnableTokenRevocation': True|False,
        'EnablePropagateAdditionalUserContextData': True|False,
        'AuthSessionValidity': 123,
        'RefreshTokenRotation': {
            'Feature': 'ENABLED'|'DISABLED',
            'RetryGracePeriodSeconds': 123
        },
        'ClientType': 'REGULAR'|'DCR'
    }
}

Response Structure

  • (dict) --

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

    • UserPoolClient (dict) --

      The updated details of your app client.

      • UserPoolId (string) --

        The ID of the user pool associated with the app client.

      • ClientName (string) --

        The name of the app client.

      • ClientId (string) --

        The ID of the app client.

      • ClientSecret (string) --

        The app client secret.

      • LastModifiedDate (datetime) --

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • CreationDate (datetime) --

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • RefreshTokenValidity (integer) --

        The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for RefreshTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set RefreshTokenValidity as 10 and TokenValidityUnits as days, your user can refresh their session and retrieve new access and ID tokens for 10 days.

        The default time unit for RefreshTokenValidity in an API request is days. You can't set RefreshTokenValidity to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days.

      • AccessTokenValidity (integer) --

        The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for AccessTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set AccessTokenValidity to 10 and TokenValidityUnits to hours, your user can authorize access with their access token for 10 hours.

        The default time unit for AccessTokenValidity in an API request is hours. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour.

      • IdTokenValidity (integer) --

        The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for IdTokenValidity as seconds, minutes, hours, or days, set a TokenValidityUnits value in your API request.

        For example, when you set IdTokenValidity as 10 and TokenValidityUnits as hours, your user can authenticate their session with their ID token for 10 hours.

        The default time unit for IdTokenValidity in an API request is hours. Valid range is displayed below in seconds.

        If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour.

      • TokenValidityUnits (dict) --

        The time units that, with IdTokenValidity, AccessTokenValidity, and RefreshTokenValidity, set and display the duration of ID, access, and refresh tokens for an app client. You can assign a separate token validity unit to each type of token.

        • AccessToken (string) --

          A time unit for the value that you set in the AccessTokenValidity parameter. The default AccessTokenValidity time unit is hours. AccessTokenValidity duration can range from five minutes to one day.

        • IdToken (string) --

          A time unit for the value that you set in the IdTokenValidity parameter. The default IdTokenValidity time unit is hours. IdTokenValidity duration can range from five minutes to one day.

        • RefreshToken (string) --

          A time unit for the value that you set in the RefreshTokenValidity parameter. The default RefreshTokenValidity time unit is days. RefreshTokenValidity duration can range from 60 minutes to 10 years.

      • ReadAttributes (list) --

        The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list.

        When you don't specify the ReadAttributes for your app client, your app can read the values of email_verified, phone_number_verified, and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, ReadAttributes doesn't return any information. Amazon Cognito only populates ReadAttributes in the API response if you have specified your own custom set of read attributes.

        • (string) --

      • WriteAttributes (list) --

        The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list.

        When you don't specify the WriteAttributes for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, WriteAttributes doesn't return any information. Amazon Cognito only populates WriteAttributes in the API response if you have specified your own custom set of write attributes.

        If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool.

        • (string) --

      • ExplicitAuthFlows (list) --

        The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions.

        The values for authentication flow options include the following.

        • ALLOW_USER_AUTH: Enable selection-based sign-in with USER_AUTH. This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username-password and SRP authentication without other ExplicitAuthFlows permitting them. For example users can complete an SRP challenge through USER_AUTH without the flow USER_SRP_AUTH being active for the app client. This flow doesn't include CUSTOM_AUTH. To activate this setting, your user pool must be in the Essentials tier or higher.

        • ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password.

        • ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication.

        • ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords.

        • ALLOW_USER_SRP_AUTH: Enable SRP-based authentication.

        • ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens.

        In some environments, you will see the values ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY, or USER_PASSWORD_AUTH. You can't assign these legacy ExplicitAuthFlows values to user pool clients at the same time as values that begin with ALLOW_, like ALLOW_USER_SRP_AUTH.

        • (string) --

      • SupportedIdentityProviders (list) --

        A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: COGNITO, Facebook, Google, SignInWithApple, and LoginWithAmazon. You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example MySAMLIdP or MyOIDCIdP.

        This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of COGNITO from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule.

        • (string) --

      • CallbackURLs (list) --

        A list of allowed redirect (callback) URLs for the IdPs.

        A redirect URI must:

        • Be an absolute URI.

        • Be registered with the authorization server.

        • Not include a fragment component.

        See OAuth 2.0 - Redirection Endpoint.

        Amazon Cognito requires HTTPS over HTTP for callback URLs to http://localhost, http://127.0.0.1 and http://[::1]. These callback URLs are for testing purposes only. You can specify custom TCP ports for your callback URLs.

        App callback URLs such as myapp://example are also supported.

        • (string) --

      • LogoutURLs (list) --

        A list of allowed logout URLs for the IdPs.

        • (string) --

      • DefaultRedirectURI (string) --

        The default redirect URI. Must be in the CallbackURLs list.

        A redirect URI must:

        • Be an absolute URI.

        • Be registered with the authorization server.

        • Not include a fragment component.

        See OAuth 2.0 - Redirection Endpoint.

        Amazon Cognito requires HTTPS over HTTP for callback URLs to http://localhost, http://127.0.0.1 and http://[::1]. These callback URLs are for testing purposes only. You can specify custom TCP ports for your callback URLs.

        App callback URLs such as myapp://example are also supported.

      • AllowedOAuthFlows (list) --

        The OAuth grant types that you want your app client to generate. To create an app client that generates client credentials grants, you must add client_credentials as the only allowed OAuth flow.

        code

        Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the /oauth2/token endpoint.

        implicit

        Issue the access token (and, optionally, ID token, based on scopes) directly to your user.

        client_credentials

        Issue the access token from the /oauth2/token endpoint directly to a non-person user using a combination of the client ID and client secret.

        • (string) --

      • AllowedOAuthScopes (list) --

        The OAuth 2.0 scopes that you want your app client to support. Can include standard OAuth scopes like phone, email, openid, and profile. Can also include the aws.cognito.signin.user.admin scope that authorizes user profile self-service operations and custom scopes from resource servers.

        • (string) --

      • AllowedOAuthFlowsUserPoolClient (boolean) --

        Set to true to use OAuth 2.0 authorization server features in your app client.

        This parameter must have a value of true before you can configure the following features in your app client.

        • CallBackURLs: Callback URLs.

        • LogoutURLs: Sign-out redirect URLs.

        • AllowedOAuthScopes: OAuth 2.0 scopes.

        • AllowedOAuthFlows: Support for authorization code, implicit, and client credentials OAuth 2.0 grants.

        To use authorization server features, configure one of these features in the Amazon Cognito console or set AllowedOAuthFlowsUserPoolClient to true in a CreateUserPoolClient or UpdateUserPoolClient API request. If you don't set a value for AllowedOAuthFlowsUserPoolClient in a request with the CLI or SDKs, it defaults to false. When false, only SDK-based API sign-in is permitted.

      • AnalyticsConfiguration (dict) --

        The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign.

        • ApplicationId (string) --

          Your Amazon Pinpoint project ID.

        • ApplicationArn (string) --

          The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that ApplicationArn declares. You can also configure your application to pass an endpoint ID in the AnalyticsMetadata parameter of sign-in operations. The endpoint ID is information about the destination for push notifications

        • RoleArn (string) --

          The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics.

        • ExternalId (string) --

          The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint.

        • UserDataShared (boolean) --

          If UserDataShared is true, Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics.

      • PreventUserExistenceErrors (string) --

        When ENABLED, suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to ENABLED and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to LEGACY, those APIs return a UserNotFoundException exception if the user doesn't exist in the user pool.

        Defaults to LEGACY.

      • EnableTokenRevocation (boolean) --

        Indicates whether token revocation is activated for the user pool client. When you create a new user pool client, token revocation is activated by default.

      • EnablePropagateAdditionalUserContextData (boolean) --

        When EnablePropagateAdditionalUserContextData is true, Amazon Cognito accepts an IpAddress value that you send in the UserContextData parameter. The UserContextData parameter sends information to Amazon Cognito threat protection for risk analysis. You can send UserContextData when you sign in Amazon Cognito native users with the InitiateAuth and RespondToAuthChallenge API operations.

        When EnablePropagateAdditionalUserContextData is false, you can't send your user's source IP address to Amazon Cognito threat protection with unauthenticated API operations. EnablePropagateAdditionalUserContextData doesn't affect whether you can send a source IP address in a ContextData parameter with the authenticated API operations AdminInitiateAuth and AdminRespondToAuthChallenge.

        You can only activate EnablePropagateAdditionalUserContextData in an app client that has a client secret. For more information about propagation of user context data, see Adding user device and session data to API requests.

      • AuthSessionValidity (integer) --

        Amazon Cognito creates a session token for each API request in an authentication flow. AuthSessionValidity is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires.

      • RefreshTokenRotation (dict) --

        The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens.

        • Feature (string) --

          The state of refresh token rotation for the current app client.

        • RetryGracePeriodSeconds (integer) --

          When you request a token refresh with GetTokensFromRefreshToken, the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When RetryGracePeriodSeconds is 0, the grace period is disabled and a successful request immediately invalidates the submitted refresh token.

      • ClientType (string) --

        How the app client was created.

        REGULAR

        The app client wasn't created through dynamic client registration. For example, you created it with CreateUserPoolClient.

        DCR

        An application registered the app client through dynamic client registration. These app clients don't support client secret operations such as AddUserPoolClientSecret, and they can't hold the aws.cognito/dcr/register scope.