Amazon Cognito Identity Provider

2024/11/22 - Amazon Cognito Identity Provider - 10 new17 updated api methods

Changes  Add support for users to sign up and sign in without passwords, using email and SMS OTPs and Passkeys. Add support for Passkeys based on WebAuthn. Add support for enhanced branding customization for hosted authentication pages with Amazon Cognito Managed Login. Add feature tiers with new pricing.

DescribeManagedLoginBranding (new) Link ¶

When given the ID of a managed login branding style, returns detailed information about the style.

See also: AWS API Documentation

Request Syntax

client.describe_managed_login_branding(
    UserPoolId='string',
    ManagedLoginBrandingId='string',
    ReturnMergedResources=True|False
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the managed login branding style that you want to get information about.

type ManagedLoginBrandingId:

string

param ManagedLoginBrandingId:

[REQUIRED]

The ID of the managed login branding style that you want to get more information about.

type ReturnMergedResources:

boolean

param ReturnMergedResources:

When true, returns values for branding options that are unchanged from Amazon Cognito defaults. When false or when you omit this parameter, returns only values that you customized in your branding style.

rtype:

dict

returns:

Response Syntax

{
    'ManagedLoginBranding': {
        'ManagedLoginBrandingId': 'string',
        'UserPoolId': 'string',
        'UseCognitoProvidedValues': True|False,
        'Settings': {...}|[...]|123|123.4|'string'|True|None,
        'Assets': [
            {
                'Category': 'FAVICON_ICO'|'FAVICON_SVG'|'EMAIL_GRAPHIC'|'SMS_GRAPHIC'|'AUTH_APP_GRAPHIC'|'PASSWORD_GRAPHIC'|'PASSKEY_GRAPHIC'|'PAGE_HEADER_LOGO'|'PAGE_HEADER_BACKGROUND'|'PAGE_FOOTER_LOGO'|'PAGE_FOOTER_BACKGROUND'|'PAGE_BACKGROUND'|'FORM_BACKGROUND'|'FORM_LOGO'|'IDP_BUTTON_ICON',
                'ColorMode': 'LIGHT'|'DARK'|'DYNAMIC',
                'Extension': 'ICO'|'JPEG'|'PNG'|'SVG'|'WEBP',
                'Bytes': b'bytes',
                'ResourceId': 'string'
            },
        ],
        'CreationDate': datetime(2015, 1, 1),
        'LastModifiedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ManagedLoginBranding (dict) --

      The details of the requested branding style.

      • ManagedLoginBrandingId (string) --

        The ID of the managed login branding style.

      • UserPoolId (string) --

        The user pool where the branding style is assigned.

      • UseCognitoProvidedValues (boolean) --

        When true, applies the default branding style options. This option reverts to a "blank" style that you can modify later in the branding designer.

      • Settings (:ref:`document<document>`) --

        A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.

      • Assets (list) --

        An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.

        • (dict) --

          An image file from a managed login branding style in a user pool.

          This data type is a request parameter of CreateManagedLoginBranding and UpdateManagedLoginBranding, and a response parameter of DescribeManagedLoginBranding.

          • Category (string) --

            The category that the image corresponds to in your managed login configuration. Managed login has asset categories for different types of logos, backgrounds, and icons.

          • ColorMode (string) --

            The display-mode target of the asset: light, dark, or browser-adaptive. For example, Amazon Cognito displays a dark-mode image only when the browser or application is in dark mode, but displays a browser-adaptive file in all contexts.

          • Extension (string) --

            The file type of the image file.

          • Bytes (bytes) --

            The image file, in Base64-encoded binary.

          • ResourceId (string) --

            The ID of the asset.

      • 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.

      • 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.

UpdateManagedLoginBranding (new) Link ¶

Configures the branding settings for a user pool style. This operation is the programmatic option for the configuration of a style in the branding designer.

Provides values for UI customization in a Settings JSON object and image files in an Assets array.

This operation has a 2-megabyte request-size limit and include the CSS settings and image assets for your app client. Your branding settings might exceed 2MB in size. Amazon Cognito doesn't require that you pass all parameters in one request and preserves existing style settings that you don't specify. If your request is larger than 2MB, separate it into multiple requests, each with a size smaller than the limit.

For more information, see API and SDK operations for managed login branding.

See also: AWS API Documentation

Request Syntax

client.update_managed_login_branding(
    UserPoolId='string',
    ManagedLoginBrandingId='string',
    UseCognitoProvidedValues=True|False,
    Settings={...}|[...]|123|123.4|'string'|True|None,
    Assets=[
        {
            'Category': 'FAVICON_ICO'|'FAVICON_SVG'|'EMAIL_GRAPHIC'|'SMS_GRAPHIC'|'AUTH_APP_GRAPHIC'|'PASSWORD_GRAPHIC'|'PASSKEY_GRAPHIC'|'PAGE_HEADER_LOGO'|'PAGE_HEADER_BACKGROUND'|'PAGE_FOOTER_LOGO'|'PAGE_FOOTER_BACKGROUND'|'PAGE_BACKGROUND'|'FORM_BACKGROUND'|'FORM_LOGO'|'IDP_BUTTON_ICON',
            'ColorMode': 'LIGHT'|'DARK'|'DYNAMIC',
            'Extension': 'ICO'|'JPEG'|'PNG'|'SVG'|'WEBP',
            'Bytes': b'bytes',
            'ResourceId': 'string'
        },
    ]
)
type UserPoolId:

string

param UserPoolId:

The ID of the user pool that contains the managed login branding style that you want to update.

type ManagedLoginBrandingId:

string

param ManagedLoginBrandingId:

The ID of the managed login branding style that you want to update.

type UseCognitoProvidedValues:

boolean

param UseCognitoProvidedValues:

When true, applies the default branding style options. This option reverts to default style options that are managed by Amazon Cognito. You can modify them later in the branding designer.

When you specify true for this option, you must also omit values for Settings and Assets in the request.

type Settings:

:ref:`document<document>`

param Settings:

A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.

type Assets:

list

param Assets:

An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.

  • (dict) --

    An image file from a managed login branding style in a user pool.

    This data type is a request parameter of CreateManagedLoginBranding and UpdateManagedLoginBranding, and a response parameter of DescribeManagedLoginBranding.

    • Category (string) -- [REQUIRED]

      The category that the image corresponds to in your managed login configuration. Managed login has asset categories for different types of logos, backgrounds, and icons.

    • ColorMode (string) -- [REQUIRED]

      The display-mode target of the asset: light, dark, or browser-adaptive. For example, Amazon Cognito displays a dark-mode image only when the browser or application is in dark mode, but displays a browser-adaptive file in all contexts.

    • Extension (string) -- [REQUIRED]

      The file type of the image file.

    • Bytes (bytes) --

      The image file, in Base64-encoded binary.

    • ResourceId (string) --

      The ID of the asset.

rtype:

dict

returns:

Response Syntax

{
    'ManagedLoginBranding': {
        'ManagedLoginBrandingId': 'string',
        'UserPoolId': 'string',
        'UseCognitoProvidedValues': True|False,
        'Settings': {...}|[...]|123|123.4|'string'|True|None,
        'Assets': [
            {
                'Category': 'FAVICON_ICO'|'FAVICON_SVG'|'EMAIL_GRAPHIC'|'SMS_GRAPHIC'|'AUTH_APP_GRAPHIC'|'PASSWORD_GRAPHIC'|'PASSKEY_GRAPHIC'|'PAGE_HEADER_LOGO'|'PAGE_HEADER_BACKGROUND'|'PAGE_FOOTER_LOGO'|'PAGE_FOOTER_BACKGROUND'|'PAGE_BACKGROUND'|'FORM_BACKGROUND'|'FORM_LOGO'|'IDP_BUTTON_ICON',
                'ColorMode': 'LIGHT'|'DARK'|'DYNAMIC',
                'Extension': 'ICO'|'JPEG'|'PNG'|'SVG'|'WEBP',
                'Bytes': b'bytes',
                'ResourceId': 'string'
            },
        ],
        'CreationDate': datetime(2015, 1, 1),
        'LastModifiedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ManagedLoginBranding (dict) --

      The details of the branding style that you updated.

      • ManagedLoginBrandingId (string) --

        The ID of the managed login branding style.

      • UserPoolId (string) --

        The user pool where the branding style is assigned.

      • UseCognitoProvidedValues (boolean) --

        When true, applies the default branding style options. This option reverts to a "blank" style that you can modify later in the branding designer.

      • Settings (:ref:`document<document>`) --

        A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.

      • Assets (list) --

        An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.

        • (dict) --

          An image file from a managed login branding style in a user pool.

          This data type is a request parameter of CreateManagedLoginBranding and UpdateManagedLoginBranding, and a response parameter of DescribeManagedLoginBranding.

          • Category (string) --

            The category that the image corresponds to in your managed login configuration. Managed login has asset categories for different types of logos, backgrounds, and icons.

          • ColorMode (string) --

            The display-mode target of the asset: light, dark, or browser-adaptive. For example, Amazon Cognito displays a dark-mode image only when the browser or application is in dark mode, but displays a browser-adaptive file in all contexts.

          • Extension (string) --

            The file type of the image file.

          • Bytes (bytes) --

            The image file, in Base64-encoded binary.

          • ResourceId (string) --

            The ID of the asset.

      • 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.

      • 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.

DeleteManagedLoginBranding (new) Link ¶

Deletes a managed login branding style. When you delete a style, you delete the branding association for an app client and restore it to default settings.

See also: AWS API Documentation

Request Syntax

client.delete_managed_login_branding(
    ManagedLoginBrandingId='string',
    UserPoolId='string'
)
type ManagedLoginBrandingId:

string

param ManagedLoginBrandingId:

[REQUIRED]

The ID of the managed login branding style that you want to delete.

type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the managed login branding style that you want to delete.

returns:

None

DescribeManagedLoginBrandingByClient (new) Link ¶

When given the ID of a user pool app client, returns detailed information about the style assigned to the app client.

See also: AWS API Documentation

Request Syntax

client.describe_managed_login_branding_by_client(
    UserPoolId='string',
    ClientId='string',
    ReturnMergedResources=True|False
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that contains the app client where you want more information about the managed login branding style.

type ClientId:

string

param ClientId:

[REQUIRED]

The app client that's assigned to the branding style that you want more information about.

type ReturnMergedResources:

boolean

param ReturnMergedResources:

When true, returns values for branding options that are unchanged from Amazon Cognito defaults. When false or when you omit this parameter, returns only values that you customized in your branding style.

rtype:

dict

returns:

Response Syntax

{
    'ManagedLoginBranding': {
        'ManagedLoginBrandingId': 'string',
        'UserPoolId': 'string',
        'UseCognitoProvidedValues': True|False,
        'Settings': {...}|[...]|123|123.4|'string'|True|None,
        'Assets': [
            {
                'Category': 'FAVICON_ICO'|'FAVICON_SVG'|'EMAIL_GRAPHIC'|'SMS_GRAPHIC'|'AUTH_APP_GRAPHIC'|'PASSWORD_GRAPHIC'|'PASSKEY_GRAPHIC'|'PAGE_HEADER_LOGO'|'PAGE_HEADER_BACKGROUND'|'PAGE_FOOTER_LOGO'|'PAGE_FOOTER_BACKGROUND'|'PAGE_BACKGROUND'|'FORM_BACKGROUND'|'FORM_LOGO'|'IDP_BUTTON_ICON',
                'ColorMode': 'LIGHT'|'DARK'|'DYNAMIC',
                'Extension': 'ICO'|'JPEG'|'PNG'|'SVG'|'WEBP',
                'Bytes': b'bytes',
                'ResourceId': 'string'
            },
        ],
        'CreationDate': datetime(2015, 1, 1),
        'LastModifiedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ManagedLoginBranding (dict) --

      The details of the requested branding style.

      • ManagedLoginBrandingId (string) --

        The ID of the managed login branding style.

      • UserPoolId (string) --

        The user pool where the branding style is assigned.

      • UseCognitoProvidedValues (boolean) --

        When true, applies the default branding style options. This option reverts to a "blank" style that you can modify later in the branding designer.

      • Settings (:ref:`document<document>`) --

        A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.

      • Assets (list) --

        An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.

        • (dict) --

          An image file from a managed login branding style in a user pool.

          This data type is a request parameter of CreateManagedLoginBranding and UpdateManagedLoginBranding, and a response parameter of DescribeManagedLoginBranding.

          • Category (string) --

            The category that the image corresponds to in your managed login configuration. Managed login has asset categories for different types of logos, backgrounds, and icons.

          • ColorMode (string) --

            The display-mode target of the asset: light, dark, or browser-adaptive. For example, Amazon Cognito displays a dark-mode image only when the browser or application is in dark mode, but displays a browser-adaptive file in all contexts.

          • Extension (string) --

            The file type of the image file.

          • Bytes (bytes) --

            The image file, in Base64-encoded binary.

          • ResourceId (string) --

            The ID of the asset.

      • 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.

      • 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.

DeleteWebAuthnCredential (new) Link ¶

Deletes a registered passkey, or webauthN, device for the currently signed-in user.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

See also: AWS API Documentation

Request Syntax

client.delete_web_authn_credential(
    AccessToken='string',
    CredentialId='string'
)
type AccessToken:

string

param AccessToken:

[REQUIRED]

A valid access token that Amazon Cognito issued to the user whose passkey you want to delete.

type CredentialId:

string

param CredentialId:

[REQUIRED]

The unique identifier of the passkey that you want to delete. Look up registered devices with ListWebAuthnCredentials.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

CreateManagedLoginBranding (new) Link ¶

Creates a new set of branding settings for a user pool style and associates it with an app client. This operation is the programmatic option for the creation of a new style in the branding designer.

Provides values for UI customization in a Settings JSON object and image files in an Assets array. To send the JSON object Document type parameter in Settings, you might need to update to the most recent version of your Amazon Web Services SDK.

This operation has a 2-megabyte request-size limit and include the CSS settings and image assets for your app client. Your branding settings might exceed 2MB in size. Amazon Cognito doesn't require that you pass all parameters in one request and preserves existing style settings that you don't specify. If your request is larger than 2MB, separate it into multiple requests, each with a size smaller than the limit.

For more information, see API and SDK operations for managed login branding

See also: AWS API Documentation

Request Syntax

client.create_managed_login_branding(
    UserPoolId='string',
    ClientId='string',
    UseCognitoProvidedValues=True|False,
    Settings={...}|[...]|123|123.4|'string'|True|None,
    Assets=[
        {
            'Category': 'FAVICON_ICO'|'FAVICON_SVG'|'EMAIL_GRAPHIC'|'SMS_GRAPHIC'|'AUTH_APP_GRAPHIC'|'PASSWORD_GRAPHIC'|'PASSKEY_GRAPHIC'|'PAGE_HEADER_LOGO'|'PAGE_HEADER_BACKGROUND'|'PAGE_FOOTER_LOGO'|'PAGE_FOOTER_BACKGROUND'|'PAGE_BACKGROUND'|'FORM_BACKGROUND'|'FORM_LOGO'|'IDP_BUTTON_ICON',
            'ColorMode': 'LIGHT'|'DARK'|'DYNAMIC',
            'Extension': 'ICO'|'JPEG'|'PNG'|'SVG'|'WEBP',
            'Bytes': b'bytes',
            'ResourceId': 'string'
        },
    ]
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool where you want to create a new branding style.

type ClientId:

string

param ClientId:

[REQUIRED]

The app client that you want to create the branding style for. Each style is permanently linked to an app client. To change the style for an app client, delete the existing style with DeleteManagedLoginBranding and create a new one.

type UseCognitoProvidedValues:

boolean

param UseCognitoProvidedValues:

When true, applies the default branding style options. This option reverts to default style options that are managed by Amazon Cognito. You can modify them later in the branding designer.

When you specify true for this option, you must also omit values for Settings and Assets in the request.

type Settings:

:ref:`document<document>`

param Settings:

A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.

type Assets:

list

param Assets:

An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.

  • (dict) --

    An image file from a managed login branding style in a user pool.

    This data type is a request parameter of CreateManagedLoginBranding and UpdateManagedLoginBranding, and a response parameter of DescribeManagedLoginBranding.

    • Category (string) -- [REQUIRED]

      The category that the image corresponds to in your managed login configuration. Managed login has asset categories for different types of logos, backgrounds, and icons.

    • ColorMode (string) -- [REQUIRED]

      The display-mode target of the asset: light, dark, or browser-adaptive. For example, Amazon Cognito displays a dark-mode image only when the browser or application is in dark mode, but displays a browser-adaptive file in all contexts.

    • Extension (string) -- [REQUIRED]

      The file type of the image file.

    • Bytes (bytes) --

      The image file, in Base64-encoded binary.

    • ResourceId (string) --

      The ID of the asset.

rtype:

dict

returns:

Response Syntax

{
    'ManagedLoginBranding': {
        'ManagedLoginBrandingId': 'string',
        'UserPoolId': 'string',
        'UseCognitoProvidedValues': True|False,
        'Settings': {...}|[...]|123|123.4|'string'|True|None,
        'Assets': [
            {
                'Category': 'FAVICON_ICO'|'FAVICON_SVG'|'EMAIL_GRAPHIC'|'SMS_GRAPHIC'|'AUTH_APP_GRAPHIC'|'PASSWORD_GRAPHIC'|'PASSKEY_GRAPHIC'|'PAGE_HEADER_LOGO'|'PAGE_HEADER_BACKGROUND'|'PAGE_FOOTER_LOGO'|'PAGE_FOOTER_BACKGROUND'|'PAGE_BACKGROUND'|'FORM_BACKGROUND'|'FORM_LOGO'|'IDP_BUTTON_ICON',
                'ColorMode': 'LIGHT'|'DARK'|'DYNAMIC',
                'Extension': 'ICO'|'JPEG'|'PNG'|'SVG'|'WEBP',
                'Bytes': b'bytes',
                'ResourceId': 'string'
            },
        ],
        'CreationDate': datetime(2015, 1, 1),
        'LastModifiedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ManagedLoginBranding (dict) --

      The details of the branding style that you created.

      • ManagedLoginBrandingId (string) --

        The ID of the managed login branding style.

      • UserPoolId (string) --

        The user pool where the branding style is assigned.

      • UseCognitoProvidedValues (boolean) --

        When true, applies the default branding style options. This option reverts to a "blank" style that you can modify later in the branding designer.

      • Settings (:ref:`document<document>`) --

        A JSON file, encoded as a Document type, with the the settings that you want to apply to your style.

      • Assets (list) --

        An array of image files that you want to apply to roles like backgrounds, logos, and icons. Each object must also indicate whether it is for dark mode, light mode, or browser-adaptive mode.

        • (dict) --

          An image file from a managed login branding style in a user pool.

          This data type is a request parameter of CreateManagedLoginBranding and UpdateManagedLoginBranding, and a response parameter of DescribeManagedLoginBranding.

          • Category (string) --

            The category that the image corresponds to in your managed login configuration. Managed login has asset categories for different types of logos, backgrounds, and icons.

          • ColorMode (string) --

            The display-mode target of the asset: light, dark, or browser-adaptive. For example, Amazon Cognito displays a dark-mode image only when the browser or application is in dark mode, but displays a browser-adaptive file in all contexts.

          • Extension (string) --

            The file type of the image file.

          • Bytes (bytes) --

            The image file, in Base64-encoded binary.

          • ResourceId (string) --

            The ID of the asset.

      • 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.

      • 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.

GetUserAuthFactors (new) Link ¶

Lists the authentication options for the currently signed-in user. Returns the following:

  • The user's multi-factor authentication (MFA) preferences.

  • The user's options in the USER_AUTH flow that they can select in a SELECT_CHALLENGE response or request in a ``PREFERRED_CHALLENGE``request.

See also: AWS API Documentation

Request Syntax

client.get_user_auth_factors(
    AccessToken='string'
)
type AccessToken:

string

param AccessToken:

[REQUIRED]

A valid access token that Amazon Cognito issued to the user whose authentication factors you want to view.

rtype:

dict

returns:

Response Syntax

{
    'Username': 'string',
    'PreferredMfaSetting': 'string',
    'UserMFASettingList': [
        'string',
    ],
    'ConfiguredUserAuthFactors': [
        'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN',
    ]
}

Response Structure

  • (dict) --

    • Username (string) --

      The username of the currently sign-in user.

    • PreferredMfaSetting (string) --

      The user's preferred MFA setting.

    • UserMFASettingList (list) --

      The MFA options that are activated for the user. The possible values in this list are SMS_MFA, EMAIL_OTP, and SOFTWARE_TOKEN_MFA.

      • (string) --

    • ConfiguredUserAuthFactors (list) --

      The authentication types that are available to the user with USER_AUTH sign-in.

      • (string) --

ListWebAuthnCredentials (new) Link ¶

Generates a list of the current user's registered passkey, or webauthN, credentials.

See also: AWS API Documentation

Request Syntax

client.list_web_authn_credentials(
    AccessToken='string',
    NextToken='string',
    MaxResults=123
)
type AccessToken:

string

param AccessToken:

[REQUIRED]

A valid access token that Amazon Cognito issued to the user whose registered passkeys you want to list.

type NextToken:

string

param NextToken:

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

type MaxResults:

integer

param MaxResults:

The maximum number of the user's passkey credentials that you want to return.

rtype:

dict

returns:

Response Syntax

{
    'Credentials': [
        {
            'CredentialId': 'string',
            'FriendlyCredentialName': 'string',
            'RelyingPartyId': 'string',
            'AuthenticatorAttachment': 'string',
            'AuthenticatorTransports': [
                'string',
            ],
            'CreatedAt': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Credentials (list) --

      A list of registered passkeys for a user.

      • (dict) --

        The details of a passkey, or webauthN, biometric or security-key authentication factor for a user.

        This data type is a response parameter of ListWebAuthnCredentials.

        • CredentialId (string) --

          The unique identifier of the passkey credential.

        • FriendlyCredentialName (string) --

          An automatically-generated friendly name for the passkey credential.

        • RelyingPartyId (string) --

          The relying-party ID of the provider for the passkey credential.

        • AuthenticatorAttachment (string) --

          The general category of the passkey authenticator. Can be a platform, or on-device authenticator like a built-in fingerprint scanner, or a cross-platform device that's not attached to the device like a Bluetooth security key.

        • AuthenticatorTransports (list) --

          Information about the transport methods of the passkey credential, for example USB or Bluetooth Low Energy.

          • (string) --

        • CreatedAt (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.

    • NextToken (string) --

      An identifier that you can use in a later request to return the next set of items in the list.

CompleteWebAuthnRegistration (new) Link ¶

Completes registration of a passkey authenticator for the current user. Your application provides data from a successful registration request with the data from the output of a StartWebAuthnRegistration.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

See also: AWS API Documentation

Request Syntax

client.complete_web_authn_registration(
    AccessToken='string',
    Credential={...}|[...]|123|123.4|'string'|True|None
)
type AccessToken:

string

param AccessToken:

[REQUIRED]

A valid access token that Amazon Cognito issued to the user whose passkey registration you want to verify.

type Credential:

:ref:`document<document>`

param Credential:

[REQUIRED]

A RegistrationResponseJSON public-key credential response from the user's passkey provider.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

StartWebAuthnRegistration (new) Link ¶

Requests credential creation options from your user pool for registration of a passkey authenticator. Returns information about the user pool, the user profile, and authentication requirements. Users must provide this information in their request to enroll your application with their passkey provider.

After users present this data and register with their passkey provider, return the response to your user pool in a CompleteWebAuthnRegistration API request.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

See also: AWS API Documentation

Request Syntax

client.start_web_authn_registration(
    AccessToken='string'
)
type AccessToken:

string

param AccessToken:

[REQUIRED]

A valid access token that Amazon Cognito issued to the user whose passkey metadata you want to generate.

rtype:

dict

returns:

Response Syntax

{
    'CredentialCreationOptions': {...}|[...]|123|123.4|'string'|True|None
}

Response Structure

  • (dict) --

    • CredentialCreationOptions (:ref:`document<document>`) --

      The information that a user can provide in their request to register with their passkey provider.

AdminInitiateAuth (updated) Link ¶
Changes (request, response)
Request
{'AuthFlow': {'USER_AUTH'}, 'Session': 'string'}
Response
{'ChallengeName': {'PASSWORD',
                   'PASSWORD_SRP',
                   'SELECT_CHALLENGE',
                   'SMS_OTP',
                   'WEB_AUTHN'}}

Initiates the authentication flow, as an administrator.

See also: AWS API Documentation

Request Syntax

client.admin_initiate_auth(
    UserPoolId='string',
    ClientId='string',
    AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'USER_PASSWORD_AUTH'|'ADMIN_USER_PASSWORD_AUTH'|'USER_AUTH',
    AuthParameters={
        'string': 'string'
    },
    ClientMetadata={
        'string': 'string'
    },
    AnalyticsMetadata={
        'AnalyticsEndpointId': 'string'
    },
    ContextData={
        'IpAddress': 'string',
        'ServerName': 'string',
        'ServerPath': 'string',
        'HttpHeaders': [
            {
                'headerName': 'string',
                'headerValue': 'string'
            },
        ],
        'EncodedData': 'string'
    },
    Session='string'
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the Amazon Cognito user pool.

type ClientId:

string

param ClientId:

[REQUIRED]

The app client ID.

type AuthFlow:

string

param AuthFlow:

[REQUIRED]

The authentication flow that you want to initiate. The AuthParameters that you must submit are linked to the flow that you submit. For example:

  • USER_AUTH: Request a preferred authentication type or review available authentication types. From the offered authentication types, select one in a challenge response and then authenticate with that method in an additional challenge response.

  • REFRESH_TOKEN_AUTH: Receive new ID and access tokens when you pass a REFRESH_TOKEN parameter with a valid refresh token as the value.

  • USER_SRP_AUTH: Receive secure remote password (SRP) variables for the next challenge, PASSWORD_VERIFIER, when you pass USERNAME and SRP_A parameters..

  • ADMIN_USER_PASSWORD_AUTH: Receive new tokens or the next challenge, for example SOFTWARE_TOKEN_MFA, when you pass USERNAME and PASSWORD parameters.

Valid values include the following:

USER_AUTH

The entry point for sign-in with passwords, one-time passwords, biometric devices, and security keys.

USER_SRP_AUTH

Username-password authentication with the Secure Remote Password (SRP) protocol. For more information, see Use SRP password verification in custom authentication flow.

REFRESH_TOKEN_AUTH and REFRESH_TOKEN

Provide a valid refresh token and receive new ID and access tokens. For more information, see Using the refresh token.

CUSTOM_AUTH

Custom authentication with Lambda triggers. For more information, see Custom authentication challenge Lambda triggers.

ADMIN_USER_PASSWORD_AUTH

Username-password authentication with the password sent directly in the request. For more information, see Admin authentication flow.

USER_PASSWORD_AUTH is a flow type of InitiateAuth and isn't valid for AdminInitiateAuth.

type AuthParameters:

dict

param AuthParameters:

The authentication parameters. These are inputs corresponding to the AuthFlow that you're invoking. The required values depend on the value of AuthFlow:

  • For USER_AUTH: USERNAME (required), PREFERRED_CHALLENGE. If you don't provide a value for PREFERRED_CHALLENGE, Amazon Cognito responds with the AvailableChallenges parameter that specifies the available sign-in methods.

  • For USER_SRP_AUTH: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

  • For ADMIN_USER_PASSWORD_AUTH: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

  • For REFRESH_TOKEN_AUTH/REFRESH_TOKEN: REFRESH_TOKEN (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

  • For CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY. To start the authentication flow with password verification, include ChallengeName: SRP_A and SRP_A: (The SRP_A Value).

For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.

  • (string) --

    • (string) --

type ClientMetadata:

dict

param ClientMetadata:

A map of custom key-value pairs that you can provide as input for certain custom workflows that this action triggers.

You create custom workflows by assigning Lambda functions to user pool triggers. When you use the AdminInitiateAuth API action, Amazon Cognito invokes the Lambda functions that are specified for various triggers. The ClientMetadata value is passed as input to the functions for only the following triggers:

  • Pre signup

  • Pre authentication

  • User migration

When Amazon Cognito invokes the functions for these triggers, it passes a JSON payload, which the function receives as input. This payload contains a validationData attribute, which provides the data that you assigned to the ClientMetadata parameter in your AdminInitiateAuth request. In your function code in Lambda, you can process the validationData value to enhance your workflow for your specific needs.

When you use the AdminInitiateAuth API action, Amazon Cognito also invokes the functions for the following triggers, but it doesn't provide the ClientMetadata value as input:

  • Post authentication

  • Custom message

  • Pre token generation

  • Create auth challenge

  • Define auth challenge

  • Custom email sender

  • Custom SMS sender

For more information, see Customizing user pool Workflows with Lambda Triggers in the Amazon Cognito Developer Guide.

  • (string) --

    • (string) --

type AnalyticsMetadata:

dict

param AnalyticsMetadata:

The analytics metadata for collecting Amazon Pinpoint metrics for AdminInitiateAuth calls.

  • AnalyticsEndpointId (string) --

    The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications.

type ContextData:

dict

param ContextData:

Contextual data about your user session, such as the device fingerprint, IP address, or location. Amazon Cognito advanced security evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

  • IpAddress (string) -- [REQUIRED]

    The source IP address of your user's device.

  • ServerName (string) -- [REQUIRED]

    The name of your application's service endpoint.

  • ServerPath (string) -- [REQUIRED]

    The path of your application's service endpoint.

  • HttpHeaders (list) -- [REQUIRED]

    The HTTP headers from your user's authentication request.

    • (dict) --

      The HTTP header in the ContextData parameter.

      This data type is a request parameter of server-side authentication operations like AdminInitiateAuth and AdminRespondToAuthChallenge.

      • headerName (string) --

        The header name.

      • headerValue (string) --

        The header value.

  • EncodedData (string) --

    Encoded device-fingerprint details that your app collected with the Amazon Cognito context data collection library. For more information, see Adding user device and session data to API requests.

type Session:

string

param Session:

The optional session ID from a ConfirmSignUp API request. You can sign in a user directly from the sign-up process with the USER_AUTH authentication flow.

rtype:

dict

returns:

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'EMAIL_OTP'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'SELECT_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED'|'SMS_OTP'|'PASSWORD'|'WEB_AUTHN'|'PASSWORD_SRP',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Initiates the authentication response, as an administrator.

    • ChallengeName (string) --

      The name of the challenge that you're responding to with this call. This is returned in the AdminInitiateAuth response if you must pass another challenge.

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a passkey, or webauthN, factor. These are typically biometric devices or security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • MFA_SETUP: If MFA is required, users who don't have at least one of the MFA methods set up are presented with an MFA_SETUP challenge. The user must set up at least one MFA type to continue to authenticate.

      • SELECT_MFA_TYPE: Selects the MFA type. Valid MFA options are SMS_MFA for SMS message MFA, EMAIL_OTP for email message MFA, and SOFTWARE_TOKEN_MFA for time-based one-time password (TOTP) software token MFA.

      • SMS_MFA: Next challenge is to supply an ``SMS_MFA_CODE``that your user pool delivered in an SMS message.

      • EMAIL_OTP: Next challenge is to supply an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Next challenge is to supply PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after the client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued.

      • DEVICE_SRP_AUTH: If device tracking was activated in your user pool and the previous challenges were passed, this challenge is returned so that Amazon Cognito can start tracking this device.

      • DEVICE_PASSWORD_VERIFIER: Similar to PASSWORD_VERIFIER, but for devices only.

      • ADMIN_NO_SRP_AUTH: This is returned if you must authenticate with USERNAME and PASSWORD directly. An app client must be enabled to use this flow.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren't required by your user pool and that your app client can write. For more information, see AdminRespondToAuthChallenge. Amazon Cognito only returns this challenge for users who have temporary passwords. Because of this, and because in some cases you can create users who don't have values for required attributes, take care to collect and submit required-attribute values for all users who don't have passwords. You can create a user in the Amazon Cognito console without, for example, a required birthdate attribute. The API response from Amazon Cognito won't prompt you to submit a birthdate for the user if they don't have a password.

      • MFA_SETUP: For users who are required to set up an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value. To set up software token MFA, use the session returned here from InitiateAuth as an input to AssociateSoftwareToken, and use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in. To set up SMS MFA, users will need help from an administrator to add a phone number to their account and then call InitiateAuth again to restart sign-in.

    • Session (string) --

      The session that should be passed both ways in challenge-response calls to the service. If AdminInitiateAuth or AdminRespondToAuthChallenge API call determines that the caller must pass another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next AdminRespondToAuthChallenge API call.

    • ChallengeParameters (dict) --

      The challenge parameters. These are returned to you in the AdminInitiateAuth response if you must pass another challenge. The responses in this parameter should be used to compute inputs to the next call ( AdminRespondToAuthChallenge).

      All challenges require USERNAME and SECRET_HASH (if applicable).

      The value of the USER_ID_FOR_SRP attribute is the user's actual username, not an alias (such as email address or phone number), even if you specified an alias in your call to AdminInitiateAuth. This happens because, in the AdminRespondToAuthChallenge API ChallengeResponses, the USERNAME attribute can't be an alias.

      • (string) --

        • (string) --

    • AuthenticationResult (dict) --

      The result of the authentication response. This is only returned if the caller doesn't need to pass another challenge. If the caller does need to pass another challenge before it gets tokens, ChallengeName, ChallengeParameters, and Session are returned.

      • AccessToken (string) --

        Your user's access token.

      • ExpiresIn (integer) --

        The expiration period of the authentication result in seconds.

      • TokenType (string) --

        The intended use of the token, for example Bearer.

      • RefreshToken (string) --

        Your user's refresh token.

      • IdToken (string) --

        Your user's ID token.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

        • DeviceGroupKey (string) --

          The device group key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

AdminRespondToAuthChallenge (updated) Link ¶
Changes (both)
{'ChallengeName': {'PASSWORD',
                   'PASSWORD_SRP',
                   'SELECT_CHALLENGE',
                   'SMS_OTP',
                   'WEB_AUTHN'}}

Some API operations in a user pool generate a challenge, like a prompt for an MFA code, for device authentication that bypasses MFA, or for a custom authentication challenge. An AdminRespondToAuthChallenge API request provides the answer to that challenge, like a code or a secure remote password (SRP). The parameters of a response to an authentication challenge vary with the type of challenge.

For more information about custom authentication challenges, see Custom authentication challenge Lambda triggers.

See also: AWS API Documentation

Request Syntax

client.admin_respond_to_auth_challenge(
    UserPoolId='string',
    ClientId='string',
    ChallengeName='SMS_MFA'|'EMAIL_OTP'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'SELECT_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED'|'SMS_OTP'|'PASSWORD'|'WEB_AUTHN'|'PASSWORD_SRP',
    ChallengeResponses={
        'string': 'string'
    },
    Session='string',
    AnalyticsMetadata={
        'AnalyticsEndpointId': 'string'
    },
    ContextData={
        'IpAddress': 'string',
        'ServerName': 'string',
        'ServerPath': 'string',
        'HttpHeaders': [
            {
                'headerName': 'string',
                'headerValue': 'string'
            },
        ],
        'EncodedData': 'string'
    },
    ClientMetadata={
        'string': 'string'
    }
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the Amazon Cognito user pool.

type ClientId:

string

param ClientId:

[REQUIRED]

The app client ID.

type ChallengeName:

string

param ChallengeName:

[REQUIRED]

The challenge name. For more information, see AdminInitiateAuth.

type ChallengeResponses:

dict

param ChallengeResponses:

The responses to the challenge that you received in the previous request. Each challenge has its own required response parameters. The following examples are partial JSON request bodies that highlight challenge-response parameters.

"ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "USERNAME": "[username]", "ANSWER": "[Challenge name]"}

Available challenges are PASSWORD, PASSWORD_SRP, EMAIL_OTP, SMS_OTP, and WEB_AUTHN.

Complete authentication in the SELECT_CHALLENGE response for PASSWORD, PASSWORD_SRP, and WEB_AUTHN:

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "WEB_AUTHN", "USERNAME": "[username]", "CREDENTIAL": "[AuthenticationResponseJSON]"} See AuthenticationResponseJSON.

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "PASSWORD", "USERNAME": "[username]", "PASSWORD": "[password]"}

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "PASSWORD_SRP", "USERNAME": "[username]", "SRP_A": "[SRP_A]"}

For SMS_OTP and EMAIL_OTP, respond with the username and answer. Your user pool will send a code for the user to submit in the next challenge response.

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "SMS_OTP", "USERNAME": "[username]"}

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "EMAIL_OTP", "USERNAME": "[username]"}

    SMS_OTP

"ChallengeName": "SMS_OTP", "ChallengeResponses": {"SMS_OTP_CODE": "[code]", "USERNAME": "[username]"}

EMAIL_OTP

"ChallengeName": "EMAIL_OTP", "ChallengeResponses": {"EMAIL_OTP_CODE": "[code]", "USERNAME": "[username]"}

SMS_MFA

"ChallengeName": "SMS_MFA", "ChallengeResponses": {"SMS_MFA_CODE": "[code]", "USERNAME": "[username]"}

PASSWORD_VERIFIER

This challenge response is part of the SRP flow. Amazon Cognito requires that your application respond to this challenge within a few seconds. When the response time exceeds this period, your user pool returns a NotAuthorizedException error.

"ChallengeName": "PASSWORD_VERIFIER", "ChallengeResponses": {"PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], "USERNAME": "[username]"}

Add "DEVICE_KEY" when you sign in with a remembered device.

CUSTOM_CHALLENGE

"ChallengeName": "CUSTOM_CHALLENGE", "ChallengeResponses": {"USERNAME": "[username]", "ANSWER": "[challenge_answer]"}

Add "DEVICE_KEY" when you sign in with a remembered device.

NEW_PASSWORD_REQUIRED

"ChallengeName": "NEW_PASSWORD_REQUIRED", "ChallengeResponses": {"NEW_PASSWORD": "[new_password]", "USERNAME": "[username]"}

To set any required attributes that InitiateAuth returned in an requiredAttributes parameter, add "userAttributes.[attribute_name]": "[attribute_value]". This parameter can also set values for writable attributes that aren't required by your user pool.

"ChallengeName": "SOFTWARE_TOKEN_MFA", "ChallengeResponses": {"USERNAME": "[username]", "SOFTWARE_TOKEN_MFA_CODE": [authenticator_code]}

DEVICE_SRP_AUTH

"ChallengeName": "DEVICE_SRP_AUTH", "ChallengeResponses": {"USERNAME": "[username]", "DEVICE_KEY": "[device_key]", "SRP_A": "[srp_a]"}

DEVICE_PASSWORD_VERIFIER

"ChallengeName": "DEVICE_PASSWORD_VERIFIER", "ChallengeResponses": {"DEVICE_KEY": "[device_key]", "PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], "USERNAME": "[username]"}

MFA_SETUP

"ChallengeName": "MFA_SETUP", "ChallengeResponses": {"USERNAME": "[username]"}, "SESSION": "[Session ID from VerifySoftwareToken]"

SELECT_MFA_TYPE

"ChallengeName": "SELECT_MFA_TYPE", "ChallengeResponses": {"USERNAME": "[username]", "ANSWER": "[SMS_MFA or SOFTWARE_TOKEN_MFA]"}

For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.

  • (string) --

    • (string) --

type Session:

string

param Session:

The session that should be passed both ways in challenge-response calls to the service. If an InitiateAuth or RespondToAuthChallenge API call determines that the caller must pass another challenge, it returns a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.

type AnalyticsMetadata:

dict

param AnalyticsMetadata:

The analytics metadata for collecting Amazon Pinpoint metrics for AdminRespondToAuthChallenge calls.

  • AnalyticsEndpointId (string) --

    The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications.

type ContextData:

dict

param ContextData:

Contextual data about your user session, such as the device fingerprint, IP address, or location. Amazon Cognito advanced security evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

  • IpAddress (string) -- [REQUIRED]

    The source IP address of your user's device.

  • ServerName (string) -- [REQUIRED]

    The name of your application's service endpoint.

  • ServerPath (string) -- [REQUIRED]

    The path of your application's service endpoint.

  • HttpHeaders (list) -- [REQUIRED]

    The HTTP headers from your user's authentication request.

    • (dict) --

      The HTTP header in the ContextData parameter.

      This data type is a request parameter of server-side authentication operations like AdminInitiateAuth and AdminRespondToAuthChallenge.

      • headerName (string) --

        The header name.

      • headerValue (string) --

        The header value.

  • EncodedData (string) --

    Encoded device-fingerprint details that your app collected with the Amazon Cognito context data collection library. For more information, see Adding user device and session data to API requests.

type ClientMetadata:

dict

param ClientMetadata:

A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

You create custom workflows by assigning Lambda functions to user pool triggers. When you use the AdminRespondToAuthChallenge API action, Amazon Cognito invokes any functions that you have assigned to the following triggers:

  • pre sign-up

  • custom message

  • post authentication

  • user migration

  • pre token generation

  • define auth challenge

  • create auth challenge

  • verify auth challenge response

When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute that provides the data that you assigned to the ClientMetadata parameter in your AdminRespondToAuthChallenge request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

For more information, see Customizing user pool Workflows with Lambda Triggers in the Amazon Cognito Developer Guide.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'EMAIL_OTP'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'SELECT_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED'|'SMS_OTP'|'PASSWORD'|'WEB_AUTHN'|'PASSWORD_SRP',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    }
}

Response Structure

  • (dict) --

    Responds to the authentication challenge, as an administrator.

    • ChallengeName (string) --

      The name of the challenge. For more information, see AdminInitiateAuth.

    • Session (string) --

      The session that should be passed both ways in challenge-response calls to the service. If the caller must pass another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.

    • ChallengeParameters (dict) --

      The challenge parameters. For more information, see AdminInitiateAuth.

      • (string) --

        • (string) --

    • AuthenticationResult (dict) --

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

      • AccessToken (string) --

        Your user's access token.

      • ExpiresIn (integer) --

        The expiration period of the authentication result in seconds.

      • TokenType (string) --

        The intended use of the token, for example Bearer.

      • RefreshToken (string) --

        Your user's refresh token.

      • IdToken (string) --

        Your user's ID token.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

        • DeviceGroupKey (string) --

          The device group key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

ConfirmSignUp (updated) Link ¶
Changes (both)
{'Session': 'string'}

This public API operation provides a code that Amazon Cognito sent to your user when they signed up in your user pool via the SignUp API operation. After your user enters their code, they confirm ownership of the email address or phone number that they provided, and their user account becomes active. Depending on your user pool configuration, your users will receive their confirmation code in an email or SMS message.

Local users who signed up in your user pool are the only type of user who can confirm sign-up with a code. Users who federate through an external identity provider (IdP) have already been confirmed by their IdP. Administrator-created users, users created with the AdminCreateUser API operation, confirm their accounts when they respond to their invitation email message and choose a password. They do not receive a confirmation code. Instead, they receive a temporary password.

See also: AWS API Documentation

Request Syntax

client.confirm_sign_up(
    ClientId='string',
    SecretHash='string',
    Username='string',
    ConfirmationCode='string',
    ForceAliasCreation=True|False,
    AnalyticsMetadata={
        'AnalyticsEndpointId': 'string'
    },
    UserContextData={
        'IpAddress': 'string',
        'EncodedData': 'string'
    },
    ClientMetadata={
        'string': 'string'
    },
    Session='string'
)
type ClientId:

string

param ClientId:

[REQUIRED]

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

type SecretHash:

string

param SecretHash:

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

type Username:

string

param Username:

[REQUIRED]

The username of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If username isn't an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.

type ConfirmationCode:

string

param ConfirmationCode:

[REQUIRED]

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

type ForceAliasCreation:

boolean

param ForceAliasCreation:

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

type AnalyticsMetadata:

dict

param AnalyticsMetadata:

The Amazon Pinpoint analytics metadata for collecting metrics for ConfirmSignUp calls.

  • AnalyticsEndpointId (string) --

    The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications.

type UserContextData:

dict

param UserContextData:

Contextual data about your user session, such as the device fingerprint, IP address, or location. Amazon Cognito advanced security evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

  • IpAddress (string) --

    The source IP address of your user's device.

  • EncodedData (string) --

    Encoded device-fingerprint details that your app collected with the Amazon Cognito context data collection library. For more information, see Adding user device and session data to API requests.

type ClientMetadata:

dict

param ClientMetadata:

A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

You create custom workflows by assigning Lambda functions to user pool triggers. When you use the ConfirmSignUp API action, Amazon Cognito invokes the function that is assigned to the post confirmation trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your ConfirmSignUp request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

For more information, see Customizing user pool Workflows with Lambda Triggers in the Amazon Cognito Developer Guide.

  • (string) --

    • (string) --

type Session:

string

param Session:

The optional session ID from a SignUp API request. You can sign in a user directly from the sign-up process with the USER_AUTH authentication flow.

rtype:

dict

returns:

Response Syntax

{
    'Session': 'string'
}

Response Structure

  • (dict) --

    Represents the response from the server for the registration confirmation.

    • Session (string) --

      You can automatically sign users in with the one-time password that they provided in a successful ConfirmSignUp request. To do this, pass the Session parameter from the ConfirmSignUp response in the Session parameter of an InitiateAuth or AdminInitiateAuth request.

CreateUserPool (updated) Link ¶
Changes (request, response)
Request
{'Policies': {'SignInPolicy': {'AllowedFirstAuthFactors': ['PASSWORD | '
                                                           'EMAIL_OTP | '
                                                           'SMS_OTP | '
                                                           'WEB_AUTHN']}},
 'UserPoolTier': 'LITE | ESSENTIALS | PLUS'}
Response
{'UserPool': {'Policies': {'SignInPolicy': {'AllowedFirstAuthFactors': ['PASSWORD '
                                                                        '| '
                                                                        'EMAIL_OTP '
                                                                        '| '
                                                                        'SMS_OTP '
                                                                        '| '
                                                                        'WEB_AUTHN']}},
              'UserPoolTier': 'LITE | ESSENTIALS | PLUS'}}

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

See also: AWS API Documentation

Request Syntax

client.create_user_pool(
    PoolName='string',
    Policies={
        'PasswordPolicy': {
            'MinimumLength': 123,
            'RequireUppercase': True|False,
            'RequireLowercase': True|False,
            'RequireNumbers': True|False,
            'RequireSymbols': True|False,
            'PasswordHistorySize': 123,
            'TemporaryPasswordValidityDays': 123
        },
        'SignInPolicy': {
            'AllowedFirstAuthFactors': [
                'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN',
            ]
        }
    },
    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',
            'LambdaArn': 'string'
        },
        'CustomSMSSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'CustomEmailSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'KMSKeyID': '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'
    },
    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'
        }
    },
    UsernameConfiguration={
        'CaseSensitive': True|False
    },
    AccountRecoverySetting={
        'RecoveryMechanisms': [
            {
                'Priority': 123,
                'Name': 'verified_email'|'verified_phone_number'|'admin_only'
            },
        ]
    },
    UserPoolTier='LITE'|'ESSENTIALS'|'PLUS'
)
type PoolName:

string

param PoolName:

[REQUIRED]

A string used to name the user pool.

type Policies:

dict

param Policies:

The policies associated with the new user pool.

  • PasswordPolicy (dict) --

    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.

      Password history isn't enforced and isn't displayed in DescribeUserPool responses when you set this value to 0 or don't provide it. To activate this setting, advanced security features must be active in your user pool.

    • 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.

type AutoVerifiedAttributes:

list

param AutoVerifiedAttributes:

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

  • (string) --

type AliasAttributes:

list

param AliasAttributes:

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

  • (string) --

type UsernameAttributes:

list

param UsernameAttributes:

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

  • (string) --

type SmsVerificationMessage:

string

param SmsVerificationMessage:

This parameter is no longer used. See VerificationMessageTemplateType.

type EmailVerificationMessage:

string

param EmailVerificationMessage:

This parameter is no longer used. See VerificationMessageTemplateType.

type EmailVerificationSubject:

string

param EmailVerificationSubject:

This parameter is no longer used. See VerificationMessageTemplateType.

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:

A string representing the SMS authentication message.

type MfaConfiguration:

string

param MfaConfiguration:

Specifies MFA configuration details.

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.

    You can verify an updated email address or phone number with a VerifyUserAttribute API request. You can also call the AdminUpdateUserAttributes API and set email_verified or phone_number_verified to true.

    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. 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 SMS configuration with the settings that your Amazon Cognito user pool must use to send an SMS message from your Amazon Web Services account through 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) -- [REQUIRED]

    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.

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 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. Configure the duration of temporary passwords with the TemporaryPasswordValidityDays parameter of PasswordPolicyType. For older user pools that have a UnusedAccountValidityDays configuration, that value is effective until you set a value for TemporaryPasswordValidityDays.

    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 schema attributes for the new user pool. These attributes can be standard or custom 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.

    This data type is a request and response parameter of CreateUserPool and UpdateUserPool, and a response parameter of DescribeUserPool.

    • 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:

User pool add-ons. Contains settings for activation of advanced security features. To log user security information but take no action, set to AUDIT. To configure automatic security responses to risky traffic to your user pool, set to ENFORCED.

For more information, see Adding advanced security to a user pool.

  • AdvancedSecurityMode (string) -- [REQUIRED]

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

  • AdvancedSecurityAdditionalFlows (dict) --

    Advanced security configuration options for additional authentication types in your user pool, including custom authentication.

type UsernameConfiguration:

dict

param UsernameConfiguration:

Case sensitivity on 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.

This configuration is immutable after you set it. For more information, see UsernameConfigurationType.

  • 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. 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.

      This data type is a request and response parameter of CreateUserPool and UpdateUserPool, and a response parameter of DescribeUserPool.

      • 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.

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',
                ]
            }
        },
        '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',
                'LambdaArn': 'string'
            },
            'CustomSMSSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'CustomEmailSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'KMSKeyID': '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'
        },
        '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'
            }
        },
        'UsernameConfiguration': {
            'CaseSensitive': True|False
        },
        'Arn': 'string',
        'AccountRecoverySetting': {
            'RecoveryMechanisms': [
                {
                    'Priority': 123,
                    'Name': 'verified_email'|'verified_phone_number'|'admin_only'
                },
            ]
        },
        'UserPoolTier': 'LITE'|'ESSENTIALS'|'PLUS'
    }
}

Response Structure

  • (dict) --

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

    • UserPool (dict) --

      A container for the user pool details.

      • Id (string) --

        The ID of the user pool.

      • Name (string) --

        The name of the user pool.

      • Policies (dict) --

        A 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.

            Password history isn't enforced and isn't displayed in DescribeUserPool responses when you set this value to 0 or don't provide it. To activate this setting, advanced security features must be active in your user pool.

          • 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.

      • 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.

          This data type is a request and response parameter of CreateUserPool and UpdateUserPool, and a response parameter of DescribeUserPool.

          • 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. See VerificationMessageTemplateType.

      • EmailVerificationMessage (string) --

        This parameter is no longer used. See VerificationMessageTemplateType.

      • EmailVerificationSubject (string) --

        This parameter is no longer used. See VerificationMessageTemplateType.

      • 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.

          You can verify an updated email address or phone number with a VerifyUserAttribute API request. You can also call the AdminUpdateUserAttributes API and set email_verified or phone_number_verified to true.

          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.

      • 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. Configure the duration of temporary passwords with the TemporaryPasswordValidityDays parameter of PasswordPolicyType. For older user pools that have a UnusedAccountValidityDays configuration, that value is effective until you set a value for TemporaryPasswordValidityDays.

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

        User pool add-ons. Contains settings for activation of advanced security features. To log user security information but take no action, set to AUDIT. To configure automatic security responses to risky traffic to your user pool, set to ENFORCED.

        For more information, see Adding advanced security to a user pool.

        • AdvancedSecurityMode (string) --

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

        • AdvancedSecurityAdditionalFlows (dict) --

          Advanced security configuration options for additional authentication types in your user pool, including custom authentication.

      • 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.

        This configuration is immutable after you set it. For more information, see UsernameConfigurationType.

        • 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.

            This data type is a request and response parameter of CreateUserPool and UpdateUserPool, and a response parameter of DescribeUserPool.

            • 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.

CreateUserPoolClient (updated) Link ¶
Changes (request, response)
Request
{'ExplicitAuthFlows': {'ALLOW_USER_AUTH'}}
Response
{'UserPoolClient': {'ExplicitAuthFlows': {'ALLOW_USER_AUTH'}}}

Creates the user pool client.

When you create a new user pool client, token revocation is automatically activated. For more information about revoking tokens, see RevokeToken.

See also: AWS API Documentation

Request Syntax

client.create_user_pool_client(
    UserPoolId='string',
    ClientName='string',
    GenerateSecret=True|False,
    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
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

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

type ClientName:

string

param ClientName:

[REQUIRED]

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

type GenerateSecret:

boolean

param GenerateSecret:

Boolean to specify whether you want to generate a secret for the user pool client being created.

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 in which the validity times are represented. The default unit for RefreshToken is days, and 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. An example of this kind of activity is when your user selects a link to view their profile information. Your app makes a GetUser API request to retrieve and display your user's profile data.

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. An example of this kind of activity is when you present your user with a form to update their profile information and they change their last name. Your app then makes an UpdateUserAttributes API request and sets family_name to the new value.

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.

Valid values include:

  • 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.

  • 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 setting applies to providers that you can access with the hosted UI and OAuth 2.0 authorization server. 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 API-based authentication is to block access with a WAF rule.

  • (string) --

type CallbackURLs:

list

param CallbackURLs:

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 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 the IdPs.

  • (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.

A redirect URI must:

  • Be an absolute URI.

  • Be registered with the authorization server.

  • Not include a fragment component.

For more information, see Default redirect URI.

Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.

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

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 allowed OAuth scopes. Possible values provided by OAuth are phone, email, openid, and profile. Possible values provided by Amazon Web Services are aws.cognito.signin.user.admin. Custom scopes created in Resource Servers are also supported.

  • (string) --

type AllowedOAuthFlowsUserPoolClient:

boolean

param AllowedOAuthFlowsUserPoolClient:

Set to true to use OAuth 2.0 features in your user pool app client.

AllowedOAuthFlowsUserPoolClient must be 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 OAuth 2.0 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.

type AnalyticsConfiguration:

dict

param AnalyticsConfiguration:

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.

type PreventUserExistenceErrors:

string

param PreventUserExistenceErrors:

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.

Valid values include:

  • ENABLED - This prevents user existence-related errors.

  • LEGACY - This represents the early behavior of Amazon Cognito where user existence related errors aren't prevented.

Defaults to LEGACY when you don't provide a value.

type EnableTokenRevocation:

boolean

param EnableTokenRevocation:

Activates or deactivates token revocation. For more information about revoking tokens, see RevokeToken.

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

type EnablePropagateAdditionalUserContextData:

boolean

param EnablePropagateAdditionalUserContextData:

Activates the propagation of additional user context data. For more information about propagation of user context data, see Adding advanced security to a user pool. If you don’t include this parameter, you can't send device fingerprint information, including source IP address, to Amazon Cognito advanced security. 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.

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

Response Structure

  • (dict) --

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

    • UserPoolClient (dict) --

      The user pool client that was just created.

      • UserPoolId (string) --

        The 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. An example of this kind of activity is when your user selects a link to view their profile information. Your app makes a GetUser API request to retrieve and display your user's profile data.

        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. An example of this kind of activity is when you present your user with a form to update their profile information and they change their last name. Your app then makes an UpdateUserAttributes API request and sets family_name to the new value.

        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.

        Valid values include:

        • 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.

        • 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 setting applies to providers that you can access with the hosted UI and OAuth 2.0 authorization server. 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 API-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 except for http://localhost for testing purposes only.

        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 except for http://localhost for testing purposes only.

        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 features in your user pool app client.

        AllowedOAuthFlowsUserPoolClient must be 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 OAuth 2.0 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.

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

        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.

        Valid values include:

        • ENABLED - This prevents user existence-related errors.

        • LEGACY - This represents the early behavior of Amazon Cognito where user existence related errors aren't prevented.

        Defaults to LEGACY when you don't provide a value.

      • 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. For more information about revoking tokens, see RevokeToken.

      • 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 advanced security 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 advanced security 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.

CreateUserPoolDomain (updated) Link ¶
Changes (both)
{'ManagedLoginVersion': 'integer'}

Creates a new domain for a user pool. The domain hosts user pool domain services like managed login, the hosted UI (classic), and the user pool authorization server.

See also: AWS API Documentation

Request Syntax

client.create_user_pool_domain(
    Domain='string',
    UserPoolId='string',
    ManagedLoginVersion=123,
    CustomDomainConfig={
        'CertificateArn': 'string'
    }
)
type Domain:

string

param Domain:

[REQUIRED]

The domain string. For custom domains, this is the fully-qualified domain name, such as auth.example.com. For Amazon Cognito prefix domains, this is the prefix alone, such as auth.

type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool where you want to add a domain.

type ManagedLoginVersion:

integer

param ManagedLoginVersion:

The version of managed login branding that you want to apply to your domain. A value of 1 indicates hosted UI (classic) branding and a version of 2 indicates managed login branding.

Managed login requires that your user pool be configured for any feature plan other than Lite.

type CustomDomainConfig:

dict

param CustomDomainConfig:

The configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.

Provide this parameter only if you want to use a custom domain for your user pool. Otherwise, you can exclude this parameter and use the Amazon Cognito hosted domain instead.

For more information about the hosted domain and custom domains, see Configuring a User Pool Domain.

  • CertificateArn (string) -- [REQUIRED]

    The Amazon Resource Name (ARN) of an Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.

rtype:

dict

returns:

Response Syntax

{
    'ManagedLoginVersion': 123,
    'CloudFrontDomain': 'string'
}

Response Structure

  • (dict) --

    • ManagedLoginVersion (integer) --

      The version of managed login branding applied your domain. A value of 1 indicates hosted UI (classic) branding and a version of 2 indicates managed login branding.

    • CloudFrontDomain (string) --

      The Amazon CloudFront endpoint that you use as the target of the alias that you set up with your Domain Name Service (DNS) provider. Amazon Cognito returns this value if you set a custom domain with CustomDomainConfig. If you set an Amazon Cognito prefix domain, this operation returns a blank response.

DescribeUserPool (updated) Link ¶
Changes (response)
{'UserPool': {'Policies': {'SignInPolicy': {'AllowedFirstAuthFactors': ['PASSWORD '
                                                                        '| '
                                                                        'EMAIL_OTP '
                                                                        '| '
                                                                        'SMS_OTP '
                                                                        '| '
                                                                        'WEB_AUTHN']}},
              'UserPoolTier': 'LITE | ESSENTIALS | PLUS'}}

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

See also: AWS API Documentation

Request Syntax

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

string

param UserPoolId:

[REQUIRED]

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

rtype:

dict

returns:

Response Syntax

{
    'UserPool': {
        'Id': 'string',
        'Name': 'string',
        'Policies': {
            'PasswordPolicy': {
                'MinimumLength': 123,
                'RequireUppercase': True|False,
                'RequireLowercase': True|False,
                'RequireNumbers': True|False,
                'RequireSymbols': True|False,
                'PasswordHistorySize': 123,
                'TemporaryPasswordValidityDays': 123
            },
            'SignInPolicy': {
                'AllowedFirstAuthFactors': [
                    'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN',
                ]
            }
        },
        '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',
                'LambdaArn': 'string'
            },
            'CustomSMSSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'CustomEmailSender': {
                'LambdaVersion': 'V1_0',
                'LambdaArn': 'string'
            },
            'KMSKeyID': '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'
        },
        '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'
            }
        },
        'UsernameConfiguration': {
            'CaseSensitive': True|False
        },
        'Arn': 'string',
        'AccountRecoverySetting': {
            'RecoveryMechanisms': [
                {
                    'Priority': 123,
                    'Name': 'verified_email'|'verified_phone_number'|'admin_only'
                },
            ]
        },
        'UserPoolTier': 'LITE'|'ESSENTIALS'|'PLUS'
    }
}

Response Structure

  • (dict) --

    Represents the response to describe the user pool.

    • UserPool (dict) --

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

      • Id (string) --

        The ID of the user pool.

      • Name (string) --

        The name of the user pool.

      • Policies (dict) --

        A 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.

            Password history isn't enforced and isn't displayed in DescribeUserPool responses when you set this value to 0 or don't provide it. To activate this setting, advanced security features must be active in your user pool.

          • 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.

      • 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.

          This data type is a request and response parameter of CreateUserPool and UpdateUserPool, and a response parameter of DescribeUserPool.

          • 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. See VerificationMessageTemplateType.

      • EmailVerificationMessage (string) --

        This parameter is no longer used. See VerificationMessageTemplateType.

      • EmailVerificationSubject (string) --

        This parameter is no longer used. See VerificationMessageTemplateType.

      • 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.

          You can verify an updated email address or phone number with a VerifyUserAttribute API request. You can also call the AdminUpdateUserAttributes API and set email_verified or phone_number_verified to true.

          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.

      • 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. Configure the duration of temporary passwords with the TemporaryPasswordValidityDays parameter of PasswordPolicyType. For older user pools that have a UnusedAccountValidityDays configuration, that value is effective until you set a value for TemporaryPasswordValidityDays.

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

        User pool add-ons. Contains settings for activation of advanced security features. To log user security information but take no action, set to AUDIT. To configure automatic security responses to risky traffic to your user pool, set to ENFORCED.

        For more information, see Adding advanced security to a user pool.

        • AdvancedSecurityMode (string) --

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

        • AdvancedSecurityAdditionalFlows (dict) --

          Advanced security configuration options for additional authentication types in your user pool, including custom authentication.

      • 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.

        This configuration is immutable after you set it. For more information, see UsernameConfigurationType.

        • 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.

            This data type is a request and response parameter of CreateUserPool and UpdateUserPool, and a response parameter of DescribeUserPool.

            • 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.

DescribeUserPoolClient (updated) Link ¶
Changes (response)
{'UserPoolClient': {'ExplicitAuthFlows': {'ALLOW_USER_AUTH'}}}

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

See also: AWS API Documentation

Request Syntax

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

string

param UserPoolId:

[REQUIRED]

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

type ClientId:

string

param ClientId:

[REQUIRED]

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

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

Response Structure

  • (dict) --

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

    • UserPoolClient (dict) --

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

      • UserPoolId (string) --

        The 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. An example of this kind of activity is when your user selects a link to view their profile information. Your app makes a GetUser API request to retrieve and display your user's profile data.

        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. An example of this kind of activity is when you present your user with a form to update their profile information and they change their last name. Your app then makes an UpdateUserAttributes API request and sets family_name to the new value.

        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.

        Valid values include:

        • 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.

        • 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 setting applies to providers that you can access with the hosted UI and OAuth 2.0 authorization server. 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 API-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 except for http://localhost for testing purposes only.

        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 except for http://localhost for testing purposes only.

        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 features in your user pool app client.

        AllowedOAuthFlowsUserPoolClient must be 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 OAuth 2.0 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.

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

        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.

        Valid values include:

        • ENABLED - This prevents user existence-related errors.

        • LEGACY - This represents the early behavior of Amazon Cognito where user existence related errors aren't prevented.

        Defaults to LEGACY when you don't provide a value.

      • 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. For more information about revoking tokens, see RevokeToken.

      • 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 advanced security 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 advanced security 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.

DescribeUserPoolDomain (updated) Link ¶
Changes (response)
{'DomainDescription': {'ManagedLoginVersion': 'integer'}}

Gets information about a domain.

See also: AWS API Documentation

Request Syntax

client.describe_user_pool_domain(
    Domain='string'
)
type Domain:

string

param Domain:

[REQUIRED]

The domain string. For custom domains, this is the fully-qualified domain name, such as auth.example.com. For Amazon Cognito prefix domains, this is the prefix alone, such as auth.

rtype:

dict

returns:

Response Syntax

{
    'DomainDescription': {
        'UserPoolId': 'string',
        'AWSAccountId': 'string',
        'Domain': 'string',
        'S3Bucket': 'string',
        'CloudFrontDistribution': 'string',
        'Version': 'string',
        'Status': 'CREATING'|'DELETING'|'UPDATING'|'ACTIVE'|'FAILED',
        'CustomDomainConfig': {
            'CertificateArn': 'string'
        },
        'ManagedLoginVersion': 123
    }
}

Response Structure

  • (dict) --

    • DomainDescription (dict) --

      A domain description object containing information about the domain.

      • UserPoolId (string) --

        The ID of the user pool that the domain is attached to.

      • AWSAccountId (string) --

        The Amazon Web Services account that you created the user pool in.

      • Domain (string) --

        The domain string. For custom domains, this is the fully-qualified domain name, such as auth.example.com. For Amazon Cognito prefix domains, this is the prefix alone, such as auth.

      • S3Bucket (string) --

        The Amazon S3 bucket where the static files for this domain are stored.

      • CloudFrontDistribution (string) --

        The Amazon CloudFront endpoint that hosts your custom domain.

      • Version (string) --

        The app version.

      • Status (string) --

        The domain status.

      • CustomDomainConfig (dict) --

        The configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.

        • CertificateArn (string) --

          The Amazon Resource Name (ARN) of an Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.

      • ManagedLoginVersion (integer) --

        The version of managed login branding that you want to apply to your domain. A value of 1 indicates hosted UI (classic) branding and a version of 2 indicates managed login branding.

        Managed login requires that your user pool be configured for any feature plan other than Lite.

GetUserPoolMfaConfig (updated) Link ¶
Changes (response)
{'WebAuthnConfiguration': {'RelyingPartyId': 'string',
                           'UserVerification': 'required | preferred'}}

Gets the user pool multi-factor authentication (MFA) configuration.

See also: AWS API Documentation

Request Syntax

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

string

param UserPoolId:

[REQUIRED]

The user pool ID.

rtype:

dict

returns:

Response Syntax

{
    'SmsMfaConfiguration': {
        'SmsAuthenticationMessage': 'string',
        'SmsConfiguration': {
            'SnsCallerArn': 'string',
            'ExternalId': 'string',
            'SnsRegion': 'string'
        }
    },
    'SoftwareTokenMfaConfiguration': {
        'Enabled': True|False
    },
    'EmailMfaConfiguration': {
        'Message': 'string',
        'Subject': 'string'
    },
    'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
    'WebAuthnConfiguration': {
        'RelyingPartyId': 'string',
        'UserVerification': 'required'|'preferred'
    }
}

Response Structure

  • (dict) --

    • SmsMfaConfiguration (dict) --

      Shows user pool SMS message configuration for MFA. Includes the message template and the SMS message sending configuration for Amazon SNS.

      • SmsAuthenticationMessage (string) --

        The SMS authentication message that will be sent to users with the code they must sign in with. The message must contain the {####} placeholder. Your user pool replaces the placeholder with the MFA code. If this parameter isn't provided, your user pool sends a default message.

      • 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.

        You can set SmsConfiguration in CreateUserPool and UpdateUserPool, or in SetUserPoolMfaConfig.

        • 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.

    • SoftwareTokenMfaConfiguration (dict) --

      Shows user pool configuration for time-based one-time password (TOTP) MFA. Includes TOTP enabled or disabled state.

      • Enabled (boolean) --

        The activation state of TOTP MFA.

    • EmailMfaConfiguration (dict) --

      Shows user pool email message configuration for MFA. Includes the subject and body of the email message template for MFA messages. To activate this setting, advanced security features must be active in your user pool.

      • Message (string) --

        The template for the email message that your user pool sends to users with an MFA code. The message must contain the {####} placeholder. In the message, Amazon Cognito replaces this placeholder with the code. If you don't provide this parameter, Amazon Cognito sends messages in the default format.

      • Subject (string) --

        The subject of the email message that your user pool sends to users with an MFA code.

    • MfaConfiguration (string) --

      The multi-factor authentication (MFA) configuration. Valid values include:

      • OFF MFA won't be used for any users.

      • ON MFA is required for all users to sign in.

      • OPTIONAL MFA will be required only for individual users who have an MFA factor activated.

    • WebAuthnConfiguration (dict) --

      Shows user pool configuration for MFA with passkeys from biometric devices and security keys.

      • RelyingPartyId (string) --

        Sets or displays the authentication domain, typically your user pool domain, that passkey providers must use as a relying party (RP) in their configuration.

        Under the following conditions, the passkey relying party ID must be the fully-qualified domain name of your custom domain:

        • The user pool is configured for passkey authentication.

        • The user pool has a custom domain, whether or not it also has a prefix domain.

        • Your application performs authentication with managed login or the classic hosted UI.

      • UserVerification (string) --

        Sets or displays your user-pool treatment for MFA with a passkey. You can override other MFA options and require passkey MFA, or you can set it as preferred. When passkey MFA is preferred, the hosted UI encourages users to register a passkey at sign-in.

InitiateAuth (updated) Link ¶
Changes (request, response)
Request
{'AuthFlow': {'USER_AUTH'}, 'Session': 'string'}
Response
{'AvailableChallenges': ['SMS_MFA | EMAIL_OTP | SOFTWARE_TOKEN_MFA | '
                         'SELECT_MFA_TYPE | MFA_SETUP | PASSWORD_VERIFIER | '
                         'CUSTOM_CHALLENGE | SELECT_CHALLENGE | '
                         'DEVICE_SRP_AUTH | DEVICE_PASSWORD_VERIFIER | '
                         'ADMIN_NO_SRP_AUTH | NEW_PASSWORD_REQUIRED | SMS_OTP '
                         '| PASSWORD | WEB_AUTHN | PASSWORD_SRP'],
 'ChallengeName': {'PASSWORD',
                   'PASSWORD_SRP',
                   'SELECT_CHALLENGE',
                   'SMS_OTP',
                   'WEB_AUTHN'}}

Initiates sign-in for a user in the Amazon Cognito user directory. You can't sign in a user with a federated IdP with InitiateAuth. For more information, see Adding user pool sign-in through a third party.

See also: AWS API Documentation

Request Syntax

client.initiate_auth(
    AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'USER_PASSWORD_AUTH'|'ADMIN_USER_PASSWORD_AUTH'|'USER_AUTH',
    AuthParameters={
        'string': 'string'
    },
    ClientMetadata={
        'string': 'string'
    },
    ClientId='string',
    AnalyticsMetadata={
        'AnalyticsEndpointId': 'string'
    },
    UserContextData={
        'IpAddress': 'string',
        'EncodedData': 'string'
    },
    Session='string'
)
type AuthFlow:

string

param AuthFlow:

[REQUIRED]

The authentication flow that you want to initiate. The AuthParameters that you must submit are linked to the flow that you submit. For example:

  • USER_AUTH: Request a preferred authentication type or review available authentication types. From the offered authentication types, select one in a challenge response and then authenticate with that method in an additional challenge response.

  • REFRESH_TOKEN_AUTH: Receive new ID and access tokens when you pass a REFRESH_TOKEN parameter with a valid refresh token as the value.

  • USER_SRP_AUTH: Receive secure remote password (SRP) variables for the next challenge, PASSWORD_VERIFIER, when you pass USERNAME and SRP_A parameters.

  • USER_PASSWORD_AUTH: Receive new tokens or the next challenge, for example SOFTWARE_TOKEN_MFA, when you pass USERNAME and PASSWORD parameters.

Valid values include the following:

USER_AUTH

The entry point for sign-in with passwords, one-time passwords, biometric devices, and security keys.

USER_SRP_AUTH

Username-password authentication with the Secure Remote Password (SRP) protocol. For more information, see Use SRP password verification in custom authentication flow.

REFRESH_TOKEN_AUTH and REFRESH_TOKEN

Provide a valid refresh token and receive new ID and access tokens. For more information, see Using the refresh token.

CUSTOM_AUTH

Custom authentication with Lambda triggers. For more information, see Custom authentication challenge Lambda triggers.

USER_PASSWORD_AUTH

Username-password authentication with the password sent directly in the request. For more information, see Admin authentication flow.

ADMIN_USER_PASSWORD_AUTH is a flow type of AdminInitiateAuth and isn't valid for InitiateAuth. ADMIN_NO_SRP_AUTH is a legacy server-side username-password flow and isn't valid for InitiateAuth.

type AuthParameters:

dict

param AuthParameters:

The authentication parameters. These are inputs corresponding to the AuthFlow that you're invoking. The required values depend on the value of AuthFlow:

  • For USER_AUTH: USERNAME (required), PREFERRED_CHALLENGE. If you don't provide a value for PREFERRED_CHALLENGE, Amazon Cognito responds with the AvailableChallenges parameter that specifies the available sign-in methods.

  • For USER_SRP_AUTH: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

  • For USER_PASSWORD_AUTH: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

  • For REFRESH_TOKEN_AUTH/REFRESH_TOKEN: REFRESH_TOKEN (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

  • For CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY. To start the authentication flow with password verification, include ChallengeName: SRP_A and SRP_A: (The SRP_A Value).

For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.

  • (string) --

    • (string) --

type ClientMetadata:

dict

param ClientMetadata:

A map of custom key-value pairs that you can provide as input for certain custom workflows that this action triggers.

You create custom workflows by assigning Lambda functions to user pool triggers. When you use the InitiateAuth API action, Amazon Cognito invokes the Lambda functions that are specified for various triggers. The ClientMetadata value is passed as input to the functions for only the following triggers:

  • Pre signup

  • Pre authentication

  • User migration

When Amazon Cognito invokes the functions for these triggers, it passes a JSON payload, which the function receives as input. This payload contains a validationData attribute, which provides the data that you assigned to the ClientMetadata parameter in your InitiateAuth request. In your function code in Lambda, you can process the validationData value to enhance your workflow for your specific needs.

When you use the InitiateAuth API action, Amazon Cognito also invokes the functions for the following triggers, but it doesn't provide the ClientMetadata value as input:

  • Post authentication

  • Custom message

  • Pre token generation

  • Create auth challenge

  • Define auth challenge

  • Custom email sender

  • Custom SMS sender

For more information, see Customizing user pool Workflows with Lambda Triggers in the Amazon Cognito Developer Guide.

  • (string) --

    • (string) --

type ClientId:

string

param ClientId:

[REQUIRED]

The app client ID.

type AnalyticsMetadata:

dict

param AnalyticsMetadata:

The Amazon Pinpoint analytics metadata that contributes to your metrics for InitiateAuth calls.

  • AnalyticsEndpointId (string) --

    The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications.

type UserContextData:

dict

param UserContextData:

Contextual data about your user session, such as the device fingerprint, IP address, or location. Amazon Cognito advanced security evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

  • IpAddress (string) --

    The source IP address of your user's device.

  • EncodedData (string) --

    Encoded device-fingerprint details that your app collected with the Amazon Cognito context data collection library. For more information, see Adding user device and session data to API requests.

type Session:

string

param Session:

The optional session ID from a ConfirmSignUp API request. You can sign in a user directly from the sign-up process with the USER_AUTH authentication flow.

rtype:

dict

returns:

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'EMAIL_OTP'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'SELECT_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED'|'SMS_OTP'|'PASSWORD'|'WEB_AUTHN'|'PASSWORD_SRP',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    },
    'AvailableChallenges': [
        'SMS_MFA'|'EMAIL_OTP'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'SELECT_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED'|'SMS_OTP'|'PASSWORD'|'WEB_AUTHN'|'PASSWORD_SRP',
    ]
}

Response Structure

  • (dict) --

    Initiates the authentication response.

    • ChallengeName (string) --

      The name of the challenge that you're responding to with this call. This name is returned in the InitiateAuth response if you must pass another challenge.

      Valid values include the following:

      • WEB_AUTHN: Respond to the challenge with the results of a successful authentication with a passkey, or webauthN, factor. These are typically biometric devices or security keys.

      • PASSWORD: Respond with USER_PASSWORD_AUTH parameters: USERNAME (required), PASSWORD (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • PASSWORD_SRP: Respond with USER_SRP_AUTH parameters: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY.

      • SELECT_CHALLENGE: Respond to the challenge with USERNAME and an ANSWER that matches one of the challenge types in the AvailableChallenges response parameter.

      • SMS_MFA: Next challenge is to supply an ``SMS_MFA_CODE``that your user pool delivered in an SMS message.

      • EMAIL_OTP: Next challenge is to supply an EMAIL_OTP_CODE that your user pool delivered in an email message.

      • PASSWORD_VERIFIER: Next challenge is to supply PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after the client-side SRP calculations.

      • CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued.

      • DEVICE_SRP_AUTH: If device tracking was activated on your user pool and the previous challenges were passed, this challenge is returned so that Amazon Cognito can start tracking this device.

      • DEVICE_PASSWORD_VERIFIER: Similar to PASSWORD_VERIFIER, but for devices only.

      • NEW_PASSWORD_REQUIRED: For users who are required to change their passwords after successful first login. Respond to this challenge with NEW_PASSWORD and any required attributes that Amazon Cognito returned in the requiredAttributes parameter. You can also set values for attributes that aren't required by your user pool and that your app client can write. For more information, see RespondToAuthChallenge. Amazon Cognito only returns this challenge for users who have temporary passwords. Because of this, and because in some cases you can create users who don't have values for required attributes, take care to collect and submit required-attribute values for all users who don't have passwords. You can create a user in the Amazon Cognito console without, for example, a required birthdate attribute. The API response from Amazon Cognito won't prompt you to submit a birthdate for the user if they don't have a password.

      • MFA_SETUP: For users who are required to setup an MFA factor before they can sign in. The MFA types activated for the user pool will be listed in the challenge parameters MFAS_CAN_SETUP value. To set up software token MFA, use the session returned here from InitiateAuth as an input to AssociateSoftwareToken. Use the session returned by VerifySoftwareToken as an input to RespondToAuthChallenge with challenge name MFA_SETUP to complete sign-in. To set up SMS MFA, an administrator should help the user to add a phone number to their account, and then the user should call InitiateAuth again to restart sign-in.

    • Session (string) --

      The session that should pass both ways in challenge-response calls to the service. If the caller must pass another challenge, they return a session with other challenge parameters. Include this session identifier in a RespondToAuthChallenge API request.

    • ChallengeParameters (dict) --

      The challenge parameters. These are returned in the InitiateAuth response if you must pass another challenge. The responses in this parameter should be used to compute inputs to the next call ( RespondToAuthChallenge).

      All challenges require USERNAME. They also require SECRET_HASH if your app client has a client secret.

      • (string) --

        • (string) --

    • AuthenticationResult (dict) --

      The result of the authentication response. This result is only returned if the caller doesn't need to pass another challenge. If the caller does need to pass another challenge before it gets tokens, ChallengeName, ChallengeParameters, and Session are returned.

      • AccessToken (string) --

        Your user's access token.

      • ExpiresIn (integer) --

        The expiration period of the authentication result in seconds.

      • TokenType (string) --

        The intended use of the token, for example Bearer.

      • RefreshToken (string) --

        Your user's refresh token.

      • IdToken (string) --

        Your user's ID token.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

        • DeviceGroupKey (string) --

          The device group key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

    • AvailableChallenges (list) --

      This response parameter prompts a user to select from multiple available challenges that they can complete authentication with. For example, they might be able to continue with passwordless authentication or with a one-time password from an SMS message.

      • (string) --

RespondToAuthChallenge (updated) Link ¶
Changes (both)
{'ChallengeName': {'PASSWORD',
                   'PASSWORD_SRP',
                   'SELECT_CHALLENGE',
                   'SMS_OTP',
                   'WEB_AUTHN'}}

Some API operations in a user pool generate a challenge, like a prompt for an MFA code, for device authentication that bypasses MFA, or for a custom authentication challenge. A RespondToAuthChallenge API request provides the answer to that challenge, like a code or a secure remote password (SRP). The parameters of a response to an authentication challenge vary with the type of challenge.

For more information about custom authentication challenges, see Custom authentication challenge Lambda triggers.

See also: AWS API Documentation

Request Syntax

client.respond_to_auth_challenge(
    ClientId='string',
    ChallengeName='SMS_MFA'|'EMAIL_OTP'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'SELECT_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED'|'SMS_OTP'|'PASSWORD'|'WEB_AUTHN'|'PASSWORD_SRP',
    Session='string',
    ChallengeResponses={
        'string': 'string'
    },
    AnalyticsMetadata={
        'AnalyticsEndpointId': 'string'
    },
    UserContextData={
        'IpAddress': 'string',
        'EncodedData': 'string'
    },
    ClientMetadata={
        'string': 'string'
    }
)
type ClientId:

string

param ClientId:

[REQUIRED]

The app client ID.

type ChallengeName:

string

param ChallengeName:

[REQUIRED]

The challenge name. For more information, see InitiateAuth.

ADMIN_NO_SRP_AUTH isn't a valid value.

type Session:

string

param Session:

The session that should be passed both ways in challenge-response calls to the service. If InitiateAuth or RespondToAuthChallenge API call determines that the caller must pass another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.

type ChallengeResponses:

dict

param ChallengeResponses:

The responses to the challenge that you received in the previous request. Each challenge has its own required response parameters. The following examples are partial JSON request bodies that highlight challenge-response parameters.

"ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "USERNAME": "[username]", "ANSWER": "[Challenge name]"}

Available challenges are PASSWORD, PASSWORD_SRP, EMAIL_OTP, SMS_OTP, and WEB_AUTHN.

Complete authentication in the SELECT_CHALLENGE response for PASSWORD, PASSWORD_SRP, and WEB_AUTHN:

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "WEB_AUTHN", "USERNAME": "[username]", "CREDENTIAL": "[AuthenticationResponseJSON]"} See AuthenticationResponseJSON.

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "PASSWORD", "USERNAME": "[username]", "PASSWORD": "[password]"}

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "PASSWORD_SRP", "USERNAME": "[username]", "SRP_A": "[SRP_A]"}

For SMS_OTP and EMAIL_OTP, respond with the username and answer. Your user pool will send a code for the user to submit in the next challenge response.

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "SMS_OTP", "USERNAME": "[username]"}

  • "ChallengeName": "SELECT_CHALLENGE", "ChallengeResponses": { "ANSWER": "EMAIL_OTP", "USERNAME": "[username]"}

    SMS_OTP

"ChallengeName": "SMS_OTP", "ChallengeResponses": {"SMS_OTP_CODE": "[code]", "USERNAME": "[username]"}

EMAIL_OTP

"ChallengeName": "EMAIL_OTP", "ChallengeResponses": {"EMAIL_OTP_CODE": "[code]", "USERNAME": "[username]"}

SMS_MFA

"ChallengeName": "SMS_MFA", "ChallengeResponses": {"SMS_MFA_CODE": "[code]", "USERNAME": "[username]"}

PASSWORD_VERIFIER

This challenge response is part of the SRP flow. Amazon Cognito requires that your application respond to this challenge within a few seconds. When the response time exceeds this period, your user pool returns a NotAuthorizedException error.

"ChallengeName": "PASSWORD_VERIFIER", "ChallengeResponses": {"PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], "USERNAME": "[username]"}

Add "DEVICE_KEY" when you sign in with a remembered device.

CUSTOM_CHALLENGE

"ChallengeName": "CUSTOM_CHALLENGE", "ChallengeResponses": {"USERNAME": "[username]", "ANSWER": "[challenge_answer]"}

Add "DEVICE_KEY" when you sign in with a remembered device.

NEW_PASSWORD_REQUIRED

"ChallengeName": "NEW_PASSWORD_REQUIRED", "ChallengeResponses": {"NEW_PASSWORD": "[new_password]", "USERNAME": "[username]"}

To set any required attributes that InitiateAuth returned in an requiredAttributes parameter, add "userAttributes.[attribute_name]": "[attribute_value]". This parameter can also set values for writable attributes that aren't required by your user pool.

"ChallengeName": "SOFTWARE_TOKEN_MFA", "ChallengeResponses": {"USERNAME": "[username]", "SOFTWARE_TOKEN_MFA_CODE": [authenticator_code]}

DEVICE_SRP_AUTH

"ChallengeName": "DEVICE_SRP_AUTH", "ChallengeResponses": {"USERNAME": "[username]", "DEVICE_KEY": "[device_key]", "SRP_A": "[srp_a]"}

DEVICE_PASSWORD_VERIFIER

"ChallengeName": "DEVICE_PASSWORD_VERIFIER", "ChallengeResponses": {"DEVICE_KEY": "[device_key]", "PASSWORD_CLAIM_SIGNATURE": "[claim_signature]", "PASSWORD_CLAIM_SECRET_BLOCK": "[secret_block]", "TIMESTAMP": [timestamp], "USERNAME": "[username]"}

MFA_SETUP

"ChallengeName": "MFA_SETUP", "ChallengeResponses": {"USERNAME": "[username]"}, "SESSION": "[Session ID from VerifySoftwareToken]"

SELECT_MFA_TYPE

"ChallengeName": "SELECT_MFA_TYPE", "ChallengeResponses": {"USERNAME": "[username]", "ANSWER": "[SMS_MFA or SOFTWARE_TOKEN_MFA]"}

For more information about SECRET_HASH, see Computing secret hash values. For information about DEVICE_KEY, see Working with user devices in your user pool.

  • (string) --

    • (string) --

type AnalyticsMetadata:

dict

param AnalyticsMetadata:

The Amazon Pinpoint analytics metadata that contributes to your metrics for RespondToAuthChallenge calls.

  • AnalyticsEndpointId (string) --

    The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications.

type UserContextData:

dict

param UserContextData:

Contextual data about your user session, such as the device fingerprint, IP address, or location. Amazon Cognito advanced security evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

  • IpAddress (string) --

    The source IP address of your user's device.

  • EncodedData (string) --

    Encoded device-fingerprint details that your app collected with the Amazon Cognito context data collection library. For more information, see Adding user device and session data to API requests.

type ClientMetadata:

dict

param ClientMetadata:

A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

You create custom workflows by assigning Lambda functions to user pool triggers. When you use the RespondToAuthChallenge API action, Amazon Cognito invokes any functions that are assigned to the following triggers: post authentication, pre token generation, define auth challenge, create auth challenge, and verify auth challenge. When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your RespondToAuthChallenge request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

For more information, see Customizing user pool Workflows with Lambda Triggers in the Amazon Cognito Developer Guide.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

{
    'ChallengeName': 'SMS_MFA'|'EMAIL_OTP'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'SELECT_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED'|'SMS_OTP'|'PASSWORD'|'WEB_AUTHN'|'PASSWORD_SRP',
    'Session': 'string',
    'ChallengeParameters': {
        'string': 'string'
    },
    'AuthenticationResult': {
        'AccessToken': 'string',
        'ExpiresIn': 123,
        'TokenType': 'string',
        'RefreshToken': 'string',
        'IdToken': 'string',
        'NewDeviceMetadata': {
            'DeviceKey': 'string',
            'DeviceGroupKey': 'string'
        }
    }
}

Response Structure

  • (dict) --

    The response to respond to the authentication challenge.

    • ChallengeName (string) --

      The challenge name. For more information, see InitiateAuth.

    • Session (string) --

      The session that should be passed both ways in challenge-response calls to the service. If the caller must pass another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.

    • ChallengeParameters (dict) --

      The challenge parameters. For more information, see InitiateAuth.

      • (string) --

        • (string) --

    • AuthenticationResult (dict) --

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

      • AccessToken (string) --

        Your user's access token.

      • ExpiresIn (integer) --

        The expiration period of the authentication result in seconds.

      • TokenType (string) --

        The intended use of the token, for example Bearer.

      • RefreshToken (string) --

        Your user's refresh token.

      • IdToken (string) --

        Your user's ID token.

      • NewDeviceMetadata (dict) --

        The new device metadata from an authentication result.

        • DeviceKey (string) --

          The device key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

        • DeviceGroupKey (string) --

          The device group key, an identifier used in generating the DEVICE_PASSWORD_VERIFIER for device SRP authentication.

SetUserPoolMfaConfig (updated) Link ¶
Changes (both)
{'WebAuthnConfiguration': {'RelyingPartyId': 'string',
                           'UserVerification': 'required | preferred'}}

Sets the user pool multi-factor authentication (MFA) and passkey configuration.

See also: AWS API Documentation

Request Syntax

client.set_user_pool_mfa_config(
    UserPoolId='string',
    SmsMfaConfiguration={
        'SmsAuthenticationMessage': 'string',
        'SmsConfiguration': {
            'SnsCallerArn': 'string',
            'ExternalId': 'string',
            'SnsRegion': 'string'
        }
    },
    SoftwareTokenMfaConfiguration={
        'Enabled': True|False
    },
    EmailMfaConfiguration={
        'Message': 'string',
        'Subject': 'string'
    },
    MfaConfiguration='OFF'|'ON'|'OPTIONAL',
    WebAuthnConfiguration={
        'RelyingPartyId': 'string',
        'UserVerification': 'required'|'preferred'
    }
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The user pool ID.

type SmsMfaConfiguration:

dict

param SmsMfaConfiguration:

Configures user pool SMS messages for MFA. Sets the message template and the SMS message sending configuration for Amazon SNS.

  • SmsAuthenticationMessage (string) --

    The SMS authentication message that will be sent to users with the code they must sign in with. The message must contain the {####} placeholder. Your user pool replaces the placeholder with the MFA code. If this parameter isn't provided, your user pool sends a default message.

  • 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.

    You can set SmsConfiguration in CreateUserPool and UpdateUserPool, or in SetUserPoolMfaConfig.

    • SnsCallerArn (string) -- [REQUIRED]

      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.

type SoftwareTokenMfaConfiguration:

dict

param SoftwareTokenMfaConfiguration:

Configures a user pool for time-based one-time password (TOTP) MFA. Enables or disables TOTP.

  • Enabled (boolean) --

    The activation state of TOTP MFA.

type EmailMfaConfiguration:

dict

param EmailMfaConfiguration:

Configures user pool email messages for MFA. Sets the subject and body of the email message template for MFA messages. To activate this setting, advanced security features must be active in your user pool.

  • Message (string) --

    The template for the email message that your user pool sends to users with an MFA code. The message must contain the {####} placeholder. In the message, Amazon Cognito replaces this placeholder with the code. If you don't provide this parameter, Amazon Cognito sends messages in the default format.

  • Subject (string) --

    The subject of the email message that your user pool sends to users with an MFA code.

type MfaConfiguration:

string

param MfaConfiguration:

The MFA configuration. If you set the MfaConfiguration value to ‘ON’, only users who have set up an MFA factor can sign in. To learn more, see Adding Multi-Factor Authentication (MFA) to a user pool. Valid values include:

  • OFF MFA won't be used for any users.

  • ON MFA is required for all users to sign in.

  • OPTIONAL MFA will be required only for individual users who have an MFA factor activated.

type WebAuthnConfiguration:

dict

param WebAuthnConfiguration:

The configuration of your user pool for passkey, or webauthN, authentication and registration. You can set this configuration independent of the MFA configuration options in this operation.

  • RelyingPartyId (string) --

    Sets or displays the authentication domain, typically your user pool domain, that passkey providers must use as a relying party (RP) in their configuration.

    Under the following conditions, the passkey relying party ID must be the fully-qualified domain name of your custom domain:

    • The user pool is configured for passkey authentication.

    • The user pool has a custom domain, whether or not it also has a prefix domain.

    • Your application performs authentication with managed login or the classic hosted UI.

  • UserVerification (string) --

    Sets or displays your user-pool treatment for MFA with a passkey. You can override other MFA options and require passkey MFA, or you can set it as preferred. When passkey MFA is preferred, the hosted UI encourages users to register a passkey at sign-in.

rtype:

dict

returns:

Response Syntax

{
    'SmsMfaConfiguration': {
        'SmsAuthenticationMessage': 'string',
        'SmsConfiguration': {
            'SnsCallerArn': 'string',
            'ExternalId': 'string',
            'SnsRegion': 'string'
        }
    },
    'SoftwareTokenMfaConfiguration': {
        'Enabled': True|False
    },
    'EmailMfaConfiguration': {
        'Message': 'string',
        'Subject': 'string'
    },
    'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
    'WebAuthnConfiguration': {
        'RelyingPartyId': 'string',
        'UserVerification': 'required'|'preferred'
    }
}

Response Structure

  • (dict) --

    • SmsMfaConfiguration (dict) --

      Shows user pool SMS message configuration for MFA. Includes the message template and the SMS message sending configuration for Amazon SNS.

      • SmsAuthenticationMessage (string) --

        The SMS authentication message that will be sent to users with the code they must sign in with. The message must contain the {####} placeholder. Your user pool replaces the placeholder with the MFA code. If this parameter isn't provided, your user pool sends a default message.

      • 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.

        You can set SmsConfiguration in CreateUserPool and UpdateUserPool, or in SetUserPoolMfaConfig.

        • 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.

    • SoftwareTokenMfaConfiguration (dict) --

      Shows user pool configuration for time-based one-time password (TOTP) MFA. Includes TOTP enabled or disabled state.

      • Enabled (boolean) --

        The activation state of TOTP MFA.

    • EmailMfaConfiguration (dict) --

      Shows user pool email message configuration for MFA. Includes the subject and body of the email message template for MFA messages. To activate this setting, advanced security features must be active in your user pool.

      • Message (string) --

        The template for the email message that your user pool sends to users with an MFA code. The message must contain the {####} placeholder. In the message, Amazon Cognito replaces this placeholder with the code. If you don't provide this parameter, Amazon Cognito sends messages in the default format.

      • Subject (string) --

        The subject of the email message that your user pool sends to users with an MFA code.

    • MfaConfiguration (string) --

      The MFA configuration. Valid values include:

      • OFF MFA won't be used for any users.

      • ON MFA is required for all users to sign in.

      • OPTIONAL MFA will be required only for individual users who have an MFA factor enabled.

    • WebAuthnConfiguration (dict) --

      The configuration of your user pool for passkey, or webauthN, biometric and security-key devices.

      • RelyingPartyId (string) --

        Sets or displays the authentication domain, typically your user pool domain, that passkey providers must use as a relying party (RP) in their configuration.

        Under the following conditions, the passkey relying party ID must be the fully-qualified domain name of your custom domain:

        • The user pool is configured for passkey authentication.

        • The user pool has a custom domain, whether or not it also has a prefix domain.

        • Your application performs authentication with managed login or the classic hosted UI.

      • UserVerification (string) --

        Sets or displays your user-pool treatment for MFA with a passkey. You can override other MFA options and require passkey MFA, or you can set it as preferred. When passkey MFA is preferred, the hosted UI encourages users to register a passkey at sign-in.

SignUp (updated) Link ¶
Changes (response)
{'Session': 'string'}

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

You might receive a LimitExceeded exception in response to this request if you have exceeded a rate quota for email or SMS messages, and if your user pool automatically verifies email addresses or phone numbers. When you get this exception in the response, the user is successfully created and is in an UNCONFIRMED state. You can send a new code with the ResendConfirmationCode request, or confirm the user as an administrator with an AdminConfirmSignUp request.

See also: AWS API Documentation

Request Syntax

client.sign_up(
    ClientId='string',
    SecretHash='string',
    Username='string',
    Password='string',
    UserAttributes=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    ValidationData=[
        {
            'Name': 'string',
            'Value': 'string'
        },
    ],
    AnalyticsMetadata={
        'AnalyticsEndpointId': 'string'
    },
    UserContextData={
        'IpAddress': 'string',
        'EncodedData': 'string'
    },
    ClientMetadata={
        'string': 'string'
    }
)
type ClientId:

string

param ClientId:

[REQUIRED]

The ID of the client associated with the user pool.

type SecretHash:

string

param SecretHash:

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

type Username:

string

param Username:

[REQUIRED]

The username of the user that you want to sign up. The value of this parameter is typically a username, but can be any alias attribute in your user pool.

type Password:

string

param Password:

The password of the user you want to register.

Users can sign up without a password when your user pool supports passwordless sign-in with email or SMS OTPs. To create a user with no password, omit this parameter or submit a blank value. You can only create a passwordless user when passwordless sign-in is available. See the SignInPolicyType property of CreateUserPool and UpdateUserPool.

type UserAttributes:

list

param UserAttributes:

An array of name-value pairs representing user attributes.

For custom attributes, you must prepend the custom: prefix to the attribute name.

  • (dict) --

    The name and value of a user attribute.

    This data type is a request parameter of AdminUpdateUserAttributes and UpdateUserAttributes.

    • Name (string) -- [REQUIRED]

      The name of the attribute.

    • Value (string) --

      The value of the attribute.

type ValidationData:

list

param ValidationData:

Temporary user attributes that contribute to the outcomes of your pre sign-up Lambda trigger. This set of key-value pairs are for custom validation of information that you collect from your users but don't need to retain.

Your Lambda function can analyze this additional data and act on it. Your function might perform external API operations like logging user attributes and validation data to Amazon CloudWatch Logs. Validation data might also affect the response that your function returns to Amazon Cognito, like automatically confirming the user if they sign up from within your network.

For more information about the pre sign-up Lambda trigger, see Pre sign-up Lambda trigger.

  • (dict) --

    The name and value of a user attribute.

    This data type is a request parameter of AdminUpdateUserAttributes and UpdateUserAttributes.

    • Name (string) -- [REQUIRED]

      The name of the attribute.

    • Value (string) --

      The value of the attribute.

type AnalyticsMetadata:

dict

param AnalyticsMetadata:

The Amazon Pinpoint analytics metadata that contributes to your metrics for SignUp calls.

  • AnalyticsEndpointId (string) --

    The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications.

type UserContextData:

dict

param UserContextData:

Contextual data about your user session, such as the device fingerprint, IP address, or location. Amazon Cognito advanced security evaluates the risk of an authentication event based on the context that your app generates and passes to Amazon Cognito when it makes API requests.

  • IpAddress (string) --

    The source IP address of your user's device.

  • EncodedData (string) --

    Encoded device-fingerprint details that your app collected with the Amazon Cognito context data collection library. For more information, see Adding user device and session data to API requests.

type ClientMetadata:

dict

param ClientMetadata:

A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.

You create custom workflows by assigning Lambda functions to user pool triggers. When you use the SignUp API action, Amazon Cognito invokes any functions that are assigned to the following triggers: pre sign-up, custom message, and post confirmation. When Amazon Cognito invokes any of these functions, it passes a JSON payload, which the function receives as input. This payload contains a clientMetadata attribute, which provides the data that you assigned to the ClientMetadata parameter in your SignUp request. In your function code in Lambda, you can process the clientMetadata value to enhance your workflow for your specific needs.

For more information, see Customizing user pool Workflows with Lambda Triggers in the Amazon Cognito Developer Guide.

  • (string) --

    • (string) --

rtype:

dict

returns:

Response Syntax

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

Response Structure

  • (dict) --

    The response from the server for a registration request.

    • UserConfirmed (boolean) --

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

    • CodeDeliveryDetails (dict) --

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

      • Destination (string) --

        The email address or phone number destination where Amazon Cognito sent the code.

      • DeliveryMedium (string) --

        The method that Amazon Cognito used to send the code.

      • AttributeName (string) --

        The name of the attribute that Amazon Cognito verifies with the code.

    • UserSub (string) --

      The 128-bit ID of the authenticated user. This isn't the same as username.

    • Session (string) --

      A session Id that you can pass to ConfirmSignUp when you want to immediately sign in your user with the USER_AUTH flow after they complete sign-up.

UpdateUserPool (updated) Link ¶
Changes (request)
{'Policies': {'SignInPolicy': {'AllowedFirstAuthFactors': ['PASSWORD | '
                                                           'EMAIL_OTP | '
                                                           'SMS_OTP | '
                                                           'WEB_AUTHN']}},
 'PoolName': 'string',
 'UserPoolTier': 'LITE | ESSENTIALS | PLUS'}

Updates the specified user pool with the specified attributes. You can get a list of the current user pool settings using DescribeUserPool.

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',
            ]
        }
    },
    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',
            'LambdaArn': 'string'
        },
        'CustomSMSSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'CustomEmailSender': {
            'LambdaVersion': 'V1_0',
            'LambdaArn': 'string'
        },
        'KMSKeyID': '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'
    },
    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'
        }
    },
    AccountRecoverySetting={
        'RecoveryMechanisms': [
            {
                'Priority': 123,
                'Name': 'verified_email'|'verified_phone_number'|'admin_only'
            },
        ]
    },
    PoolName='string',
    UserPoolTier='LITE'|'ESSENTIALS'|'PLUS'
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

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

type Policies:

dict

param Policies:

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

  • 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.

      Password history isn't enforced and isn't displayed in DescribeUserPool responses when you set this value to 0 or don't provide it. To activate this setting, advanced security features must be active in your user pool.

    • 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:

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

  • 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.

type AutoVerifiedAttributes:

list

param AutoVerifiedAttributes:

The attributes that are automatically verified when Amazon Cognito requests to update user pools.

  • (string) --

type SmsVerificationMessage:

string

param SmsVerificationMessage:

This parameter is no longer used. See VerificationMessageTemplateType.

type EmailVerificationMessage:

string

param EmailVerificationMessage:

This parameter is no longer used. See VerificationMessageTemplateType.

type EmailVerificationSubject:

string

param EmailVerificationSubject:

This parameter is no longer used. See VerificationMessageTemplateType.

type VerificationMessageTemplate:

dict

param VerificationMessageTemplate:

The template for verification messages.

  • 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 authentication message.

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.

    You can verify an updated email address or phone number with a VerifyUserAttribute API request. You can also call the AdminUpdateUserAttributes API and set email_verified or phone_number_verified to true.

    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:

Possible values include:

  • 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 ON when you're initially creating a user pool. You can use the SetUserPoolMfaConfig API operation to turn MFA "ON" for existing user pools.

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

type DeviceConfiguration:

dict

param DeviceConfiguration:

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.

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 that your Amazon Cognito user pool must use to send an SMS message from your Amazon Web Services account through 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) -- [REQUIRED]

    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.

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 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. Configure the duration of temporary passwords with the TemporaryPasswordValidityDays parameter of PasswordPolicyType. For older user pools that have a UnusedAccountValidityDays configuration, that value is effective until you set a value for TemporaryPasswordValidityDays.

    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:

User pool add-ons. Contains settings for activation of advanced security features. To log user security information but take no action, set to AUDIT. To configure automatic security responses to risky traffic to your user pool, set to ENFORCED.

For more information, see Adding advanced security to a user pool.

  • AdvancedSecurityMode (string) -- [REQUIRED]

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

  • AdvancedSecurityAdditionalFlows (dict) --

    Advanced security configuration options for additional authentication types in your user pool, including custom authentication.

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.

      This data type is a request and response parameter of CreateUserPool and UpdateUserPool, and a response parameter of DescribeUserPool.

      • 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.

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 (request, response)
Request
{'ExplicitAuthFlows': {'ALLOW_USER_AUTH'}}
Response
{'UserPoolClient': {'ExplicitAuthFlows': {'ALLOW_USER_AUTH'}}}

Updates the specified user pool app client with the specified attributes. You can get a list of the current user pool app client settings using DescribeUserPoolClient.

You can also use this operation to enable token revocation for user pool clients. For more information about revoking tokens, see RevokeToken.

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
)
type UserPoolId:

string

param UserPoolId:

[REQUIRED]

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

type ClientId:

string

param ClientId:

[REQUIRED]

The ID of the client associated with the user pool.

type ClientName:

string

param ClientName:

The client name from the update user pool client request.

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 time units you use when you set the duration of ID, access, and refresh tokens. The default unit for RefreshToken is days, and the default for ID and access tokens is 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. An example of this kind of activity is when your user selects a link to view their profile information. Your app makes a GetUser API request to retrieve and display your user's profile data.

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. An example of this kind of activity is when you present your user with a form to update their profile information and they change their last name. Your app then makes an UpdateUserAttributes API request and sets family_name to the new value.

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.

Valid values include:

  • 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.

  • 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 setting applies to providers that you can access with the hosted UI and OAuth 2.0 authorization server. 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 API-based authentication is to block access with a WAF rule.

  • (string) --

type CallbackURLs:

list

param CallbackURLs:

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 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 the IdPs.

  • (string) --

type DefaultRedirectURI:

string

param DefaultRedirectURI:

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 except for http://localhost for testing purposes only.

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

type AllowedOAuthFlows:

list

param AllowedOAuthFlows:

The allowed OAuth flows.

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 allowed OAuth scopes. Possible values provided by OAuth are phone, email, openid, and profile. Possible values provided by Amazon Web Services are aws.cognito.signin.user.admin. Custom scopes created in Resource Servers are also supported.

  • (string) --

type AllowedOAuthFlowsUserPoolClient:

boolean

param AllowedOAuthFlowsUserPoolClient:

Set to true to use OAuth 2.0 features in your user pool app client.

AllowedOAuthFlowsUserPoolClient must be 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 OAuth 2.0 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.

type AnalyticsConfiguration:

dict

param AnalyticsConfiguration:

The Amazon Pinpoint analytics configuration necessary to collect metrics for this user pool.

  • 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:

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.

Valid values include:

  • ENABLED - This prevents user existence-related errors.

  • LEGACY - This represents the early behavior of Amazon Cognito where user existence related errors aren't prevented.

Defaults to LEGACY when you don't provide a value.

type EnableTokenRevocation:

boolean

param EnableTokenRevocation:

Activates or deactivates token revocation. For more information about revoking tokens, see RevokeToken.

type EnablePropagateAdditionalUserContextData:

boolean

param EnablePropagateAdditionalUserContextData:

Activates the propagation of additional user context data. For more information about propagation of user context data, see Adding advanced security to a user pool. If you don’t include this parameter, you can't send device fingerprint information, including source IP address, to Amazon Cognito advanced security. 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.

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

Response Structure

  • (dict) --

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

    • UserPoolClient (dict) --

      The user pool client value from the response from the server when you request to update the user pool 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. An example of this kind of activity is when your user selects a link to view their profile information. Your app makes a GetUser API request to retrieve and display your user's profile data.

        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. An example of this kind of activity is when you present your user with a form to update their profile information and they change their last name. Your app then makes an UpdateUserAttributes API request and sets family_name to the new value.

        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.

        Valid values include:

        • 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.

        • 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 setting applies to providers that you can access with the hosted UI and OAuth 2.0 authorization server. 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 API-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 except for http://localhost for testing purposes only.

        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 except for http://localhost for testing purposes only.

        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 features in your user pool app client.

        AllowedOAuthFlowsUserPoolClient must be 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 OAuth 2.0 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.

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

        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.

        Valid values include:

        • ENABLED - This prevents user existence-related errors.

        • LEGACY - This represents the early behavior of Amazon Cognito where user existence related errors aren't prevented.

        Defaults to LEGACY when you don't provide a value.

      • 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. For more information about revoking tokens, see RevokeToken.

      • 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 advanced security 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 advanced security 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.

UpdateUserPoolDomain (updated) Link ¶
Changes (both)
{'ManagedLoginVersion': 'integer'}

Updates the Secure Sockets Layer (SSL) certificate for the custom domain for your user pool.

You can use this operation to provide the Amazon Resource Name (ARN) of a new certificate to Amazon Cognito. You can't use it to change the domain for a user pool.

A custom domain is used to host the Amazon Cognito hosted UI, which provides sign-up and sign-in pages for your application. When you set up a custom domain, you provide a certificate that you manage with Certificate Manager (ACM). When necessary, you can use this operation to change the certificate that you applied to your custom domain.

Usually, this is unnecessary following routine certificate renewal with ACM. When you renew your existing certificate in ACM, the ARN for your certificate remains the same, and your custom domain uses the new certificate automatically.

However, if you replace your existing certificate with a new one, ACM gives the new certificate a new ARN. To apply the new certificate to your custom domain, you must provide this ARN to Amazon Cognito.

When you add your new certificate in ACM, you must choose US East (N. Virginia) as the Amazon Web Services Region.

After you submit your request, Amazon Cognito requires up to 1 hour to distribute your new certificate to your custom domain.

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

See also: AWS API Documentation

Request Syntax

client.update_user_pool_domain(
    Domain='string',
    UserPoolId='string',
    ManagedLoginVersion=123,
    CustomDomainConfig={
        'CertificateArn': 'string'
    }
)
type Domain:

string

param Domain:

[REQUIRED]

The domain name for the custom domain that hosts the sign-up and sign-in pages for your application. One example might be auth.example.com.

This string can include only lowercase letters, numbers, and hyphens. Don't use a hyphen for the first or last character. Use periods to separate subdomain names.

type UserPoolId:

string

param UserPoolId:

[REQUIRED]

The ID of the user pool that is associated with the custom domain whose certificate you're updating.

type ManagedLoginVersion:

integer

param ManagedLoginVersion:

A version number that indicates the state of managed login for your domain. Version 1 is hosted UI (classic). Version 2 is the newer managed login with the branding designer. For more information, see Managed login.

type CustomDomainConfig:

dict

param CustomDomainConfig:

[REQUIRED]

The configuration for a custom domain that hosts the sign-up and sign-in pages for your application. Use this object to specify an SSL certificate that is managed by ACM.

When you create a custom domain, the passkey RP ID defaults to the custom domain. If you had a prefix domain active, this will cause passkey integration for your prefix domain to stop working due to a mismatch in RP ID. To keep the prefix domain passkey integration working, you can explicitly set RP ID to the prefix domain. Update the RP ID in a SetUserPoolMfaConfig request.

  • CertificateArn (string) -- [REQUIRED]

    The Amazon Resource Name (ARN) of an Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.

rtype:

dict

returns:

Response Syntax

{
    'ManagedLoginVersion': 123,
    'CloudFrontDomain': 'string'
}

Response Structure

  • (dict) --

    The UpdateUserPoolDomain response output.

    • ManagedLoginVersion (integer) --

      A version number that indicates the state of managed login for your domain. Version 1 is hosted UI (classic). Version 2 is the newer managed login with the branding designer. For more information, see Managed login.

    • CloudFrontDomain (string) --

      The Amazon CloudFront endpoint that Amazon Cognito set up when you added the custom domain to your user pool.