CognitoIdentityProvider *********************** Client ====== class CognitoIdentityProvider.Client A low-level client representing Amazon Cognito Identity Provider With the Amazon Cognito user pools API, you can configure user pools and authenticate users. To authenticate users from third- party identity providers (IdPs) in this API, you can link IdP users to native user profiles. Learn more about the authentication and authorization of federated users at Adding user pool sign-in through a third party and in the User pool federation endpoints and managed login reference. This API reference provides detailed information about API operations and object types in Amazon Cognito. Along with resource management operations, the Amazon Cognito user pools API includes classes of operations and authorization models for client-side and server-side authentication of users. You can interact with operations in the Amazon Cognito user pools API as any of the following subjects. * An administrator who wants to configure user pools, app clients, users, groups, or other user pool functions. * A server-side app, like a web application, that wants to use its Amazon Web Services privileges to manage, authenticate, or authorize a user. * A client-side app, like a mobile app, that wants to make unauthenticated requests to manage, authenticate, or authorize a user. For more information, see Understanding API, OIDC, and managed login pages authentication in the *Amazon Cognito Developer Guide*. With your Amazon Web Services SDK, you can build the logic to support operational flows in every use case for this API. You can also make direct REST API requests to Amazon Cognito user pools service endpoints. The following links can get you started with the "CognitoIdentityProvider" client in supported Amazon Web Services SDKs. To get started with an Amazon Web Services SDK, see Tools to Build on Amazon Web Services. For example actions and scenarios, see Code examples for Amazon Cognito Identity Provider using Amazon Web Services SDKs. import boto3 client = boto3.client('cognito-idp') These are the available methods: * add_custom_attributes * admin_add_user_to_group * admin_confirm_sign_up * admin_create_user * admin_delete_user * admin_delete_user_attributes * admin_disable_provider_for_user * admin_disable_user * admin_enable_user * admin_forget_device * admin_get_device * admin_get_user * admin_initiate_auth * admin_link_provider_for_user * admin_list_devices * admin_list_groups_for_user * admin_list_user_auth_events * admin_remove_user_from_group * admin_reset_user_password * admin_respond_to_auth_challenge * admin_set_user_mfa_preference * admin_set_user_password * admin_set_user_settings * admin_update_auth_event_feedback * admin_update_device_status * admin_update_user_attributes * admin_user_global_sign_out * associate_software_token * can_paginate * change_password * close * complete_web_authn_registration * confirm_device * confirm_forgot_password * confirm_sign_up * create_group * create_identity_provider * create_managed_login_branding * create_resource_server * create_user_import_job * create_user_pool * create_user_pool_client * create_user_pool_domain * delete_group * delete_identity_provider * delete_managed_login_branding * delete_resource_server * delete_user * delete_user_attributes * delete_user_pool * delete_user_pool_client * delete_user_pool_domain * delete_web_authn_credential * describe_identity_provider * describe_managed_login_branding * describe_managed_login_branding_by_client * describe_resource_server * describe_risk_configuration * describe_user_import_job * describe_user_pool * describe_user_pool_client * describe_user_pool_domain * forget_device * forgot_password * get_csv_header * get_device * get_group * get_identity_provider_by_identifier * get_log_delivery_configuration * get_paginator * get_signing_certificate * get_tokens_from_refresh_token * get_ui_customization * get_user * get_user_attribute_verification_code * get_user_auth_factors * get_user_pool_mfa_config * get_waiter * global_sign_out * initiate_auth * list_devices * list_groups * list_identity_providers * list_resource_servers * list_tags_for_resource * list_user_import_jobs * list_user_pool_clients * list_user_pools * list_users * list_users_in_group * list_web_authn_credentials * resend_confirmation_code * respond_to_auth_challenge * revoke_token * set_log_delivery_configuration * set_risk_configuration * set_ui_customization * set_user_mfa_preference * set_user_pool_mfa_config * set_user_settings * sign_up * start_user_import_job * start_web_authn_registration * stop_user_import_job * tag_resource * untag_resource * update_auth_event_feedback * update_device_status * update_group * update_identity_provider * update_managed_login_branding * update_resource_server * update_user_attributes * update_user_pool * update_user_pool_client * update_user_pool_domain * verify_software_token * verify_user_attribute Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * AdminListGroupsForUser * AdminListUserAuthEvents * ListGroups * ListIdentityProviders * ListResourceServers * ListUserPoolClients * ListUserPools * ListUsers * ListUsersInGroup CognitoIdentityProvider / Paginator / ListUsersInGroup ListUsersInGroup **************** class CognitoIdentityProvider.Paginator.ListUsersInGroup paginator = client.get_paginator('list_users_in_group') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.list_users_in_group()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( UserPoolId='string', GroupName='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to view the membership of the requested group. * **GroupName** (*string*) -- **[REQUIRED]** The name of the group that you want to query for user membership. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Users': [ { 'Username': 'string', 'Attributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'UserCreateDate': datetime(2015, 1, 1), 'UserLastModifiedDate': datetime(2015, 1, 1), 'Enabled': True|False, 'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD'|'EXTERNAL_PROVIDER', 'MFAOptions': [ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] }, ], } **Response Structure** * *(dict) --* * **Users** *(list) --* An array of users who are members in the group, and their attributes. * *(dict) --* A user profile in a Amazon Cognito user pool. * **Username** *(string) --* The user's username. * **Attributes** *(list) --* Names and values of a user's attributes, for example "email". * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **UserCreateDate** *(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. * **UserLastModifiedDate** *(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. * **Enabled** *(boolean) --* Indicates whether the user's account is enabled or disabled. * **UserStatus** *(string) --* The user status. This can be one of the following: * "UNCONFIRMED": User has been created but not confirmed. * "CONFIRMED": User has been confirmed. * "EXTERNAL_PROVIDER": User signed in with a third- party IdP. * "RESET_REQUIRED": User is confirmed, but the user must request a code and reset their password before they can sign in. * "FORCE_CHANGE_PASSWORD": The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change their password to a new value before doing anything else. The statuses "ARCHIVED", "UNKNOWN", and "COMPROMISED" are no longer used. * **MFAOptions** *(list) --* The user's MFA configuration. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one- time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". CognitoIdentityProvider / Paginator / ListResourceServers ListResourceServers ******************* class CognitoIdentityProvider.Paginator.ListResourceServers paginator = client.get_paginator('list_resource_servers') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.list_resource_servers()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( UserPoolId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list resource servers. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'ResourceServers': [ { 'UserPoolId': 'string', 'Identifier': 'string', 'Name': 'string', 'Scopes': [ { 'ScopeName': 'string', 'ScopeDescription': 'string' }, ] }, ], } **Response Structure** * *(dict) --* * **ResourceServers** *(list) --* An array of resource servers and the details of their configuration. For each, the response includes names, identifiers, and custom scopes. * *(dict) --* The details of a resource server configuration and associated custom scopes in a user pool. * **UserPoolId** *(string) --* The ID of the user pool that contains the resource server configuration. * **Identifier** *(string) --* A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system-data". You can also set an API URL like "https://solar-system-data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope-identifier strings increase the size of your access tokens. * **Name** *(string) --* The name of the resource server. * **Scopes** *(list) --* A list of scopes that are defined for the resource server. * *(dict) --* One custom scope associated with a user pool resource server. This data type is a member of "ResourceServerScopeType". For more information, see Scopes, M2M, and API authorization with resource servers. * **ScopeName** *(string) --* The name of the scope. Amazon Cognito renders custom scopes in the format "resourceServerIdentifier/ScopeName". For example, if this parameter is "exampleScope" in the resource server with the identifier "exampleResourceServer", you request and receive the scope "exampleResourceServer/exampleScope". * **ScopeDescription** *(string) --* A friendly description of a custom scope. CognitoIdentityProvider / Paginator / ListUserPools ListUserPools ************* class CognitoIdentityProvider.Paginator.ListUserPools paginator = client.get_paginator('list_user_pools') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.list_user_pools()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max- items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'UserPools': [ { 'Id': 'string', 'Name': 'string', 'LambdaConfig': { 'PreSignUp': 'string', 'CustomMessage': 'string', 'PostConfirmation': 'string', 'PreAuthentication': 'string', 'PostAuthentication': 'string', 'DefineAuthChallenge': 'string', 'CreateAuthChallenge': 'string', 'VerifyAuthChallengeResponse': 'string', 'PreTokenGeneration': 'string', 'UserMigration': 'string', 'PreTokenGenerationConfig': { 'LambdaVersion': 'V1_0'|'V2_0'|'V3_0', 'LambdaArn': 'string' }, 'CustomSMSSender': { 'LambdaVersion': 'V1_0', 'LambdaArn': 'string' }, 'CustomEmailSender': { 'LambdaVersion': 'V1_0', 'LambdaArn': 'string' }, 'KMSKeyID': 'string' }, 'Status': 'Enabled'|'Disabled', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], } **Response Structure** * *(dict) --* Represents the response to list user pools. * **UserPools** *(list) --* An array of user pools and their configuration details. * *(dict) --* A short description of a user pool. * **Id** *(string) --* The user pool ID. * **Name** *(string) --* The user pool name. * **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) --* The user pool status. * **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. CognitoIdentityProvider / Paginator / ListUsers ListUsers ********* class CognitoIdentityProvider.Paginator.ListUsers paginator = client.get_paginator('list_users') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.list_users()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( UserPoolId='string', AttributesToGet=[ 'string', ], Filter='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to display or search for users. * **AttributesToGet** (*list*) -- A JSON array of user attribute names, for example "given_name", that you want Amazon Cognito to include in the response for each user. When you don't provide an "AttributesToGet" parameter, Amazon Cognito returns all attributes for each user. Use "AttributesToGet" with required attributes in your user pool, or in conjunction with "Filter". Amazon Cognito returns an error if not all users in the results have set a value for the attribute you request. Attributes that you can't filter on, including custom attributes, must have a value set in every user profile before an "AttributesToGet" parameter returns results. * *(string) --* * **Filter** (*string*) -- A filter string of the form ""AttributeName Filter-Type "AttributeValue"". Quotation marks within the filter string must be escaped using the backslash ( "\") character. For example, ""family_name = \"Reddy\""". * *AttributeName*: The name of the attribute to search for. You can only search for one attribute at a time. * *Filter-Type*: For an exact match, use "=", for example, " "given_name = \"Jon\""". For a prefix ("starts with") match, use "^=", for example, " "given_name ^= \"Jon\""". * *AttributeValue*: The attribute value that must be matched for each user. If the filter string is empty, "ListUsers" returns all users in the user pool. You can only search for the following standard attributes: * "username" (case-sensitive) * "email" * "phone_number" * "name" * "given_name" * "family_name" * "preferred_username" * "cognito:user_status" (called **Status** in the Console) (case-insensitive) * "status (called **Enabled** in the Console) (case- sensitive)" * "sub" Custom attributes aren't searchable. Note: You can also list users with a client-side filter. The server-side filter matches no more than one attribute. For an advanced search, use a client-side filter with the "--query" parameter of the "list-users" action in the CLI. When you use a client-side filter, ListUsers returns a paginated list of zero or more users. You can receive multiple pages in a row with zero results. Repeat the query with each pagination token that is returned until you receive a null pagination token value, and then review the combined result.For more information about server-side and client-side filtering, see FilteringCLI output in the Command Line Interface User Guide. For more information, see Searching for Users Using the ListUsers API and Examples of Using the ListUsers API in the *Amazon Cognito Developer Guide*. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Users': [ { 'Username': 'string', 'Attributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'UserCreateDate': datetime(2015, 1, 1), 'UserLastModifiedDate': datetime(2015, 1, 1), 'Enabled': True|False, 'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD'|'EXTERNAL_PROVIDER', 'MFAOptions': [ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* The response from the request to list users. * **Users** *(list) --* An array of user pool users who match your query, and their attributes. * *(dict) --* A user profile in a Amazon Cognito user pool. * **Username** *(string) --* The user's username. * **Attributes** *(list) --* Names and values of a user's attributes, for example "email". * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **UserCreateDate** *(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. * **UserLastModifiedDate** *(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. * **Enabled** *(boolean) --* Indicates whether the user's account is enabled or disabled. * **UserStatus** *(string) --* The user status. This can be one of the following: * "UNCONFIRMED": User has been created but not confirmed. * "CONFIRMED": User has been confirmed. * "EXTERNAL_PROVIDER": User signed in with a third- party IdP. * "RESET_REQUIRED": User is confirmed, but the user must request a code and reset their password before they can sign in. * "FORCE_CHANGE_PASSWORD": The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change their password to a new value before doing anything else. The statuses "ARCHIVED", "UNKNOWN", and "COMPROMISED" are no longer used. * **MFAOptions** *(list) --* The user's MFA configuration. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one- time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". * **NextToken** *(string) --* A token to resume pagination. CognitoIdentityProvider / Paginator / ListIdentityProviders ListIdentityProviders ********************* class CognitoIdentityProvider.Paginator.ListIdentityProviders paginator = client.get_paginator('list_identity_providers') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.list_identity_providers()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( UserPoolId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list IdPs. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Providers': [ { 'ProviderName': 'string', 'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'SignInWithApple'|'OIDC', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], } **Response Structure** * *(dict) --* * **Providers** *(list) --* An array of the IdPs in your user pool. For each, the response includes identifiers, the IdP name and type, and trust-relationship details like the issuer URL. * *(dict) --* The details of a user pool identity provider (IdP), including name and type. * **ProviderName** *(string) --* The name of the IdP, for example "MySAMLProvider". * **ProviderType** *(string) --* The type of the provider, for example "SAML". Amazon Cognito supports SAML 2.0, OIDC, and social IdPs. User pools list supported social IdPs by name in this response parameter: Facebook, Google, Login with Amazon, and Sign in with Apple. * **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. CognitoIdentityProvider / Paginator / AdminListUserAuthEvents AdminListUserAuthEvents *********************** class CognitoIdentityProvider.Paginator.AdminListUserAuthEvents paginator = client.get_paginator('admin_list_user_auth_events') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.admin_list_user_auth_events()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( UserPoolId='string', Username='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The Id of the user pool that contains the user profile with the logged events. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'AuthEvents': [ { 'EventId': 'string', 'EventType': 'SignIn'|'SignUp'|'ForgotPassword'|'PasswordChange'|'ResendCode', 'CreationDate': datetime(2015, 1, 1), 'EventResponse': 'Pass'|'Fail'|'InProgress', 'EventRisk': { 'RiskDecision': 'NoRisk'|'AccountTakeover'|'Block', 'RiskLevel': 'Low'|'Medium'|'High', 'CompromisedCredentialsDetected': True|False }, 'ChallengeResponses': [ { 'ChallengeName': 'Password'|'Mfa', 'ChallengeResponse': 'Success'|'Failure' }, ], 'EventContextData': { 'IpAddress': 'string', 'DeviceName': 'string', 'Timezone': 'string', 'City': 'string', 'Country': 'string' }, 'EventFeedback': { 'FeedbackValue': 'Valid'|'Invalid', 'Provider': 'string', 'FeedbackDate': datetime(2015, 1, 1) } }, ], } **Response Structure** * *(dict) --* * **AuthEvents** *(list) --* The response object. It includes the "EventID", "EventType", "CreationDate", "EventRisk", and "EventResponse". * *(dict) --* One authentication event that Amazon Cognito logged in a user pool with threat protection active. Contains user and device metadata and a risk assessment from your user pool. * **EventId** *(string) --* The event ID. * **EventType** *(string) --* The type of authentication event. * **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. * **EventResponse** *(string) --* The event response. * **EventRisk** *(dict) --* The threat evaluation from your user pool about an event. Contains information about whether your user pool detected compromised credentials, whether the event triggered an automated response, and the level of risk. * **RiskDecision** *(string) --* The action taken by adaptive authentication. If "NoRisk", your user pool took no action. If "AccountTakeover", your user pool applied the adaptive authentication automated response that you configured. If "Block", your user pool prevented the attempt. * **RiskLevel** *(string) --* The risk level that adaptive authentication assessed for the authentication event. * **CompromisedCredentialsDetected** *(boolean) --* Indicates whether compromised credentials were detected during an authentication event. * **ChallengeResponses** *(list) --* A list of the challenges that the user was requested to answer, for example "Password", and the result, for example "Success". * *(dict) --* 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. Warning: You must provide a SECRET_HASH parameter in all challenge responses to an app client that has a client secret. Include a "DEVICE_KEY" for device authentication.SELECT_CHALLENGE ""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. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes.SOFTWARE_TOKEN_MFA ""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. * **ChallengeName** *(string) --* The type of challenge that your previous authentication request returned in the parameter "ChallengeName", for example "SMS_MFA". * **ChallengeResponse** *(string) --* The set of key-value pairs that provides a response to the requested challenge. * **EventContextData** *(dict) --* The user context data captured at the time of an event request. This value provides additional information about the client from which event the request is received. * **IpAddress** *(string) --* The source IP address of your user's device. * **DeviceName** *(string) --* The user's device name. * **Timezone** *(string) --* The user's time zone. * **City** *(string) --* The user's city. * **Country** *(string) --* The user's country. * **EventFeedback** *(dict) --* The "UpdateAuthEventFeedback" or "AdminUpdateAuthEventFeedback" feedback that you or your user provided in response to the event. A value of "Valid" indicates that you disagreed with the level of risk that your user pool assigned, and evaluated a session to be valid, or likely safe. A value of "Invalid" indicates that you agreed with the user pool risk level and evaluated a session to be invalid, or likely malicious. * **FeedbackValue** *(string) --* Your feedback to the authentication event. When you provide a "FeedbackValue" value of "valid", you tell Amazon Cognito that you trust a user session where Amazon Cognito has evaluated some level of risk. When you provide a "FeedbackValue" value of "invalid", you tell Amazon Cognito that you don't trust a user session, or you don't believe that Amazon Cognito evaluated a high-enough risk level. * **Provider** *(string) --* The submitter of the event feedback. For example, if you submit event feedback in the Amazon Cognito console, this value is "Admin". * **FeedbackDate** *(datetime) --* The date that you or your user submitted the feedback. CognitoIdentityProvider / Paginator / ListGroups ListGroups ********** class CognitoIdentityProvider.Paginator.ListGroups paginator = client.get_paginator('list_groups') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.list_groups()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( UserPoolId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list user groups. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Groups': [ { 'GroupName': 'string', 'UserPoolId': 'string', 'Description': 'string', 'RoleArn': 'string', 'Precedence': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], } **Response Structure** * *(dict) --* * **Groups** *(list) --* An array of groups and their details. Each entry that's returned includes description, precedence, and IAM role values. * *(dict) --* A user pool group. Contains details about the group and the way that it contributes to IAM role decisions with identity pools. Identity pools can make decisions about the IAM role to assign based on groups: users get credentials for the role associated with their highest- priority group. * **GroupName** *(string) --* The name of the group. * **UserPoolId** *(string) --* The ID of the user pool that contains the group. * **Description** *(string) --* A friendly description of the group. * **RoleArn** *(string) --* The ARN of the IAM role associated with the group. If a group has the highest priority of a user's groups, users who authenticate with an identity pool get credentials for the "RoleArn" that's associated with the group. * **Precedence** *(integer) --* A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher ornull "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is "null". * **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. CognitoIdentityProvider / Paginator / AdminListGroupsForUser AdminListGroupsForUser ********************** class CognitoIdentityProvider.Paginator.AdminListGroupsForUser paginator = client.get_paginator('admin_list_groups_for_user') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.admin_list_groups_for_user()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( Username='string', UserPoolId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **Username** (*string*) -- **[REQUIRED]** The name 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. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to view a user's groups. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Groups': [ { 'GroupName': 'string', 'UserPoolId': 'string', 'Description': 'string', 'RoleArn': 'string', 'Precedence': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], } **Response Structure** * *(dict) --* * **Groups** *(list) --* An array of groups and information about them. * *(dict) --* A user pool group. Contains details about the group and the way that it contributes to IAM role decisions with identity pools. Identity pools can make decisions about the IAM role to assign based on groups: users get credentials for the role associated with their highest- priority group. * **GroupName** *(string) --* The name of the group. * **UserPoolId** *(string) --* The ID of the user pool that contains the group. * **Description** *(string) --* A friendly description of the group. * **RoleArn** *(string) --* The ARN of the IAM role associated with the group. If a group has the highest priority of a user's groups, users who authenticate with an identity pool get credentials for the "RoleArn" that's associated with the group. * **Precedence** *(integer) --* A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher ornull "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is "null". * **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. CognitoIdentityProvider / Paginator / ListUserPoolClients ListUserPoolClients ******************* class CognitoIdentityProvider.Paginator.ListUserPoolClients paginator = client.get_paginator('list_user_pool_clients') paginate(**kwargs) Creates an iterator that will paginate through responses from "CognitoIdentityProvider.Client.list_user_pool_clients()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( UserPoolId='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list user pool clients. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'UserPoolClients': [ { 'ClientId': 'string', 'UserPoolId': 'string', 'ClientName': 'string' }, ], } **Response Structure** * *(dict) --* Represents the response from the server that lists user pool clients. * **UserPoolClients** *(list) --* An array of app clients and their details. Includes app client ID and name. * *(dict) --* A short description of a user pool app client. * **ClientId** *(string) --* The app client ID. * **UserPoolId** *(string) --* The ID of the user pool that's associated with the app client. * **ClientName** *(string) --* The app client name. CognitoIdentityProvider / Client / admin_confirm_sign_up admin_confirm_sign_up ********************* CognitoIdentityProvider.Client.admin_confirm_sign_up(**kwargs) Confirms user sign-up as an administrator. This request sets a user account active in a user pool that requires confirmation of new user accounts before they can sign in. You can configure your user pool to not send confirmation codes to new users and instead confirm them with this API operation on the back end. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints To configure your user pool to require administrative confirmation of users, set "AllowAdminCreateUserOnly" to "true" in a "CreateUserPool" or "UpdateUserPool" request. See also: AWS API Documentation **Request Syntax** response = client.admin_confirm_sign_up( UserPoolId='string', Username='string', ClientMetadata={ 'string': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to confirm a user's sign-up request. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **ClientMetadata** (*dict*) -- A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers. If your user pool configuration includes triggers, the AdminConfirmSignUp API action invokes the Lambda function that is specified for the *post confirmation* trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. In this payload, the "clientMetadata" attribute provides the data that you assigned to the ClientMetadata parameter in your AdminConfirmSignUp 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server for the request to confirm registration. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyFailedAttempts Exception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / confirm_sign_up confirm_sign_up *************** CognitoIdentityProvider.Client.confirm_sign_up(**kwargs) Confirms the account of a new user. This public API operation submits a code that Amazon Cognito sent to your user when they signed up in your user pool. 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. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = 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' ) Parameters: * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client associated with the user pool. * **SecretHash** (*string*) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about "SecretHash", see Computing secret hash values. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **ConfirmationCode** (*string*) -- **[REQUIRED]** The confirmation code that your user pool sent in response to the "SignUp" request. * **ForceAliasCreation** (*boolean*) -- When "true", forces user confirmation despite any existing aliases. Defaults to "false". A value of "true" migrates the alias from an existing user to the new user if an existing user already has the phone number or email address as an alias. Say, for example, that an existing user has an "email" attribute of "bob@example.com" and email is an alias in your user pool. If the new user also has an email of "bob@example.com" and your "ConfirmSignUp" response sets "ForceAliasCreation" to "true", the new user can sign in with a username of "bob@example.com" and the existing user can no longer do so. If "false" and an attribute belongs to an existing alias, this request returns an **AliasExistsException** error. For more information about sign-in aliases, see Customizing sign-in attributes. * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **UserContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **ClientMetadata** (*dict*) -- 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* * **Session** (*string*) -- 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. Return type: dict Returns: **Response Syntax** { 'Session': 'string' } **Response Structure** * *(dict) --* Represents the response from the server for the registration confirmation. * **Session** *(string) --* A session identifier that you can use to immediately sign in the confirmed user. You can automatically sign users in with the one-time password that they provided in a successful "ConfirmSignUp" request. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyFailedAttempts Exception" * "CognitoIdentityProvider.Client.exceptions.CodeMismatchException" * "CognitoIdentityProvider.Client.exceptions.ExpiredCodeException" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / get_user_auth_factors get_user_auth_factors ********************* CognitoIdentityProvider.Client.get_user_auth_factors(**kwargs) 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 for choice-based authentication with the "USER_AUTH" flow. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.get_user_auth_factors( AccessToken='string' ) Parameters: **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Return type: dict Returns: **Response Syntax** { 'Username': 'string', 'PreferredMfaSetting': 'string', 'UserMFASettingList': [ 'string', ], 'ConfiguredUserAuthFactors': [ 'PASSWORD'|'EMAIL_OTP'|'SMS_OTP'|'WEB_AUTHN', ] } **Response Structure** * *(dict) --* * **Username** *(string) --* The name of the user who is eligible for the authentication factors in the response. * **PreferredMfaSetting** *(string) --* The challenge method that Amazon Cognito returns to the user in response to sign-in requests. Users can prefer SMS message, email message, or TOTP MFA. * **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, for example "["PASSWORD", "WEB_AUTHN"]". * *(string) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / verify_user_attribute verify_user_attribute ********************* CognitoIdentityProvider.Client.verify_user_attribute(**kwargs) Submits a verification code for a signed-in user who has added or changed a value of an auto-verified attribute. When successful, the user's attribute becomes verified and the attribute "email_verified" or "phone_number_verified" becomes "true". If your user pool requires verification before Amazon Cognito updates the attribute value, this operation updates the affected attribute to its pending value. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.verify_user_attribute( AccessToken='string', AttributeName='string', Code='string' ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **AttributeName** (*string*) -- **[REQUIRED]** The name of the attribute that you want to verify. * **Code** (*string*) -- **[REQUIRED]** The verification code that your user pool sent to the added or changed attribute, for example the user's email address. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* A container representing the response from the server from the request to verify user attributes. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.CodeMismatchException" * "CognitoIdentityProvider.Client.exceptions.ExpiredCodeException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / describe_managed_login_branding_by_client describe_managed_login_branding_by_client ***************************************** CognitoIdentityProvider.Client.describe_managed_login_branding_by_client(**kwargs) 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** response = client.describe_managed_login_branding_by_client( UserPoolId='string', ClientId='string', ReturnMergedResources=True|False ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the app client where you want more information about the managed login branding style. * **ClientId** (*string*) -- **[REQUIRED]** The app client that's assigned to the branding style that you want more information about. * **ReturnMergedResources** (*boolean*) -- 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. Return type: 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 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. * **Settings** (*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. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / get_paginator get_paginator ************* CognitoIdentityProvider.Client.get_paginator(operation_name) Create a paginator for an operation. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Raises: **OperationNotPageableError** -- Raised if the operation is not pageable. You can use the "client.can_paginate" method to check if an operation is pageable. Return type: "botocore.paginate.Paginator" Returns: A paginator object. CognitoIdentityProvider / Client / get_user get_user ******** CognitoIdentityProvider.Client.get_user(**kwargs) Gets user attributes and and MFA settings 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". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.get_user( AccessToken='string' ) Parameters: **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Return type: dict Returns: **Response Syntax** { 'Username': 'string', 'UserAttributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'MFAOptions': [ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ], 'PreferredMfaSetting': 'string', 'UserMFASettingList': [ 'string', ] } **Response Structure** * *(dict) --* Represents the response from the server from the request to get information about the user. * **Username** *(string) --* The name of the user that you requested. * **UserAttributes** *(list) --* An array of name-value pairs representing user attributes. Custom attributes are prepended with the "custom:" prefix. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **MFAOptions** *(list) --* *This response parameter is no longer supported.* It provides information only about SMS MFA configurations. It doesn't provide information about time-based one-time password (TOTP) software token MFA configurations. To look up information about either type of MFA configuration, use UserMFASettingList instead. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". * **PreferredMfaSetting** *(string) --* The user's preferred MFA. Users can prefer SMS message, email message, or TOTP MFA. * **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) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / delete_user_pool_client delete_user_pool_client *********************** CognitoIdentityProvider.Client.delete_user_pool_client(**kwargs) Deletes a user pool app client. After you delete an app client, users can no longer sign in to the associated application. See also: AWS API Documentation **Request Syntax** response = client.delete_user_pool_client( UserPoolId='string', ClientId='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete the client. * **ClientId** (*string*) -- **[REQUIRED]** The ID of the user pool app client that you want to delete. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / create_managed_login_branding create_managed_login_branding ***************************** CognitoIdentityProvider.Client.create_managed_login_branding(**kwargs) 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. To create a new style with default settings, set "UseCognitoProvidedValues" to "true" and don't provide values for any other options. 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. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = 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' }, ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to create a new branding style. * **ClientId** (*string*) -- **[REQUIRED]** The app client that you want to create the branding style for. Each style is linked to an app client until you delete it. * **UseCognitoProvidedValues** (*boolean*) -- When true, applies the default branding style options. These default options 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. * **Settings** (*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 functions 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. * **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. Return type: 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 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. * **Settings** (*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. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.ManagedLoginBrandingE xistsException" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / delete_user_attributes delete_user_attributes ********************** CognitoIdentityProvider.Client.delete_user_attributes(**kwargs) Deletes attributes from the currently signed-in user. For example, your application can submit a request to this operation when a user wants to remove their "birthdate" attribute value. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.delete_user_attributes( UserAttributeNames=[ 'string', ], AccessToken='string' ) Parameters: * **UserAttributeNames** (*list*) -- **[REQUIRED]** An array of strings representing the user attribute names you want to delete. For custom attributes, you must prepend the "custom:" prefix to the attribute name, for example "custom:department". * *(string) --* * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server to delete user attributes. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / delete_web_authn_credential delete_web_authn_credential *************************** CognitoIdentityProvider.Client.delete_web_authn_credential(**kwargs) Deletes a registered passkey, or WebAuthn, authenticator 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". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.delete_web_authn_credential( AccessToken='string', CredentialId='string' ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **CredentialId** (*string*) -- **[REQUIRED]** The unique identifier of the passkey that you want to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" CognitoIdentityProvider / Client / admin_set_user_mfa_preference admin_set_user_mfa_preference ***************************** CognitoIdentityProvider.Client.admin_set_user_mfa_preference(**kwargs) Sets the user's multi-factor authentication (MFA) preference, including which MFA options are activated, and if any are preferred. Only one factor can be set as preferred. The preferred MFA factor will be used to authenticate a user if multiple factors are activated. If multiple options are activated and no preference is set, a challenge to choose an MFA option will be returned during sign-in. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_set_user_mfa_preference( SMSMfaSettings={ 'Enabled': True|False, 'PreferredMfa': True|False }, SoftwareTokenMfaSettings={ 'Enabled': True|False, 'PreferredMfa': True|False }, EmailMfaSettings={ 'Enabled': True|False, 'PreferredMfa': True|False }, Username='string', UserPoolId='string' ) Parameters: * **SMSMfaSettings** (*dict*) -- User preferences for SMS message MFA. Activates or deactivates SMS MFA and sets it as the preferred MFA method when multiple methods are available. * **Enabled** *(boolean) --* Specifies whether SMS message MFA is activated. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. * **PreferredMfa** *(boolean) --* Specifies whether SMS is the preferred MFA method. If true, your user pool prompts the specified user for a code delivered by SMS message after username-password sign-in succeeds. * **SoftwareTokenMfaSettings** (*dict*) -- User preferences for time-based one-time password (TOTP) MFA. Activates or deactivates TOTP MFA and sets it as the preferred MFA method when multiple methods are available. This operation can set TOTP as a user's preferred MFA method before they register a TOTP authenticator. * **Enabled** *(boolean) --* Specifies whether software token MFA is activated. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. * **PreferredMfa** *(boolean) --* Specifies whether software token MFA is the preferred MFA method. * **EmailMfaSettings** (*dict*) -- User preferences for email message MFA. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, your user pool must be in the Essentials tier or higher. * **Enabled** *(boolean) --* Specifies whether email message MFA is active for a user. When the value of this parameter is "Enabled", the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. * **PreferredMfa** *(boolean) --* Specifies whether email message MFA is the user's preferred method. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to set a user's MFA preferences. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / create_user_import_job create_user_import_job ********************** CognitoIdentityProvider.Client.create_user_import_job(**kwargs) Creates a user import job. You can import users into user pools from a comma-separated values (CSV) file without adding Amazon Cognito MAU costs to your Amazon Web Services bill. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.create_user_import_job( JobName='string', UserPoolId='string', CloudWatchLogsRoleArn='string' ) Parameters: * **JobName** (*string*) -- **[REQUIRED]** A friendly name for the user import job. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that you want to import users into. * **CloudWatchLogsRoleArn** (*string*) -- **[REQUIRED]** You must specify an IAM role that has permission to log import-job results to Amazon CloudWatch Logs. This parameter is the ARN of that role. Return type: dict Returns: **Response Syntax** { 'UserImportJob': { 'JobName': 'string', 'JobId': 'string', 'UserPoolId': 'string', 'PreSignedUrl': 'string', 'CreationDate': datetime(2015, 1, 1), 'StartDate': datetime(2015, 1, 1), 'CompletionDate': datetime(2015, 1, 1), 'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded', 'CloudWatchLogsRoleArn': 'string', 'ImportedUsers': 123, 'SkippedUsers': 123, 'FailedUsers': 123, 'CompletionMessage': 'string' } } **Response Structure** * *(dict) --* Represents the response from the server to the request to create the user import job. * **UserImportJob** *(dict) --* The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload. * **JobName** *(string) --* The friendly name of the user import job. * **JobId** *(string) --* The ID of the user import job. * **UserPoolId** *(string) --* The ID of the user pool that the users are being imported into. * **PreSignedUrl** *(string) --* The pre-signed URL target for uploading the CSV file. * **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. * **StartDate** *(datetime) --* The date when the user import job was started. * **CompletionDate** *(datetime) --* The date when the user import job was completed. * **Status** *(string) --* The status of the user import job. One of the following: * "Created" - The job was created but not started. * "Pending" - A transition state. You have started the job, but it has not begun importing users yet. * "InProgress" - The job has started, and users are being imported. * "Stopping" - You have stopped the job, but the job has not stopped importing users yet. * "Stopped" - You have stopped the job, and the job has stopped importing users. * "Succeeded" - The job has completed successfully. * "Failed" - The job has stopped due to an error. * "Expired" - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job can't be started. * **CloudWatchLogsRoleArn** *(string) --* The role Amazon Resource Name (ARN) for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide. * **ImportedUsers** *(integer) --* The number of users that were successfully imported. * **SkippedUsers** *(integer) --* The number of users that were skipped. * **FailedUsers** *(integer) --* The number of users that couldn't be imported. * **CompletionMessage** *(string) --* The message returned when the user import job is completed. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PreconditionNotMetExc eption" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / can_paginate can_paginate ************ CognitoIdentityProvider.Client.can_paginate(operation_name) Check if an operation can be paginated. Parameters: **operation_name** (*string*) -- The operation name. This is the same name as the method name on the client. For example, if the method name is "create_foo", and you'd normally invoke the operation as "client.create_foo(**kwargs)", if the "create_foo" operation can be paginated, you can use the call "client.get_paginator("create_foo")". Returns: "True" if the operation can be paginated, "False" otherwise. CognitoIdentityProvider / Client / initiate_auth initiate_auth ************* CognitoIdentityProvider.Client.initiate_auth(**kwargs) Declares an authentication flow and initiates sign-in for a user in the Amazon Cognito user directory. Amazon Cognito might respond with an additional challenge or an "AuthenticationResult" that contains the outcome of a successful authentication. You can't sign in a user with a federated IdP with "InitiateAuth". For more information, see Authentication. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = client.initiate_auth( AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'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' ) Parameters: * **AuthFlow** (*string*) -- **[REQUIRED]** The authentication flow that you want to initiate. Each "AuthFlow" has linked "AuthParameters" that you must submit. The following are some example flows. USER_AUTH The entry point for choice-based authentication with passwords, one-time passwords, and WebAuthn authenticators. 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. To activate this setting, your user pool must be in the Essentials tier or higher. 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 Receive new ID and access tokens when you pass a "REFRESH_TOKEN" parameter with a valid refresh token as the value. 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 Client-side username-password authentication with the password sent directly in the request. For more information about client-side and server-side authentication, see SDK authorization models. "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. * **AuthParameters** (*dict*) -- The authentication parameters. These are inputs corresponding to the "AuthFlow" that you're invoking. The required values are specific to the InitiateAuthRequest$AuthFlow. The following are some authentication flows and their parameters. Add a "SECRET_HASH" parameter if your app client has a client secret. * "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. * "USER_SRP_AUTH": "USERNAME" (required), "SRP_A" (required), "DEVICE_KEY". * "USER_PASSWORD_AUTH": "USERNAME" (required), "PASSWORD" (required), "DEVICE_KEY". * "REFRESH_TOKEN_AUTH/REFRESH_TOKEN": "REFRESH_TOKEN" (required), "DEVICE_KEY". * "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) --* * **ClientMetadata** (*dict*) -- 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 send an "InitiateAuth" request, 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 sign-up * Pre authentication * User migration When Amazon Cognito invokes the functions for these triggers, it passes a JSON payload as input to the function. This payload contains a "validationData" attribute with the data that you assigned to the "ClientMetadata" parameter in your "InitiateAuth" request. In your function, "validationData" can contribute to operations that require data that isn't in the default payload. "InitiateAuth" requests invokes the following triggers without "ClientMetadata" 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client that your user wants to sign in to. * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **UserContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **Session** (*string*) -- 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. When you pass the session ID to "InitiateAuth", Amazon Cognito assumes the SMS or email message one-time verification password from "ConfirmSignUp" as the primary authentication factor. You're not required to submit this code a second time. This option is only valid for users who have confirmed their sign-up and are signing in for the first time within the authentication flow session duration of the session ID. Return type: 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 an additional authentication challenge that you must respond to. Possible challenges include the following: Note: All of the following challenges require "USERNAME" and, when the app client has a client secret, "SECRET_HASH" in the parameters. * "WEB_AUTHN": Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and 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": Respond with an "SMS_MFA_CODE" that your user pool delivered in an SMS message. * "EMAIL_OTP": Respond with an "EMAIL_OTP_CODE" that your user pool delivered in an email message. * "PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after 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. The parameters of the challenge are determined by your Lambda function. * "DEVICE_SRP_AUTH": Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device. * "DEVICE_PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after client-side SRP calculations. For more information, see Signing in with a device. * "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. Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes. * "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 time-based one-time password (TOTP) MFA, use the session returned in this challenge from "InitiateAuth" or "AdminInitiateAuth" as an input to "AssociateSoftwareToken". Then, use the session returned by "VerifySoftwareToken" as an input to "RespondToAuthChallenge" or "AdminRespondToAuthChallenge" with challenge name "MFA_SETUP" to complete sign-in. To set up SMS or email MFA, collect a "phone_number" or "email" attribute for the user. Then restart the authentication flow with an "InitiateAuth" or "AdminInitiateAuth" request. * **Session** *(string) --* The session identifier that links a challenge response to the initial authentication request. If the user must pass another challenge, Amazon Cognito returns a session ID and challenge parameters. * **ChallengeParameters** *(dict) --* The required parameters of the "ChallengeName" challenge. All challenges require "USERNAME". They also require "SECRET_HASH" if your app client has a client secret. * *(string) --* * *(string) --* * **AuthenticationResult** *(dict) --* The result of a successful and complete authentication request. This result is only returned if the user doesn't need to pass another challenge. If they must pass another challenge before they get tokens, Amazon Cognito returns a challenge in "ChallengeName", "ChallengeParameters", and "Session" response parameters. * **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 lists the available authentication challenges that users can select from in choice-based authentication. For example, they might be able to choose between passkey authentication, a one-time password from an SMS message, and a traditional password. * *(string) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.UnsupportedOperationE xception" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / sign_up sign_up ******* CognitoIdentityProvider.Client.sign_up(**kwargs) Registers a user with an app client and requests a user name, password, and user attributes in the user pool. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. 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. See also: AWS API Documentation **Request Syntax** response = client.sign_up( ClientId='string', SecretHash='string', Username='string', Password='string', UserAttributes=[ { 'Name': 'string', 'Value': 'string' }, ], ValidationData=[ { 'Name': 'string', 'Value': 'string' }, ], AnalyticsMetadata={ 'AnalyticsEndpointId': 'string' }, UserContextData={ 'IpAddress': 'string', 'EncodedData': 'string' }, ClientMetadata={ 'string': 'string' } ) Parameters: * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client where the user wants to sign up. * **SecretHash** (*string*) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about "SecretHash", see Computing secret hash values. * **Username** (*string*) -- **[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. * **Password** (*string*) -- The user's proposed password. The password must comply with the password requirements of your user pool. 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. * **UserAttributes** (*list*) -- An array of name-value pairs representing user attributes. For custom attributes, include a "custom:" prefix in the attribute name, for example "custom:department". * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* **[REQUIRED]** The name of the attribute. * **Value** *(string) --* The value of the attribute. * **ValidationData** (*list*) -- 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 can automatically confirm and verify select users or perform external API operations like logging user attributes and validation data to Amazon CloudWatch Logs. 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. * **Name** *(string) --* **[REQUIRED]** The name of the attribute. * **Value** *(string) --* The value of the attribute. * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **UserContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **ClientMetadata** (*dict*) -- 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: 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) --* Indicates whether the user was automatically confirmed. You can auto-confirm users with a pre sign-up Lambda trigger. * **CodeDeliveryDetails** *(dict) --* In user pools that automatically verify and confirm new users, Amazon Cognito sends users a message with a code or link that confirms ownership of the phone number or email address that they entered. The "CodeDeliveryDetails" object is information about the delivery destination for that link or code. * **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 unique identifier of the new user, for example "a1b2c3d4-5678-90ab-cdef-EXAMPLE11111". * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.UsernameExistsExcepti on" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.CodeDeliveryFailureEx ception" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / delete_managed_login_branding delete_managed_login_branding ***************************** CognitoIdentityProvider.Client.delete_managed_login_branding(**kwargs) Deletes a managed login branding style. When you delete a style, you delete the branding association for an app client. When an app client doesn't have a style assigned, your managed login pages for that app client are nonfunctional until you create a new style or switch the domain branding version. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.delete_managed_login_branding( ManagedLoginBrandingId='string', UserPoolId='string' ) Parameters: * **ManagedLoginBrandingId** (*string*) -- **[REQUIRED]** The ID of the managed login branding style that you want to delete. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the managed login branding style that you want to delete. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_enable_user admin_enable_user ***************** CognitoIdentityProvider.Client.admin_enable_user(**kwargs) Activates sign-in for a user profile that previously had sign-in access disabled. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_enable_user( UserPoolId='string', Username='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to activate sign-in for the user. * **Username** (*string*) -- **[REQUIRED]** The name 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. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server for the request to enable a user as an administrator. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_initiate_auth admin_initiate_auth ******************* CognitoIdentityProvider.Client.admin_initiate_auth(**kwargs) Starts sign-in for applications with a server-side component, for example a traditional web application. This operation specifies the authentication flow that you'd like to begin. The authentication flow that you specify must be supported in your app client configuration. For more information about authentication flows, see Authentication flows. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_initiate_auth( UserPoolId='string', ClientId='string', AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'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' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where the user wants to sign in. * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client where the user wants to sign in. * **AuthFlow** (*string*) -- **[REQUIRED]** The authentication flow that you want to initiate. Each "AuthFlow" has linked "AuthParameters" that you must submit. The following are some example flows. USER_AUTH The entry point for choice-based authentication with passwords, one-time passwords, and WebAuthn authenticators. 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. To activate this setting, your user pool must be in the Essentials tier or higher. 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 Receive new ID and access tokens when you pass a "REFRESH_TOKEN" parameter with a valid refresh token as the value. 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 Server-side username-password authentication with the password sent directly in the request. For more information about client-side and server-side authentication, see SDK authorization models. * **AuthParameters** (*dict*) -- The authentication parameters. These are inputs corresponding to the "AuthFlow" that you're invoking. The required values depend on the value of "AuthFlow" for example: * 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) --* * **ClientMetadata** (*dict*) -- 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **ContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **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. * **Session** (*string*) -- The optional session ID from a "ConfirmSignUp" API request. You can sign in a user directly from the sign-up process with an "AuthFlow" of "USER_AUTH" and "AuthParameters" of "EMAIL_OTP" or "SMS_OTP", depending on how your user pool sent the confirmation-code message. Return type: 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, 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. Possible challenges include the following: Note: All of the following challenges require "USERNAME" and, when the app client has a client secret, "SECRET_HASH" in the parameters. * "WEB_AUTHN": Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and 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": Respond with an "SMS_MFA_CODE" that your user pool delivered in an SMS message. * "EMAIL_OTP": Respond with an "EMAIL_OTP_CODE" that your user pool delivered in an email message. * "PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after 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. The parameters of the challenge are determined by your Lambda function. * "DEVICE_SRP_AUTH": Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device. * "DEVICE_PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after client-side SRP calculations. For more information, see Signing in with a device. * "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. Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes. * "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 time-based one-time password (TOTP) MFA, use the session returned in this challenge from "InitiateAuth" or "AdminInitiateAuth" as an input to "AssociateSoftwareToken". Then, use the session returned by "VerifySoftwareToken" as an input to "RespondToAuthChallenge" or "AdminRespondToAuthChallenge" with challenge name "MFA_SETUP" to complete sign-in. To set up SMS or email MFA, collect a "phone_number" or "email" attribute for the user. Then restart the authentication flow with an "InitiateAuth" or "AdminInitiateAuth" request. * **Session** *(string) --* The session that must be passed to challenge-response requests. If an "AdminInitiateAuth" or "AdminRespondToAuthChallenge" API request results in another authentication challenge, Amazon Cognito returns a session ID and the parameters of the next challenge. Pass this session ID in the "Session" parameter of "AdminRespondToAuthChallenge". * **ChallengeParameters** *(dict) --* The parameters of an authentication challenge. Amazon Cognito returns challenge parameters as a guide to the responses your user or application must provide for the returned "ChallengeName". Calculate responses to the challenge parameters and pass them in the "ChallengeParameters" of "AdminRespondToAuthChallenge". All challenges require "USERNAME" and, when the app client has a client secret, "SECRET_HASH". In SRP challenges, Amazon Cognito returns the "username" attribute in "USER_ID_FOR_SRP" instead of any email address, preferred username, or phone number alias that you might have specified in your "AdminInitiateAuth" request. You must use the username and not an alias in the "ChallengeResponses" of your challenge response. * *(string) --* * *(string) --* * **AuthenticationResult** *(dict) --* The outcome of successful authentication. This is only returned if the user pool has no additional challenges to return. If Amazon Cognito returns another challenge, the response includes "ChallengeName", "ChallengeParameters", and "Session" so that your user can answer the 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. * **AvailableChallenges** *(list) --* This response parameter lists the available authentication challenges that users can select from in choice-based authentication. For example, they might be able to choose between passkey authentication, a one-time password from an SMS message, and a traditional password. * *(string) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnsupportedOperationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.MFAMethodNotFoundExce ption" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" CognitoIdentityProvider / Client / get_ui_customization get_ui_customization ******************** CognitoIdentityProvider.Client.get_ui_customization(**kwargs) Given a user pool ID or app client, returns information about classic hosted UI branding that you applied, if any. Returns user- pool level branding information if no app client branding is applied, or if you don't specify an app client ID. Returns an empty object if you haven't applied hosted UI branding to either the client or the user pool. For more information, see Hosted UI (classic) branding. See also: AWS API Documentation **Request Syntax** response = client.get_ui_customization( UserPoolId='string', ClientId='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that you want to query for branding settings. * **ClientId** (*string*) -- The ID of the app client that you want to query for branding settings. Return type: dict Returns: **Response Syntax** { 'UICustomization': { 'UserPoolId': 'string', 'ClientId': 'string', 'ImageUrl': 'string', 'CSS': 'string', 'CSSVersion': 'string', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **UICustomization** *(dict) --* Information about the classic hosted UI custom CSS and logo- image branding that you applied to the user pool or app client. * **UserPoolId** *(string) --* The ID of the user pool with hosted UI customizations. * **ClientId** *(string) --* The app client ID for your UI customization. When this value isn't present, the customization applies to all user pool app clients that don't have client-level settings.. * **ImageUrl** *(string) --* A URL path to the hosted logo image of your UI customization. * **CSS** *(string) --* The CSS values in the UI customization. * **CSSVersion** *(string) --* The CSS version number. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / create_user_pool create_user_pool **************** CognitoIdentityProvider.Client.create_user_pool(**kwargs) Creates a new Amazon Cognito user pool. This operation sets basic and advanced configuration options. Warning: If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.create_user_pool( PoolName='string', Policies={ 'PasswordPolicy': { 'MinimumLength': 123, 'RequireUppercase': True|False, 'RequireLowercase': True|False, 'RequireNumbers': True|False, 'RequireSymbols': True|False, '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'|'V3_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' ) Parameters: * **PoolName** (*string*) -- **[REQUIRED]** A friendly name for your user pool. * **Policies** (*dict*) -- The password policy and sign-in policy in the user pool. The password policy sets options like password complexity requirements and password history. The sign-in policy sets the options available to applications in choice-based authentication. * **PasswordPolicy** *(dict) --* The password policy settings for a user pool, including complexity, history, and length requirements. * **MinimumLength** *(integer) --* The minimum length of the password in the policy that you have set. This value can't be less than 6. * **RequireUppercase** *(boolean) --* The requirement in a password policy that users must include at least one uppercase letter in their password. * **RequireLowercase** *(boolean) --* The requirement in a password policy that users must include at least one lowercase letter in their password. * **RequireNumbers** *(boolean) --* The requirement in a password policy that users must include at least one number in their password. * **RequireSymbols** *(boolean) --* The requirement in a password policy that users must include at least one symbol in their password. * **PasswordHistorySize** *(integer) --* The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of "n" previous passwords, where "n" is the value of "PasswordHistorySize". * **TemporaryPasswordValidityDays** *(integer) --* The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to "7". If you submit a value of "0", Amazon Cognito treats it as a null value and sets "TemporaryPasswordValidityDays" to its default value. Note: When you set "TemporaryPasswordValidityDays" for a user pool, you can no longer set a value for the legacy "UnusedAccountValidityDays" parameter in that user pool. * **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 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. * **AutoVerifiedAttributes** (*list*) -- The attributes that you want your user pool to automatically verify. For more information, see Verifying contact information at sign-up. * *(string) --* * **AliasAttributes** (*list*) -- Attributes supported as an alias for this user pool. For more information about alias attributes, see Customizing sign-in attributes. * *(string) --* * **UsernameAttributes** (*list*) -- Specifies whether a user can use an email address or phone number as a username when they sign up. For more information, see Customizing sign-in attributes. * *(string) --* * **SmsVerificationMessage** (*string*) -- This parameter is no longer used. * **EmailVerificationMessage** (*string*) -- This parameter is no longer used. * **EmailVerificationSubject** (*string*) -- This parameter is no longer used. * **VerificationMessageTemplate** (*dict*) -- The template for the verification message that your user pool delivers to users who set an email address or phone number attribute. 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 "{####}". * **SmsAuthenticationMessage** (*string*) -- The contents of the SMS message that your user pool sends to users in SMS OTP and MFA authentication. * **MfaConfiguration** (*string*) -- Sets multi-factor authentication (MFA) to be on, off, or optional. When "ON", all users must set up MFA before they can sign in. When "OPTIONAL", your application must make a client- side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, choose "OPTIONAL". When "MfaConfiguration" is "OPTIONAL", managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor. * **UserAttributeUpdateSettings** (*dict*) -- The settings for updates to user attributes. These settings include the property "AttributesRequireVerificationBeforeUpdate", a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers. * **AttributesRequireVerificationBeforeUpdate** *(list) --* Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value. When "AttributesRequireVerificationBeforeUpdate" is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where "AttributesRequireVerificationBeforeUpdate" is false, API operations that change attribute values can immediately update a user’s "email" or "phone_number" attribute. * *(string) --* * **DeviceConfiguration** (*dict*) -- The device-remembering configuration for a user pool. Device remembering or device tracking is a "Remember me on this device" option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool. A null value indicates that you have deactivated device remembering in your user pool. Note: When you provide a value for any "DeviceConfiguration" field, you activate the Amazon Cognito device-remembering feature. For more information, see Working with devices. * **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). Note: Whether or not "ChallengeRequiredOnNewDevice" is true, users who sign in with devices that have not been confirmed or remembered must still provide a second factor in a user pool that requires 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. * **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 ". 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*) -- The settings for your Amazon Cognito user pool to send SMS messages with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account. For more information see SMS message settings. * **SnsCallerArn** *(string) --* **[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. * **UserPoolTags** (*dict*) -- 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) --* * **AdminCreateUserConfig** (*dict*) -- The configuration for administrative creation of users. Includes the template for the invitation message for new users, the duration of temporary passwords, and permitting self-service sign-up. * **AllowAdminCreateUserOnly** *(boolean) --* The setting for allowing self-service sign-up. When "true", only administrators can create new user profiles. When "false", users can register themselves and create a new user profile with the "SignUp" operation. * **UnusedAccountValidityDays** *(integer) --* This parameter is no longer in use. The password expiration limit in days for administrator- created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call "AdminCreateUser" again, specifying "RESEND" for the "MessageAction" parameter. The default value for this parameter is 7. * **InviteMessageTemplate** *(dict) --* The template for the welcome message to new users. This template must include the "{####}" temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder. See also Customizing User Invitation Messages. * **SMSMessage** *(string) --* The message template for SMS messages. * **EmailMessage** *(string) --* The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER. * **EmailSubject** *(string) --* The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER. * **Schema** (*list*) -- An array of attributes for the new user pool. You can add custom attributes and modify the properties of default attributes. The specifications in this parameter set the required attributes in your user pool. For more information, see Working with user attributes. * *(dict) --* A list of the user attributes and their properties in your user pool. The attribute schema contains standard attributes, custom attributes with a "custom:" prefix, and developer attributes with a "dev:" prefix. For more information, see User pool attributes. Developer-only "dev:" attributes are a legacy feature of user pools, and are read-only to all app clients. You can create and update developer-only attributes only with IAM- authenticated API operations. Use app client read/write permissions instead. * **Name** *(string) --* The name of your user pool attribute. When you create or update a user pool, adding a schema attribute creates a custom or developer-only attribute. When you add an attribute with a "Name" value of "MyAttribute", Amazon Cognito creates the custom attribute "custom:MyAttribute". When "DeveloperOnlyAttribute" is "true", Amazon Cognito creates your attribute as "dev:MyAttribute". In an operation that describes a user pool, Amazon Cognito returns this value as "value" for standard attributes, "custom:value" for custom attributes, and "dev:value" for developer-only attributes.. * **AttributeDataType** *(string) --* The data format of the values for your attribute. When you choose an "AttributeDataType", Amazon Cognito validates the input against the data type. A custom attribute value in your user's ID token is always a string, for example ""custom:isMember" : "true"" or ""custom:YearsAsMember" : "12"". * **DeveloperOnlyAttribute** *(boolean) --* Note: You should use WriteAttributes in the user pool client to control how attributes can be mutated for new use cases instead of using "DeveloperOnlyAttribute". 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. * **UserPoolAddOns** (*dict*) -- Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to "AUDIT". To configure automatic security responses to potentially unwanted traffic to your user pool, set to "ENFORCED". For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier. * **AdvancedSecurityMode** *(string) --* **[REQUIRED]** The operating mode of threat protection for standard authentication types in your user pool, including username- password and secure remote password (SRP) authentication. * **AdvancedSecurityAdditionalFlows** *(dict) --* Threat protection configuration options for additional authentication types in your user pool, including custom authentication. * **CustomAuthMode** *(string) --* The operating mode of threat protection in custom authentication with Custom authentication challenge Lambda triggers. * **UsernameConfiguration** (*dict*) -- Sets the case sensitivity option for sign-in usernames. When "CaseSensitive" is "false" (case insensitive), users can sign in with any combination of capital and lowercase letters. For example, "username", "USERNAME", or "UserName", or for email, "email@example.com" or "EMaiL@eXamplE.Com". For most use cases, set case sensitivity to "false" as a best practice. When usernames and email addresses are case insensitive, Amazon Cognito treats any variation in case as the same user, and prevents a case variation from being assigned to the same attribute for a different user. When "CaseSensitive" is "true" (case sensitive), Amazon Cognito interprets "USERNAME" and "UserName" as distinct users. This configuration is immutable after you set it. * **CaseSensitive** *(boolean) --* **[REQUIRED]** Specifies whether user name case sensitivity will be applied for all users in the user pool through Amazon Cognito APIs. For most use cases, set case sensitivity to "False" (case insensitive) as a best practice. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name. Valid values include: true Enables case sensitivity for all username input. When this option is set to "true", users must sign in using the exact capitalization of their given username, such as “UserName”. This is the default value. false Enables case insensitivity for all username input. For example, when this option is set to "false", users can sign in using "username", "USERNAME", or "UserName". This option also enables both "preferred_username" and "email" alias to be case insensitive, in addition to the "username" attribute. * **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. Email MFA is also disqualifying for account recovery with email. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred over email. As a best practice, configure both "verified_email" and "verified_phone_number", with one having a higher priority than the other. * **RecoveryMechanisms** *(list) --* The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators. * *(dict) --* A recovery option for a user. The "AccountRecoverySettingType" data type is an array of this object. Each "RecoveryOptionType" has a priority property that determines whether it is a primary or secondary option. For example, if "verified_email" has a priority of "1" and "verified_phone_number" has a priority of "2", your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The "admin_only" option prevents self-service account recovery. * **Priority** *(integer) --* **[REQUIRED]** Your priority preference for using the specified attribute in account recovery. The highest priority is "1". * **Name** *(string) --* **[REQUIRED]** The recovery method that this object sets a recovery option for. * **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". Return type: dict Returns: **Response Syntax** { 'UserPool': { 'Id': 'string', 'Name': 'string', 'Policies': { 'PasswordPolicy': { 'MinimumLength': 123, 'RequireUppercase': True|False, 'RequireLowercase': True|False, 'RequireNumbers': True|False, 'RequireSymbols': True|False, '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'|'V3_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) --* The details of the created user pool. * **Id** *(string) --* The ID of the user pool. * **Name** *(string) --* The name of the user pool. * **Policies** *(dict) --* A list of user pool policies. Contains the policy that sets password-complexity requirements. * **PasswordPolicy** *(dict) --* The password policy settings for a user pool, including complexity, history, and length requirements. * **MinimumLength** *(integer) --* The minimum length of the password in the policy that you have set. This value can't be less than 6. * **RequireUppercase** *(boolean) --* The requirement in a password policy that users must include at least one uppercase letter in their password. * **RequireLowercase** *(boolean) --* The requirement in a password policy that users must include at least one lowercase letter in their password. * **RequireNumbers** *(boolean) --* The requirement in a password policy that users must include at least one number in their password. * **RequireSymbols** *(boolean) --* The requirement in a password policy that users must include at least one symbol in their password. * **PasswordHistorySize** *(integer) --* The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of "n" previous passwords, where "n" is the value of "PasswordHistorySize". * **TemporaryPasswordValidityDays** *(integer) --* The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to "7". If you submit a value of "0", Amazon Cognito treats it as a null value and sets "TemporaryPasswordValidityDays" to its default value. Note: When you set "TemporaryPasswordValidityDays" for a user pool, you can no longer set a value for the legacy "UnusedAccountValidityDays" parameter in that user pool. * **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. * **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) --* Note: You should use WriteAttributes in the user pool client to control how attributes can be mutated for new use cases instead of using "DeveloperOnlyAttribute". Specifies whether the attribute type is developer only. This attribute can only be modified by an administrator. Users won't be able to modify this attribute using their access token. For example, "DeveloperOnlyAttribute" can be modified using AdminUpdateUserAttributes but can't be updated using UpdateUserAttributes. * **Mutable** *(boolean) --* Specifies whether the value of the attribute can be changed. Any user pool attribute whose value you map from an IdP attribute must be mutable, with a parameter value of "true". Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute. For more information, see Specifying Identity Provider Attribute Mappings for Your User Pool. * **Required** *(boolean) --* Specifies whether a user pool attribute is required. If the attribute is required and the user doesn't provide a value, registration or sign-in will fail. * **NumberAttributeConstraints** *(dict) --* Specifies the constraints for an attribute of the number type. * **MinValue** *(string) --* The minimum value of an attribute that is of the number data type. * **MaxValue** *(string) --* The maximum length of a number attribute value. Must be a number less than or equal to "2^1023", represented as a string with a length of 131072 characters or fewer. * **StringAttributeConstraints** *(dict) --* Specifies the constraints for an attribute of the string type. * **MinLength** *(string) --* The minimum length of a string attribute value. * **MaxLength** *(string) --* The maximum length of a string attribute value. Must be a number less than or equal to "2^1023", represented as a string with a length of 131072 characters or fewer. * **AutoVerifiedAttributes** *(list) --* The attributes that are auto-verified in a user pool. * *(string) --* * **AliasAttributes** *(list) --* Attributes supported as an alias for this user pool. An alias is an attribute that users can enter as an alternative username. Possible values: **phone_number**, **email**, or **preferred_username**. * *(string) --* * **UsernameAttributes** *(list) --* Specifies whether a user can use an email address or phone number as a username when they sign up. * *(string) --* * **SmsVerificationMessage** *(string) --* This parameter is no longer used. * **EmailVerificationMessage** *(string) --* This parameter is no longer used. * **EmailVerificationSubject** *(string) --* This parameter is no longer used. * **VerificationMessageTemplate** *(dict) --* The template for the verification message that your user pool delivers to users who set an email address or phone number attribute. * **SmsMessage** *(string) --* The template for SMS messages that Amazon Cognito sends to your users. * **EmailMessage** *(string) --* The template for email messages that Amazon Cognito sends to your users. You can set an "EmailMessage" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **EmailSubject** *(string) --* The subject line for the email message template. You can set an "EmailSubject" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **EmailMessageByLink** *(string) --* The email message template for sending a confirmation link to the user. You can set an "EmailMessageByLink" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **EmailSubjectByLink** *(string) --* The subject line for the email message template for sending a confirmation link to the user. You can set an "EmailSubjectByLink" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **DefaultEmailOption** *(string) --* The configuration of verification emails to contain a clickable link or a verification code. For link, your template body must contain link text in the format "{##Click here##}". "Click here" in the example is a customizable string. For code, your template body must contain a code placeholder in the format "{####}". * **SmsAuthenticationMessage** *(string) --* The contents of the SMS authentication message. * **UserAttributeUpdateSettings** *(dict) --* The settings for updates to user attributes. These settings include the property "AttributesRequireVerificationBeforeUpdate", a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers. * **AttributesRequireVerificationBeforeUpdate** *(list) --* Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value. When "AttributesRequireVerificationBeforeUpdate" is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where "AttributesRequireVerificationBeforeUpdate" is false, API operations that change attribute values can immediately update a user’s "email" or "phone_number" attribute. * *(string) --* * **MfaConfiguration** *(string) --* Can be one of the following values: * "OFF" - MFA tokens aren't required and can't be specified during user registration. * "ON" - MFA tokens are required for all user registrations. You can only specify required when you're initially creating a user pool. * "OPTIONAL" - Users have the option when registering to create an MFA token. * **DeviceConfiguration** *(dict) --* The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool. Note: When you provide a value for any "DeviceConfiguration" field, you activate the Amazon Cognito device- remembering feature. * **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). Note: Whether or not "ChallengeRequiredOnNewDevice" is true, users who sign in with devices that have not been confirmed or remembered must still provide a second factor in a user pool that requires 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 ". 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. The password expiration limit in days for administrator- created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call "AdminCreateUser" again, specifying "RESEND" for the "MessageAction" parameter. The default value for this parameter is 7. * **InviteMessageTemplate** *(dict) --* The template for the welcome message to new users. This template must include the "{####}" temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder. See also Customizing User Invitation Messages. * **SMSMessage** *(string) --* The message template for SMS messages. * **EmailMessage** *(string) --* The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER. * **EmailSubject** *(string) --* The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER. * **UserPoolAddOns** *(dict) --* Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to "AUDIT". To configure automatic security responses to potentially unwanted traffic to your user pool, set to "ENFORCED". For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier. * **AdvancedSecurityMode** *(string) --* The operating mode of threat protection for standard authentication types in your user pool, including username-password and secure remote password (SRP) authentication. * **AdvancedSecurityAdditionalFlows** *(dict) --* Threat protection configuration options for additional authentication types in your user pool, including custom authentication. * **CustomAuthMode** *(string) --* The operating mode of threat protection in custom authentication with Custom authentication challenge Lambda triggers. * **UsernameConfiguration** *(dict) --* Case sensitivity of the username input for the selected sign-in option. When case sensitivity is set to "False" (case insensitive), users can sign in with any combination of capital and lowercase letters. For example, "username", "USERNAME", or "UserName", or for email, "email@example.com" or "EMaiL@eXamplE.Com". For most use cases, set case sensitivity to "False" (case insensitive) as a best practice. When usernames and email addresses are case insensitive, Amazon Cognito treats any variation in case as the same user, and prevents a case variation from being assigned to the same attribute for a different user. * **CaseSensitive** *(boolean) --* Specifies whether user name case sensitivity will be applied for all users in the user pool through Amazon Cognito APIs. For most use cases, set case sensitivity to "False" (case insensitive) as a best practice. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name. Valid values include: true Enables case sensitivity for all username input. When this option is set to "true", users must sign in using the exact capitalization of their given username, such as “UserName”. This is the default value. false Enables case insensitivity for all username input. For example, when this option is set to "false", users can sign in using "username", "USERNAME", or "UserName". This option also enables both "preferred_username" and "email" alias to be case insensitive, in addition to the "username" attribute. * **Arn** *(string) --* The Amazon Resource Name (ARN) of the user pool. * **AccountRecoverySetting** *(dict) --* The available verified method a user can use to recover their password when they call "ForgotPassword". You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email. * **RecoveryMechanisms** *(list) --* The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators. * *(dict) --* A recovery option for a user. The "AccountRecoverySettingType" data type is an array of this object. Each "RecoveryOptionType" has a priority property that determines whether it is a primary or secondary option. For example, if "verified_email" has a priority of "1" and "verified_phone_number" has a priority of "2", your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The "admin_only" option prevents self-service account recovery. * **Priority** *(integer) --* Your priority preference for using the specified attribute in account recovery. The highest priority is "1". * **Name** *(string) --* The recovery method that this object sets a recovery option for. * **UserPoolTier** *(string) --* The user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to "ESSENTIALS". **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserPoolTaggingExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.TierChangeNotAllowedE xception" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / create_identity_provider create_identity_provider ************************ CognitoIdentityProvider.Client.create_identity_provider(**kwargs) Adds a configuration and trust relationship between a third-party identity provider (IdP) and a user pool. Amazon Cognito accepts sign-in with third-party identity providers through managed login and OIDC relying-party libraries. For more information, see Third- party IdP sign-in. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.create_identity_provider( UserPoolId='string', ProviderName='string', ProviderType='SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'SignInWithApple'|'OIDC', ProviderDetails={ 'string': 'string' }, AttributeMapping={ 'string': 'string' }, IdpIdentifiers=[ 'string', ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The Id of the user pool where you want to create an IdP. * **ProviderName** (*string*) -- **[REQUIRED]** The name that you want to assign to the IdP. You can pass the identity provider name in the "identity_provider" query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP. * **ProviderType** (*string*) -- **[REQUIRED]** The type of IdP that you want to add. Amazon Cognito supports OIDC, SAML 2.0, Login With Amazon, Sign In With Apple, Google, and Facebook IdPs. * **ProviderDetails** (*dict*) -- **[REQUIRED]** The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP "authorize_scopes" values must match the values listed here. OpenID Connect (OIDC) Amazon Cognito accepts the following elements when it can't discover endpoint URLs from "oidc_issuer": "attributes_url", "authorize_url", "jwks_uri", "token_url". Create or update request: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" Describe response: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "attributes_url_add_attributes": "false", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" SAML Create or update request with Metadata URL: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256" }" Create or update request with Metadata file: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" }" The value of "MetadataFile" must be the plaintext metadata document with all quote (") characters escaped by backslashes. Describe response: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256", "SLORedirectBindingURI": "https://auth.example.com/slo/saml", "SSORedirectBindingURI": "https://auth.example.com/sso/saml" }" LoginWithAmazon Create or update request: ""ProviderDetails": { "authorize_scopes": "profile postal_code", "client_id": "amzn1 .application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret"" Describe response: ""ProviderDetails": { "attributes_url": "https://api.amazon.com/user/profile", "attributes_url_add_attributes": "false", "authorize_scopes": "profile postal_code", "authorize_url": "https://www.amazon.com/ap/oa", "client_id": "amzn1 .application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret", "token_request_method": "POST", "token_url": "https://api.amazon.com/auth/o2/token" }" Google Create or update request: ""ProviderDetails": { "authorize_scopes": "email profile openid", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "attributes_url": "https://people.googleapis.com/v1/people/me?personFields=", "attributes_url_add_attributes": "true", "authorize_scopes": "email profile openid", "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret", "oidc_issuer": "https://accounts.google.com", "token_request_method": "POST", "token_url": "https://www.googleapis.com/oauth2/v4/token" }" SignInWithApple Create or update request: ""ProviderDetails": { "authorize_scopes": "email name", "client_id": "com.example.cognito", "private_key": "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" }" Describe response: ""ProviderDetails": { "attributes_url_add_attributes": "false", "authorize_scopes": "email name", "authorize_url": "https://appleid.apple.com/auth/authorize", "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": "https://appleid.apple.com", "team_id": "2EXAMPLE", "token_request_method": "POST", "token_url": "https://appleid.apple.com/auth/token" }" Facebook Create or update request: ""ProviderDetails": { "api_version": "v17.0", "authorize_scopes": "public_profile, email", "client_id": "1example23456789", "client_secret": "provider- app-client-secret" }" Describe response: ""ProviderDetails": { "api_version": "v17.0", "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", "attributes_url_add_attributes": "true", "authorize_scopes": "public_profile, email", "authorize_url": "https://www.facebook.com/v17.0/dialog/oauth", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "token_request_method": "GET", "token_url": "https://graph.facebook.com/v17.0/oauth/access_token" }" * *(string) --* * *(string) --* * **AttributeMapping** (*dict*) -- A mapping of IdP attributes to standard and custom user pool attributes. Specify a user pool attribute as the key of the key-value pair, and the IdP attribute claim name as the value. * *(string) --* * *(string) --* * **IdpIdentifiers** (*list*) -- An array of IdP identifiers, for example ""IdPIdentifiers": [ "MyIdP", "MyIdP2" ]". Identifiers are friendly names that you can pass in the "idp_identifier" query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP. Identifiers in a domain format also enable the use of email-address matching with SAML providers. * *(string) --* Return type: dict Returns: **Response Syntax** { 'IdentityProvider': { 'UserPoolId': 'string', 'ProviderName': 'string', 'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'SignInWithApple'|'OIDC', 'ProviderDetails': { 'string': 'string' }, 'AttributeMapping': { 'string': 'string' }, 'IdpIdentifiers': [ 'string', ], 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **IdentityProvider** *(dict) --* The details of the new user pool IdP. * **UserPoolId** *(string) --* The ID of the user pool associated with the IdP. * **ProviderName** *(string) --* A friendly name for the IdP. * **ProviderType** *(string) --* The type of IdP. Either SAML, OIDC, or a named social identity provider. * **ProviderDetails** *(dict) --* The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP "authorize_scopes" values must match the values listed here. OpenID Connect (OIDC) Amazon Cognito accepts the following elements when it can't discover endpoint URLs from "oidc_issuer": "attributes_url", "authorize_url", "jwks_uri", "token_url". Create or update request: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" Describe response: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "attributes_url_add_attributes": "false", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "jwks_uri": "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" SAML Create or update request with Metadata URL: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256" }" Create or update request with Metadata file: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" }" The value of "MetadataFile" must be the plaintext metadata document with all quote (") characters escaped by backslashes. Describe response: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256", "SLORedirectBindingURI": "https://auth.example.com/slo/saml", "SSORedirectBindingURI": "https://auth.example.com/sso/saml" }" LoginWithAmazon Create or update request: ""ProviderDetails": { "authorize_scopes": "profile postal_code", "client_id": "amzn1.application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret"" Describe response: ""ProviderDetails": { "attributes_url": "https://api.amazon.com/user/profile", "attributes_url_add_attributes": "false", "authorize_scopes": "profile postal_code", "authorize_url": "https://www.amazon.com/ap/oa", "client_id": "amzn1.application- oa2-client.1example23456789", "client_secret": "provider- app-client-secret", "token_request_method": "POST", "token_url": "https://api.amazon.com/auth/o2/token" }" Google Create or update request: ""ProviderDetails": { "authorize_scopes": "email profile openid", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "attributes_url": "https://people.googleapis.com/v1/people/me?personFields= ", "attributes_url_add_attributes": "true", "authorize_scopes": "email profile openid", "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret", "oidc_issuer": "https://accounts.google.com", "token_request_method": "POST", "token_url": "https://www.googleapis.com/oauth2/v4/token" }" SignInWithApple Create or update request: ""ProviderDetails": { "authorize_scopes": "email name", "client_id": "com.example.cognito", "private_key": "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" }" Describe response: ""ProviderDetails": { "attributes_url_add_attributes": "false", "authorize_scopes": "email name", "authorize_url": "https://appleid.apple.com/auth/authorize", "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": "https://appleid.apple.com", "team_id": "2EXAMPLE", "token_request_method": "POST", "token_url": "https://appleid.apple.com/auth/token" }" Facebook Create or update request: ""ProviderDetails": { "api_version": "v17.0", "authorize_scopes": "public_profile, email", "client_id": "1example23456789", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "api_version": "v17.0", "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", "attributes_url_add_attributes": "true", "authorize_scopes": "public_profile, email", "authorize_url": "https://www.facebook.com/v17.0/dialog/oauth", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "token_request_method": "GET", "token_url": "https://graph.facebook.com/v17.0/oauth/access_token" }" * *(string) --* * *(string) --* * **AttributeMapping** *(dict) --* A mapping of IdP attributes to standard and custom user pool attributes. * *(string) --* * *(string) --* * **IdpIdentifiers** *(list) --* A list of IdP identifiers. IdP identifiers are strings that represent friendly names or domain names of IdPs, for example "MyIdP" or "auth.example.com". You can choose to route user authorization requests to the right IdP with either IdP identifiers or IdP names. For more information, see "identity_provider" and "idp_identifier" at Authorize endpoint. * *(string) --* * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.DuplicateProviderExce ption" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / get_identity_provider_by_identifier get_identity_provider_by_identifier *********************************** CognitoIdentityProvider.Client.get_identity_provider_by_identifier(**kwargs) Given the identifier of an identity provider (IdP), for example "examplecorp", returns information about the user pool configuration for that IdP. For more information about IdPs, see Third-party IdP sign-in. See also: AWS API Documentation **Request Syntax** response = client.get_identity_provider_by_identifier( UserPoolId='string', IdpIdentifier='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to get information about the IdP. * **IdpIdentifier** (*string*) -- **[REQUIRED]** The identifier that you assigned to your user pool. The identifier is an alternative name for an IdP that is distinct from the IdP name. For example, an IdP with a name of "MyIdP" might have an identifier of the email domain "example.com". Return type: dict Returns: **Response Syntax** { 'IdentityProvider': { 'UserPoolId': 'string', 'ProviderName': 'string', 'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'SignInWithApple'|'OIDC', 'ProviderDetails': { 'string': 'string' }, 'AttributeMapping': { 'string': 'string' }, 'IdpIdentifiers': [ 'string', ], 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **IdentityProvider** *(dict) --* The configuration of the IdP in your user pool. Includes additional identifiers, the IdP name and type, and trust- relationship details like the issuer URL. * **UserPoolId** *(string) --* The ID of the user pool associated with the IdP. * **ProviderName** *(string) --* A friendly name for the IdP. * **ProviderType** *(string) --* The type of IdP. Either SAML, OIDC, or a named social identity provider. * **ProviderDetails** *(dict) --* The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP "authorize_scopes" values must match the values listed here. OpenID Connect (OIDC) Amazon Cognito accepts the following elements when it can't discover endpoint URLs from "oidc_issuer": "attributes_url", "authorize_url", "jwks_uri", "token_url". Create or update request: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" Describe response: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "attributes_url_add_attributes": "false", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "jwks_uri": "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" SAML Create or update request with Metadata URL: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256" }" Create or update request with Metadata file: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" }" The value of "MetadataFile" must be the plaintext metadata document with all quote (") characters escaped by backslashes. Describe response: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256", "SLORedirectBindingURI": "https://auth.example.com/slo/saml", "SSORedirectBindingURI": "https://auth.example.com/sso/saml" }" LoginWithAmazon Create or update request: ""ProviderDetails": { "authorize_scopes": "profile postal_code", "client_id": "amzn1.application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret"" Describe response: ""ProviderDetails": { "attributes_url": "https://api.amazon.com/user/profile", "attributes_url_add_attributes": "false", "authorize_scopes": "profile postal_code", "authorize_url": "https://www.amazon.com/ap/oa", "client_id": "amzn1.application- oa2-client.1example23456789", "client_secret": "provider- app-client-secret", "token_request_method": "POST", "token_url": "https://api.amazon.com/auth/o2/token" }" Google Create or update request: ""ProviderDetails": { "authorize_scopes": "email profile openid", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "attributes_url": "https://people.googleapis.com/v1/people/me?personFields= ", "attributes_url_add_attributes": "true", "authorize_scopes": "email profile openid", "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret", "oidc_issuer": "https://accounts.google.com", "token_request_method": "POST", "token_url": "https://www.googleapis.com/oauth2/v4/token" }" SignInWithApple Create or update request: ""ProviderDetails": { "authorize_scopes": "email name", "client_id": "com.example.cognito", "private_key": "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" }" Describe response: ""ProviderDetails": { "attributes_url_add_attributes": "false", "authorize_scopes": "email name", "authorize_url": "https://appleid.apple.com/auth/authorize", "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": "https://appleid.apple.com", "team_id": "2EXAMPLE", "token_request_method": "POST", "token_url": "https://appleid.apple.com/auth/token" }" Facebook Create or update request: ""ProviderDetails": { "api_version": "v17.0", "authorize_scopes": "public_profile, email", "client_id": "1example23456789", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "api_version": "v17.0", "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", "attributes_url_add_attributes": "true", "authorize_scopes": "public_profile, email", "authorize_url": "https://www.facebook.com/v17.0/dialog/oauth", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "token_request_method": "GET", "token_url": "https://graph.facebook.com/v17.0/oauth/access_token" }" * *(string) --* * *(string) --* * **AttributeMapping** *(dict) --* A mapping of IdP attributes to standard and custom user pool attributes. * *(string) --* * *(string) --* * **IdpIdentifiers** *(list) --* A list of IdP identifiers. IdP identifiers are strings that represent friendly names or domain names of IdPs, for example "MyIdP" or "auth.example.com". You can choose to route user authorization requests to the right IdP with either IdP identifiers or IdP names. For more information, see "identity_provider" and "idp_identifier" at Authorize endpoint. * *(string) --* * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_resource_server describe_resource_server ************************ CognitoIdentityProvider.Client.describe_resource_server(**kwargs) Describes a resource server. For more information about resource servers, see Access control with resource servers. See also: AWS API Documentation **Request Syntax** response = client.describe_resource_server( UserPoolId='string', Identifier='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that hosts the resource server. * **Identifier** (*string*) -- **[REQUIRED]** A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system- data". You can also set an API URL like "https://solar-system- data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope- identifier strings increase the size of your access tokens. Return type: dict Returns: **Response Syntax** { 'ResourceServer': { 'UserPoolId': 'string', 'Identifier': 'string', 'Name': 'string', 'Scopes': [ { 'ScopeName': 'string', 'ScopeDescription': 'string' }, ] } } **Response Structure** * *(dict) --* * **ResourceServer** *(dict) --* The details of the requested resource server. * **UserPoolId** *(string) --* The ID of the user pool that contains the resource server configuration. * **Identifier** *(string) --* A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system-data". You can also set an API URL like "https://solar-system-data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope-identifier strings increase the size of your access tokens. * **Name** *(string) --* The name of the resource server. * **Scopes** *(list) --* A list of scopes that are defined for the resource server. * *(dict) --* One custom scope associated with a user pool resource server. This data type is a member of "ResourceServerScopeType". For more information, see Scopes, M2M, and API authorization with resource servers. * **ScopeName** *(string) --* The name of the scope. Amazon Cognito renders custom scopes in the format "resourceServerIdentifier/ScopeName". For example, if this parameter is "exampleScope" in the resource server with the identifier "exampleResourceServer", you request and receive the scope "exampleResourceServer/exampleScope". * **ScopeDescription** *(string) --* A friendly description of a custom scope. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_user_pool_client describe_user_pool_client ************************* CognitoIdentityProvider.Client.describe_user_pool_client(**kwargs) Given an app client ID, returns configuration information. This operation is useful when you want to inspect an existing app client and programmatically replicate the configuration to another app client. For more information about app clients, see App clients. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.describe_user_pool_client( UserPoolId='string', ClientId='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the app client you want to describe. * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client that you want to describe. Return type: dict Returns: **Response Syntax** { 'UserPoolClient': { 'UserPoolId': 'string', 'ClientName': 'string', 'ClientId': 'string', 'ClientSecret': 'string', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1), 'RefreshTokenValidity': 123, 'AccessTokenValidity': 123, 'IdTokenValidity': 123, 'TokenValidityUnits': { 'AccessToken': 'seconds'|'minutes'|'hours'|'days', 'IdToken': 'seconds'|'minutes'|'hours'|'days', 'RefreshToken': 'seconds'|'minutes'|'hours'|'days' }, 'ReadAttributes': [ 'string', ], 'WriteAttributes': [ 'string', ], 'ExplicitAuthFlows': [ 'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH', ], 'SupportedIdentityProviders': [ 'string', ], 'CallbackURLs': [ 'string', ], 'LogoutURLs': [ 'string', ], 'DefaultRedirectURI': 'string', 'AllowedOAuthFlows': [ 'code'|'implicit'|'client_credentials', ], 'AllowedOAuthScopes': [ 'string', ], 'AllowedOAuthFlowsUserPoolClient': True|False, 'AnalyticsConfiguration': { 'ApplicationId': 'string', 'ApplicationArn': 'string', 'RoleArn': 'string', 'ExternalId': 'string', 'UserDataShared': True|False }, 'PreventUserExistenceErrors': 'LEGACY'|'ENABLED', 'EnableTokenRevocation': True|False, 'EnablePropagateAdditionalUserContextData': True|False, 'AuthSessionValidity': 123, 'RefreshTokenRotation': { 'Feature': 'ENABLED'|'DISABLED', 'RetryGracePeriodSeconds': 123 } } } **Response Structure** * *(dict) --* Represents the response from the server from a request to describe the user pool client. * **UserPoolClient** *(dict) --* The details of the request app client. * **UserPoolId** *(string) --* The ID of the user pool associated with the app client. * **ClientName** *(string) --* The name of the app client. * **ClientId** *(string) --* The ID of the app client. * **ClientSecret** *(string) --* The app client secret. * **LastModifiedDate** *(datetime) --* The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java "Date" object. * **CreationDate** *(datetime) --* The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java "Date" object. * **RefreshTokenValidity** *(integer) --* The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for "RefreshTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "RefreshTokenValidity" as "10" and "TokenValidityUnits" as "days", your user can refresh their session and retrieve new access and ID tokens for 10 days. The default time unit for "RefreshTokenValidity" in an API request is days. You can't set "RefreshTokenValidity" to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days. * **AccessTokenValidity** *(integer) --* The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for "AccessTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "AccessTokenValidity" to "10" and "TokenValidityUnits" to "hours", your user can authorize access with their access token for 10 hours. The default time unit for "AccessTokenValidity" in an API request is hours. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour. * **IdTokenValidity** *(integer) --* The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for "IdTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "IdTokenValidity" as "10" and "TokenValidityUnits" as "hours", your user can authenticate their session with their ID token for 10 hours. The default time unit for "IdTokenValidity" in an API request is hours. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour. * **TokenValidityUnits** *(dict) --* The time units that, with "IdTokenValidity", "AccessTokenValidity", and "RefreshTokenValidity", set and display the duration of ID, access, and refresh tokens for an app client. You can assign a separate token validity unit to each type of token. * **AccessToken** *(string) --* A time unit for the value that you set in the "AccessTokenValidity" parameter. The default "AccessTokenValidity" time unit is "hours". "AccessTokenValidity" duration can range from five minutes to one day. * **IdToken** *(string) --* A time unit for the value that you set in the "IdTokenValidity" parameter. The default "IdTokenValidity" time unit is "hours". "IdTokenValidity" duration can range from five minutes to one day. * **RefreshToken** *(string) --* A time unit for the value that you set in the "RefreshTokenValidity" parameter. The default "RefreshTokenValidity" time unit is "days". "RefreshTokenValidity" duration can range from 60 minutes to 10 years. * **ReadAttributes** *(list) --* The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list. When you don't specify the "ReadAttributes" for your app client, your app can read the values of "email_verified", "phone_number_verified", and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, "ReadAttributes" doesn't return any information. Amazon Cognito only populates "ReadAttributes" in the API response if you have specified your own custom set of read attributes. * *(string) --* * **WriteAttributes** *(list) --* The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list. When you don't specify the "WriteAttributes" for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, "WriteAttributes" doesn't return any information. Amazon Cognito only populates "WriteAttributes" in the API response if you have specified your own custom set of write attributes. If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool. * *(string) --* * **ExplicitAuthFlows** *(list) --* The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions. Note: If you don't specify a value for "ExplicitAuthFlows", your app client supports "ALLOW_REFRESH_TOKEN_AUTH", "ALLOW_USER_SRP_AUTH", and "ALLOW_CUSTOM_AUTH". The values for authentication flow options include the following. * "ALLOW_USER_AUTH": Enable selection-based sign-in with "USER_AUTH". This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username- password and SRP authentication without other "ExplicitAuthFlows" permitting them. For example users can complete an SRP challenge through "USER_AUTH" without the flow "USER_SRP_AUTH" being active for the app client. This flow doesn't include "CUSTOM_AUTH". To activate this setting, your user pool must be in the Essentials tier or higher. * "ALLOW_ADMIN_USER_PASSWORD_AUTH": Enable admin based user password authentication flow "ADMIN_USER_PASSWORD_AUTH". This setting replaces the "ADMIN_NO_SRP_AUTH" setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password. * "ALLOW_CUSTOM_AUTH": Enable Lambda trigger based authentication. * "ALLOW_USER_PASSWORD_AUTH": Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords. * "ALLOW_USER_SRP_AUTH": Enable SRP-based authentication. * "ALLOW_REFRESH_TOKEN_AUTH": Enable authflow to refresh tokens. In some environments, you will see the values "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY", or "USER_PASSWORD_AUTH". You can't assign these legacy "ExplicitAuthFlows" values to user pool clients at the same time as values that begin with "ALLOW_", like "ALLOW_USER_SRP_AUTH". * *(string) --* * **SupportedIdentityProviders** *(list) --* A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: "COGNITO", "Facebook", "Google", "SignInWithApple", and "LoginWithAmazon". You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example "MySAMLIdP" or "MyOIDCIdP". This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of "COGNITO" from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule. * *(string) --* * **CallbackURLs** *(list) --* A list of allowed redirect (callback) URLs for the IdPs. A redirect URI must: * Be an absolute URI. * Be registered with the authorization server. * Not include a fragment component. See OAuth 2.0 - Redirection Endpoint. Amazon Cognito requires HTTPS over HTTP 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 authorization server features in your app client. This parameter must have a value of "true" before you can configure the following features in your app client. * "CallBackURLs": Callback URLs. * "LogoutURLs": Sign-out redirect URLs. * "AllowedOAuthScopes": OAuth 2.0 scopes. * "AllowedOAuthFlows": Support for authorization code, implicit, and client credentials OAuth 2.0 grants. To use authorization server features, configure one of these features in the Amazon Cognito console or set "AllowedOAuthFlowsUserPoolClient" to "true" in a "CreateUserPoolClient" or "UpdateUserPoolClient" API request. If you don't set a value for "AllowedOAuthFlowsUserPoolClient" in a request with the CLI or SDKs, it defaults to "false". When "false", only SDK-based API sign-in is permitted. * **AnalyticsConfiguration** *(dict) --* The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign. Note: In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools only support sending events to Amazon Pinpoint projects in Amazon Web Services Region us-east-1. In Regions where Amazon Pinpoint is available, user pools support sending events to Amazon Pinpoint projects within that same Region. * **ApplicationId** *(string) --* Your Amazon Pinpoint project ID. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that "ApplicationArn" declares. You can also configure your application to pass an endpoint ID in the "AnalyticsMetadata" parameter of sign-in operations. The endpoint ID is information about the destination for push notifications * **RoleArn** *(string) --* The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics. * **ExternalId** *(string) --* The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint. * **UserDataShared** *(boolean) --* If "UserDataShared" is "true", Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics. * **PreventUserExistenceErrors** *(string) --* When "ENABLED", suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to "ENABLED" and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to "LEGACY", those APIs return a "UserNotFoundException" exception if the user doesn't exist in the user pool. Defaults to "LEGACY". * **EnableTokenRevocation** *(boolean) --* Indicates whether token revocation is activated for the user pool client. When you create a new user pool client, token revocation is activated by default. * **EnablePropagateAdditionalUserContextData** *(boolean) --* When "EnablePropagateAdditionalUserContextData" is true, Amazon Cognito accepts an "IpAddress" value that you send in the "UserContextData" parameter. The "UserContextData" parameter sends information to Amazon Cognito threat protection for risk analysis. You can send "UserContextData" when you sign in Amazon Cognito native users with the "InitiateAuth" and "RespondToAuthChallenge" API operations. When "EnablePropagateAdditionalUserContextData" is false, you can't send your user's source IP address to Amazon Cognito threat protection with unauthenticated API operations. "EnablePropagateAdditionalUserContextData" doesn't affect whether you can send a source IP address in a "ContextData" parameter with the authenticated API operations "AdminInitiateAuth" and "AdminRespondToAuthChallenge". You can only activate "EnablePropagateAdditionalUserContextData" in an app client that has a client secret. For more information about propagation of user context data, see Adding user device and session data to API requests. * **AuthSessionValidity** *(integer) --* Amazon Cognito creates a session token for each API request in an authentication flow. "AuthSessionValidity" is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. * **RefreshTokenRotation** *(dict) --* The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens. * **Feature** *(string) --* The state of refresh token rotation for the current app client. * **RetryGracePeriodSeconds** *(integer) --* When you request a token refresh with "GetTokensFromRefreshToken", the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When "RetryGracePeriodSeconds" is "0", the grace period is disabled and a successful request immediately invalidates the submitted refresh token. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_delete_user_attributes admin_delete_user_attributes **************************** CognitoIdentityProvider.Client.admin_delete_user_attributes(**kwargs) Deletes attribute values from a user. This operation doesn't affect tokens for existing user sessions. The next ID token that the user receives will no longer have the deleted attributes. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_delete_user_attributes( UserPoolId='string', Username='string', UserAttributeNames=[ 'string', ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete user attributes. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **UserAttributeNames** (*list*) -- **[REQUIRED]** An array of strings representing the user attribute names you want to delete. For custom attributes, you must prepend the "custom:" prefix to the attribute name. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response received from the server for a request to delete user attributes. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / delete_group delete_group ************ CognitoIdentityProvider.Client.delete_group(**kwargs) Deletes a group from the specified user pool. When you delete a group, that group no longer contributes to users' "cognito:preferred_group" or "cognito:groups" claims, and no longer influence access-control decision that are based on group membership. For more information about user pool groups, see Adding groups to a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.delete_group( GroupName='string', UserPoolId='string' ) Parameters: * **GroupName** (*string*) -- **[REQUIRED]** The name of the group that you want to delete. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete the group. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / get_user_pool_mfa_config get_user_pool_mfa_config ************************ CognitoIdentityProvider.Client.get_user_pool_mfa_config(**kwargs) Given a user pool ID, returns configuration for sign-in with WebAuthn authenticators and for multi-factor authentication (MFA). This operation describes the following: * The WebAuthn relying party (RP) ID and user-verification settings. * The required, optional, or disabled state of MFA for all user pool users. * The message templates for email and SMS MFA. * The enabled or disabled state of time-based one-time password (TOTP) MFA. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.get_user_pool_mfa_config( UserPoolId='string' ) Parameters: **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to query WebAuthn and MFA configuration. Return type: 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 configuration for SMS message 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 configuration for user pool email message MFA and sign-in with one-time passwords (OTPs). Includes the subject and body of the email message template for sign-in and MFA messages. To activate this setting, your user pool must be in the Essentials tier or higher. * **Message** *(string) --* The template for the email messages that your user pool sends to users with codes for MFA and sign-in with email OTPs. 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 messages that your user pool sends to users with codes for MFA and email OTP sign-in. * **MfaConfiguration** *(string) --* Displays the state of multi-factor authentication (MFA) as on, off, or optional. When "ON", all users must set up MFA before they can sign in. When "OPTIONAL", your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, choose "OPTIONAL". When "MfaConfiguration" is "OPTIONAL", managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor. * **WebAuthnConfiguration** *(dict) --* Shows user pool configuration for sign-in with passkey authenticators like biometric devices and security keys. Passkeys are not eligible MFA factors. They are instead an eligible primary sign-in factor for choice-based authentication, or the "USER_AUTH" flow. * **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) --* When "required", users can only register and sign in users with passkeys that are capable of user verification. When "preferred", your user pool doesn't require the use of authenticators with user verification but encourages it. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_link_provider_for_user admin_link_provider_for_user **************************** CognitoIdentityProvider.Client.admin_link_provider_for_user(**kwargs) Links an existing user account in a user pool, or "DestinationUser", to an identity from an external IdP, or "SourceUser", based on a specified attribute name and value from the external IdP. This operation connects a local user profile with a user identity who hasn't yet signed in from their third-party IdP. When the user signs in with their IdP, they get access-control configuration from the local user profile. Linked local users can also sign in with SDK-based API operations like "InitiateAuth" after they sign in at least once through their IdP. For more information, see Linking federated users. Note: The maximum number of federated identities linked to a user is five. Warning: Because this API allows a user with an external federated identity to sign in as a local user, it is critical that it only be used with external IdPs and linked attributes that you trust. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_link_provider_for_user( UserPoolId='string', DestinationUser={ 'ProviderName': 'string', 'ProviderAttributeName': 'string', 'ProviderAttributeValue': 'string' }, SourceUser={ 'ProviderName': 'string', 'ProviderAttributeName': 'string', 'ProviderAttributeValue': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to link a federated identity. * **DestinationUser** (*dict*) -- **[REQUIRED]** The existing user in the user pool that you want to assign to the external IdP user account. This user can be a local (Username + Password) Amazon Cognito user pools user or a federated user (for example, a SAML or Facebook user). If the user doesn't exist, Amazon Cognito generates an exception. Amazon Cognito returns this user when the new user (with the linked IdP attribute) signs in. For a native username + password user, the "ProviderAttributeValue" for the "DestinationUser" should be the username in the user pool. For a federated user, it should be the provider-specific "user_id". The "ProviderAttributeName" of the "DestinationUser" is ignored. The "ProviderName" should be set to "Cognito" for users in Cognito user pools. Warning: All attributes in the DestinationUser profile must be mutable. If you have assigned the user any immutable custom attributes, the operation won't succeed. * **ProviderName** *(string) --* The name of the provider, such as Facebook, Google, or Login with Amazon. * **ProviderAttributeName** *(string) --* The name of the provider attribute to link to, such as "NameID". * **ProviderAttributeValue** *(string) --* The value of the provider attribute to link to, such as "xxxxx_account". * **SourceUser** (*dict*) -- **[REQUIRED]** An external IdP account for a user who doesn't exist yet in the user pool. This user must be a federated user (for example, a SAML or Facebook user), not another native user. If the "SourceUser" is using a federated social IdP, such as Facebook, Google, or Login with Amazon, you must set the "ProviderAttributeName" to "Cognito_Subject". For social IdPs, the "ProviderName" will be "Facebook", "Google", or "LoginWithAmazon", and Amazon Cognito will automatically parse the Facebook, Google, and Login with Amazon tokens for "id", "sub", and "user_id", respectively. The "ProviderAttributeValue" for the user must be the same value as the "id", "sub", or "user_id" value found in the social IdP token. For OIDC, the "ProviderAttributeName" can be any mapped value from a claim in the ID token, or that your app retrieves from the "userInfo" endpoint. For SAML, the "ProviderAttributeName" can be any mapped value from a claim in the SAML assertion. The following additional considerations apply to "SourceUser" for OIDC and SAML providers. * You must map the claim to a user pool attribute in your IdP configuration, and set the user pool attribute name as the value of "ProviderAttributeName" in your "AdminLinkProviderForUser" request. For example, "email". * When you set "ProviderAttributeName" to "Cognito_Subject", Amazon Cognito will automatically parse the default unique identifier found in the subject from the IdP token. * **ProviderName** *(string) --* The name of the provider, such as Facebook, Google, or Login with Amazon. * **ProviderAttributeName** *(string) --* The name of the provider attribute to link to, such as "NameID". * **ProviderAttributeValue** *(string) --* The value of the provider attribute to link to, such as "xxxxx_account". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / set_risk_configuration set_risk_configuration ********************** CognitoIdentityProvider.Client.set_risk_configuration(**kwargs) Configures threat protection for a user pool or app client. Sets configuration for the following. * Responses to risks with adaptive authentication * Responses to vulnerable passwords with compromised-credentials detection * Notifications to users who have had risky activity detected * IP-address denylist and allowlist To set the risk configuration for the user pool to defaults, send this request with only the "UserPoolId" parameter. To reset the threat protection settings of an app client to be inherited from the user pool, send "UserPoolId" and "ClientId" parameters only. To change threat protection to audit-only or off, update the value of "UserPoolAddOns" in an "UpdateUserPool" request. To activate this setting, your user pool must be on the Plus tier. See also: AWS API Documentation **Request Syntax** response = client.set_risk_configuration( UserPoolId='string', ClientId='string', CompromisedCredentialsRiskConfiguration={ 'EventFilter': [ 'SIGN_IN'|'PASSWORD_CHANGE'|'SIGN_UP', ], 'Actions': { 'EventAction': 'BLOCK'|'NO_ACTION' } }, AccountTakeoverRiskConfiguration={ 'NotifyConfiguration': { 'From': 'string', 'ReplyTo': 'string', 'SourceArn': 'string', 'BlockEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' }, 'NoActionEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' }, 'MfaEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' } }, 'Actions': { 'LowAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' }, 'MediumAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' }, 'HighAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' } } }, RiskExceptionConfiguration={ 'BlockedIPRangeList': [ 'string', ], 'SkippedIPRangeList': [ 'string', ] } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to set a risk configuration. If you include "UserPoolId" in your request, don't include "ClientId". When the client ID is null, the same risk configuration is applied to all the clients in the userPool. When you include both "ClientId" and "UserPoolId", Amazon Cognito maps the configuration to the app client only. * **ClientId** (*string*) -- The ID of the app client where you want to set a risk configuration. If "ClientId" is null, then the risk configuration is mapped to "UserPoolId". When the client ID is null, the same risk configuration is applied to all the clients in the userPool. When you include a "ClientId" parameter, Amazon Cognito maps the configuration to the app client. When you include both "ClientId" and "UserPoolId", Amazon Cognito maps the configuration to the app client only. * **CompromisedCredentialsRiskConfiguration** (*dict*) -- The configuration of automated reactions to detected compromised credentials. Includes settings for blocking future sign-in requests and for the types of password-submission events you want to monitor. * **EventFilter** *(list) --* Settings for the sign-in activity where you want to configure compromised-credentials actions. Defaults to all events. * *(string) --* * **Actions** *(dict) --* **[REQUIRED]** Settings for the actions that you want your user pool to take when Amazon Cognito detects compromised credentials. * **EventAction** *(string) --* **[REQUIRED]** The action that Amazon Cognito takes when it detects compromised credentials. * **AccountTakeoverRiskConfiguration** (*dict*) -- The settings for automated responses and notification templates for adaptive authentication with threat protection. * **NotifyConfiguration** *(dict) --* The settings for composing and sending an email message when threat protection assesses a risk level with adaptive authentication. When you choose to notify users in "AccountTakeoverRiskConfiguration", Amazon Cognito sends an email message using the method and template that you set with this data type. * **From** *(string) --* The email address that sends the email message. The address must be either individually verified with Amazon Simple Email Service, or from a domain that has been verified with Amazon SES. * **ReplyTo** *(string) --* The reply-to email address of an email template. * **SourceArn** *(string) --* **[REQUIRED]** The Amazon Resource Name (ARN) of the identity that is associated with the sending authorization policy. This identity permits Amazon Cognito to send for the email address specified in the "From" parameter. * **BlockEmail** *(dict) --* The template for the email message that your user pool sends when a detected risk event is blocked. * **Subject** *(string) --* **[REQUIRED]** The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML- formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **NoActionEmail** *(dict) --* The template for the email message that your user pool sends when no action is taken in response to a detected risk. * **Subject** *(string) --* **[REQUIRED]** The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML- formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **MfaEmail** *(dict) --* The template for the email message that your user pool sends when MFA is challenged in response to a detected risk. * **Subject** *(string) --* **[REQUIRED]** The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML- formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **Actions** *(dict) --* **[REQUIRED]** A list of account-takeover actions for each level of risk that Amazon Cognito might assess with threat protection. * **LowAction** *(dict) --* The action that you assign to a low-risk assessment by threat protection. * **Notify** *(boolean) --* **[REQUIRED]** Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* **[REQUIRED]** The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **MediumAction** *(dict) --* The action that you assign to a medium-risk assessment by threat protection. * **Notify** *(boolean) --* **[REQUIRED]** Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* **[REQUIRED]** The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **HighAction** *(dict) --* The action that you assign to a high-risk assessment by threat protection. * **Notify** *(boolean) --* **[REQUIRED]** Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* **[REQUIRED]** The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **RiskExceptionConfiguration** (*dict*) -- A set of IP-address overrides to threat protection. You can set up IP-address always-block and always-allow lists. * **BlockedIPRangeList** *(list) --* An always-block IP address list. Overrides the risk decision and always blocks authentication requests. This parameter is displayed and set in CIDR notation. * *(string) --* * **SkippedIPRangeList** *(list) --* An always-allow IP address list. Risk detection isn't performed on the IP addresses in this range list. This parameter is displayed and set in CIDR notation. * *(string) --* Return type: dict Returns: **Response Syntax** { 'RiskConfiguration': { 'UserPoolId': 'string', 'ClientId': 'string', 'CompromisedCredentialsRiskConfiguration': { 'EventFilter': [ 'SIGN_IN'|'PASSWORD_CHANGE'|'SIGN_UP', ], 'Actions': { 'EventAction': 'BLOCK'|'NO_ACTION' } }, 'AccountTakeoverRiskConfiguration': { 'NotifyConfiguration': { 'From': 'string', 'ReplyTo': 'string', 'SourceArn': 'string', 'BlockEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' }, 'NoActionEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' }, 'MfaEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' } }, 'Actions': { 'LowAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' }, 'MediumAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' }, 'HighAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' } } }, 'RiskExceptionConfiguration': { 'BlockedIPRangeList': [ 'string', ], 'SkippedIPRangeList': [ 'string', ] }, 'LastModifiedDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **RiskConfiguration** *(dict) --* The API response that contains the risk configuration that you set and the timestamp of the most recent change. * **UserPoolId** *(string) --* The ID of the user pool that has the risk configuration applied. * **ClientId** *(string) --* The app client where this configuration is applied. When this parameter isn't present, the risk configuration applies to all user pool app clients that don't have client-level settings. * **CompromisedCredentialsRiskConfiguration** *(dict) --* Settings for compromised-credentials actions and authentication types with threat protection in full- function "ENFORCED" mode. * **EventFilter** *(list) --* Settings for the sign-in activity where you want to configure compromised-credentials actions. Defaults to all events. * *(string) --* * **Actions** *(dict) --* Settings for the actions that you want your user pool to take when Amazon Cognito detects compromised credentials. * **EventAction** *(string) --* The action that Amazon Cognito takes when it detects compromised credentials. * **AccountTakeoverRiskConfiguration** *(dict) --* The settings for automated responses and notification templates for adaptive authentication with threat protection. * **NotifyConfiguration** *(dict) --* The settings for composing and sending an email message when threat protection assesses a risk level with adaptive authentication. When you choose to notify users in "AccountTakeoverRiskConfiguration", Amazon Cognito sends an email message using the method and template that you set with this data type. * **From** *(string) --* The email address that sends the email message. The address must be either individually verified with Amazon Simple Email Service, or from a domain that has been verified with Amazon SES. * **ReplyTo** *(string) --* The reply-to email address of an email template. * **SourceArn** *(string) --* The Amazon Resource Name (ARN) of the identity that is associated with the sending authorization policy. This identity permits Amazon Cognito to send for the email address specified in the "From" parameter. * **BlockEmail** *(dict) --* The template for the email message that your user pool sends when a detected risk event is blocked. * **Subject** *(string) --* The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **NoActionEmail** *(dict) --* The template for the email message that your user pool sends when no action is taken in response to a detected risk. * **Subject** *(string) --* The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **MfaEmail** *(dict) --* The template for the email message that your user pool sends when MFA is challenged in response to a detected risk. * **Subject** *(string) --* The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **Actions** *(dict) --* A list of account-takeover actions for each level of risk that Amazon Cognito might assess with threat protection. * **LowAction** *(dict) --* The action that you assign to a low-risk assessment by threat protection. * **Notify** *(boolean) --* Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **MediumAction** *(dict) --* The action that you assign to a medium-risk assessment by threat protection. * **Notify** *(boolean) --* Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **HighAction** *(dict) --* The action that you assign to a high-risk assessment by threat protection. * **Notify** *(boolean) --* Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **RiskExceptionConfiguration** *(dict) --* Exceptions to the risk evaluation configuration, including always-allow and always-block IP address ranges. * **BlockedIPRangeList** *(list) --* An always-block IP address list. Overrides the risk decision and always blocks authentication requests. This parameter is displayed and set in CIDR notation. * *(string) --* * **SkippedIPRangeList** *(list) --* An always-allow IP address list. Risk detection isn't performed on the IP addresses in this range list. This parameter is displayed and set in CIDR notation. * *(string) --* * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserPoolAddOnNotEnabl edException" * "CognitoIdentityProvider.Client.exceptions.CodeDeliveryFailureEx ception" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / delete_user_pool delete_user_pool **************** CognitoIdentityProvider.Client.delete_user_pool(**kwargs) Deletes a user pool. After you delete a user pool, users can no longer sign in to any associated applications. When you delete a user pool, it's no longer visible or operational in your Amazon Web Services account. Amazon Cognito retains deleted user pools in an inactive state for 14 days, then begins a cleanup process that fully removes them from Amazon Web Services systems. In case of accidental deletion, contact Amazon Web ServicesSupport within 14 days for restoration assistance. Amazon Cognito begins full deletion of all resources from deleted user pools after 14 days. In the case of large user pools, the cleanup process might take significant additional time before all user data is permanently deleted. See also: AWS API Documentation **Request Syntax** response = client.delete_user_pool( UserPoolId='string' ) Parameters: **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that you want to delete. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserImportInProgressE xception" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_devices list_devices ************ CognitoIdentityProvider.Client.list_devices(**kwargs) Lists the devices that Amazon Cognito has registered to the currently signed-in user. For more information about device authentication, see Working with user devices in your user pool. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.list_devices( AccessToken='string', Limit=123, PaginationToken='string' ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **Limit** (*integer*) -- The maximum number of devices that you want Amazon Cognito to return in the response. * **PaginationToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'Devices': [ { 'DeviceKey': 'string', 'DeviceAttributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'DeviceCreateDate': datetime(2015, 1, 1), 'DeviceLastModifiedDate': datetime(2015, 1, 1), 'DeviceLastAuthenticatedDate': datetime(2015, 1, 1) }, ], 'PaginationToken': 'string' } **Response Structure** * *(dict) --* Represents the response to list devices. * **Devices** *(list) --* An array of devices and their details. Each entry that's returned includes device information, last-accessed and created dates, and the device key. * *(dict) --* Information about a user's device that they've registered for device SRP authentication in your application. For more information, see Working with user devices in your user pool. * **DeviceKey** *(string) --* The device key, for example "us-west-2_EXAMPLE- a1b2c3d4-5678-90ab-cdef-EXAMPLE22222". * **DeviceAttributes** *(list) --* Metadata about a user's device, like name and last- access source IP. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **DeviceCreateDate** *(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. * **DeviceLastModifiedDate** *(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. * **DeviceLastAuthenticatedDate** *(datetime) --* The date when the user last signed in with the device. * **PaginationToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / add_custom_attributes add_custom_attributes ********************* CognitoIdentityProvider.Client.add_custom_attributes(**kwargs) Adds additional user attributes to the user pool schema. Custom attributes can be mutable or immutable and have a "custom:" or "dev:" prefix. For more information, see Custom attributes. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.add_custom_attributes( UserPoolId='string', CustomAttributes=[ { 'Name': 'string', 'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean', 'DeveloperOnlyAttribute': True|False, 'Mutable': True|False, 'Required': True|False, 'NumberAttributeConstraints': { 'MinValue': 'string', 'MaxValue': 'string' }, 'StringAttributeConstraints': { 'MinLength': 'string', 'MaxLength': 'string' } }, ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to add custom attributes. * **CustomAttributes** (*list*) -- **[REQUIRED]** An array of custom attribute names and other properties. Sets the following characteristics: AttributeDataType The expected data type. Can be a string, a number, a date and time, or a boolean. Mutable If true, you can grant app clients write access to the attribute value. If false, the attribute value can only be set up on sign-up or administrator creation of users. Name The attribute name. For an attribute like "custom:myAttribute", enter "myAttribute" for this field. Required When true, users who sign up or are created must set a value for the attribute. NumberAttributeConstraints The minimum and maximum length of accepted values for a "Number"-type attribute. StringAttributeConstraints The minimum and maximum length of accepted values for a "String"-type attribute. DeveloperOnlyAttribute This legacy option creates an attribute with a "dev:" prefix. You can only set the value of a developer-only attribute with administrative IAM credentials. * *(dict) --* A list of the user attributes and their properties in your user pool. The attribute schema contains standard attributes, custom attributes with a "custom:" prefix, and developer attributes with a "dev:" prefix. For more information, see User pool attributes. Developer-only "dev:" attributes are a legacy feature of user pools, and are read-only to all app clients. You can create and update developer-only attributes only with IAM- authenticated API operations. Use app client read/write permissions instead. * **Name** *(string) --* The name of your user pool attribute. When you create or update a user pool, adding a schema attribute creates a custom or developer-only attribute. When you add an attribute with a "Name" value of "MyAttribute", Amazon Cognito creates the custom attribute "custom:MyAttribute". When "DeveloperOnlyAttribute" is "true", Amazon Cognito creates your attribute as "dev:MyAttribute". In an operation that describes a user pool, Amazon Cognito returns this value as "value" for standard attributes, "custom:value" for custom attributes, and "dev:value" for developer-only attributes.. * **AttributeDataType** *(string) --* The data format of the values for your attribute. When you choose an "AttributeDataType", Amazon Cognito validates the input against the data type. A custom attribute value in your user's ID token is always a string, for example ""custom:isMember" : "true"" or ""custom:YearsAsMember" : "12"". * **DeveloperOnlyAttribute** *(boolean) --* Note: You should use WriteAttributes in the user pool client to control how attributes can be mutated for new use cases instead of using "DeveloperOnlyAttribute". 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. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server for the request to add custom attributes. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserImportInProgressE xception" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / start_web_authn_registration start_web_authn_registration **************************** CognitoIdentityProvider.Client.start_web_authn_registration(**kwargs) Requests credential creation options from your user pool for the currently signed-in user. 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. 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** response = client.start_web_authn_registration( AccessToken='string' ) Parameters: **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Return type: dict Returns: **Response Syntax** { 'CredentialCreationOptions': {...}|[...]|123|123.4|'string'|True|None } **Response Structure** * *(dict) --* * **CredentialCreationOptions** (*document*) -- The information that a user can provide in their request to register with their passkey provider. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.WebAuthnNotEnabledExc eption" * "CognitoIdentityProvider.Client.exceptions.WebAuthnConfiguration MissingException" CognitoIdentityProvider / Client / confirm_device confirm_device ************** CognitoIdentityProvider.Client.confirm_device(**kwargs) Confirms a device that a user wants to remember. A remembered device is a "Remember me on this device" option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.confirm_device( AccessToken='string', DeviceKey='string', DeviceSecretVerifierConfig={ 'PasswordVerifier': 'string', 'Salt': 'string' }, DeviceName='string' ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **DeviceKey** (*string*) -- **[REQUIRED]** The unique identifier, or device key, of the device that you want to update the status for. * **DeviceSecretVerifierConfig** (*dict*) -- The configuration of the device secret verifier. * **PasswordVerifier** *(string) --* A password verifier for a user's device. Used in SRP authentication. * **Salt** *(string) --* The salt that you want to use in SRP authentication with the user's device. * **DeviceName** (*string*) -- A friendly name for the device, for example "MyMobilePhone". Return type: dict Returns: **Response Syntax** { 'UserConfirmationNecessary': True|False } **Response Structure** * *(dict) --* The confirm-device response. * **UserConfirmationNecessary** *(boolean) --* When "true", your user must confirm that they want to remember the device. Prompt the user for an answer. When "false", immediately sets the device as remembered and eligible for device authentication. You can configure your user pool to always remember devices, in which case this response is "false", or to allow users to opt in, in which case this response is "true". Configure this option under *Device tracking* in the *Sign-in* menu of your user pool. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.UsernameExistsExcepti on" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.DeviceKeyExistsExcept ion" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / list_tags_for_resource list_tags_for_resource ********************** CognitoIdentityProvider.Client.list_tags_for_resource(**kwargs) Lists the tags that are assigned to an Amazon Cognito user pool. For more information, see Tagging resources. See also: AWS API Documentation **Request Syntax** response = client.list_tags_for_resource( ResourceArn='string' ) Parameters: **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the user pool that the tags are assigned to. Return type: dict Returns: **Response Syntax** { 'Tags': { 'string': 'string' } } **Response Structure** * *(dict) --* * **Tags** *(dict) --* The tags that are assigned to the user pool. * *(string) --* * *(string) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / get_device get_device ********** CognitoIdentityProvider.Client.get_device(**kwargs) Given a device key, returns information about a remembered device for the current user. For more information about device authentication, see Working with user devices in your user pool. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.get_device( DeviceKey='string', AccessToken='string' ) Parameters: * **DeviceKey** (*string*) -- **[REQUIRED]** The key of the device that you want to get information about. * **AccessToken** (*string*) -- A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Return type: dict Returns: **Response Syntax** { 'Device': { 'DeviceKey': 'string', 'DeviceAttributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'DeviceCreateDate': datetime(2015, 1, 1), 'DeviceLastModifiedDate': datetime(2015, 1, 1), 'DeviceLastAuthenticatedDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* Gets the device response. * **Device** *(dict) --* Details of the requested device. Includes device information, last-accessed and created dates, and the device key. * **DeviceKey** *(string) --* The device key, for example "us-west-2_EXAMPLE- a1b2c3d4-5678-90ab-cdef-EXAMPLE22222". * **DeviceAttributes** *(list) --* Metadata about a user's device, like name and last-access source IP. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **DeviceCreateDate** *(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. * **DeviceLastModifiedDate** *(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. * **DeviceLastAuthenticatedDate** *(datetime) --* The date when the user last signed in with the device. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / admin_update_user_attributes admin_update_user_attributes **************************** CognitoIdentityProvider.Client.admin_update_user_attributes(**kwargs) Updates the specified user's attributes. To delete an attribute from your user, submit the attribute in your API request with a blank value. For custom attributes, you must add a "custom:" prefix to the attribute name, for example "custom:department". This operation can set a user's email address or phone number as verified and permit immediate sign-in in user pools that require verification of these attributes. To do this, set the "email_verified" or "phone_number_verified" attribute to "true". Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = client.admin_update_user_attributes( UserPoolId='string', Username='string', UserAttributes=[ { 'Name': 'string', 'Value': 'string' }, ], ClientMetadata={ 'string': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to update user attributes. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **UserAttributes** (*list*) -- **[REQUIRED]** An array of name-value pairs representing user attributes. For custom attributes, you must prepend the "custom:" prefix to the attribute name. If your user pool requires verification before Amazon Cognito updates an attribute value that you specify in this request, Amazon Cognito doesn’t immediately update the value of that attribute. After your user receives and responds to a verification message to verify the new value, Amazon Cognito updates the attribute value. Your user can sign in and receive messages with the original attribute value until they verify the new value. To skip the verification message and update the value of an attribute that requires verification in the same API request, include the "email_verified" or "phone_number_verified" attribute, with a value of "true". If you set the "email_verified" or "phone_number_verified" value for an "email" or "phone_number" attribute that requires verification to "true", Amazon Cognito doesn’t send a verification message to your user. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* **[REQUIRED]** The name of the attribute. * **Value** *(string) --* The value of the attribute. * **ClientMetadata** (*dict*) -- 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 AdminUpdateUserAttributes API action, Amazon Cognito invokes the function that is assigned to the *custom message* 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 AdminUpdateUserAttributes 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server for the request to update user attributes as an administrator. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" CognitoIdentityProvider / Client / stop_user_import_job stop_user_import_job ******************** CognitoIdentityProvider.Client.stop_user_import_job(**kwargs) Instructs your user pool to stop a running job that's importing users from a CSV file that contains their usernames and attributes. For more information about importing users from a CSV file, see Importing users from a CSV file. See also: AWS API Documentation **Request Syntax** response = client.stop_user_import_job( UserPoolId='string', JobId='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that you want to stop. * **JobId** (*string*) -- **[REQUIRED]** The ID of a running user import job. Return type: dict Returns: **Response Syntax** { 'UserImportJob': { 'JobName': 'string', 'JobId': 'string', 'UserPoolId': 'string', 'PreSignedUrl': 'string', 'CreationDate': datetime(2015, 1, 1), 'StartDate': datetime(2015, 1, 1), 'CompletionDate': datetime(2015, 1, 1), 'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded', 'CloudWatchLogsRoleArn': 'string', 'ImportedUsers': 123, 'SkippedUsers': 123, 'FailedUsers': 123, 'CompletionMessage': 'string' } } **Response Structure** * *(dict) --* Represents the response from the server to the request to stop the user import job. * **UserImportJob** *(dict) --* The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload. * **JobName** *(string) --* The friendly name of the user import job. * **JobId** *(string) --* The ID of the user import job. * **UserPoolId** *(string) --* The ID of the user pool that the users are being imported into. * **PreSignedUrl** *(string) --* The pre-signed URL target for uploading the CSV file. * **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. * **StartDate** *(datetime) --* The date when the user import job was started. * **CompletionDate** *(datetime) --* The date when the user import job was completed. * **Status** *(string) --* The status of the user import job. One of the following: * "Created" - The job was created but not started. * "Pending" - A transition state. You have started the job, but it has not begun importing users yet. * "InProgress" - The job has started, and users are being imported. * "Stopping" - You have stopped the job, but the job has not stopped importing users yet. * "Stopped" - You have stopped the job, and the job has stopped importing users. * "Succeeded" - The job has completed successfully. * "Failed" - The job has stopped due to an error. * "Expired" - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job can't be started. * **CloudWatchLogsRoleArn** *(string) --* The role Amazon Resource Name (ARN) for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide. * **ImportedUsers** *(integer) --* The number of users that were successfully imported. * **SkippedUsers** *(integer) --* The number of users that were skipped. * **FailedUsers** *(integer) --* The number of users that couldn't be imported. * **CompletionMessage** *(string) --* The message returned when the user import job is completed. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.PreconditionNotMetExc eption" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" CognitoIdentityProvider / Client / admin_list_devices admin_list_devices ****************** CognitoIdentityProvider.Client.admin_list_devices(**kwargs) Lists a user's registered devices. Remembered devices are used in authentication services where you offer a "Remember me" option for users who you want to permit to sign in without MFA from a trusted device. Users can bypass MFA while your application performs device SRP authentication on the back end. For more information, see Working with devices. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_list_devices( UserPoolId='string', Username='string', Limit=123, PaginationToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where the device owner is a user. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **Limit** (*integer*) -- The maximum number of devices that you want Amazon Cognito to return in the response. * **PaginationToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'Devices': [ { 'DeviceKey': 'string', 'DeviceAttributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'DeviceCreateDate': datetime(2015, 1, 1), 'DeviceLastModifiedDate': datetime(2015, 1, 1), 'DeviceLastAuthenticatedDate': datetime(2015, 1, 1) }, ], 'PaginationToken': 'string' } **Response Structure** * *(dict) --* Lists the device's response, as an administrator. * **Devices** *(list) --* An array of devices and their information. Each entry that's returned includes device information, last-accessed and created dates, and the device key. * *(dict) --* Information about a user's device that they've registered for device SRP authentication in your application. For more information, see Working with user devices in your user pool. * **DeviceKey** *(string) --* The device key, for example "us-west-2_EXAMPLE- a1b2c3d4-5678-90ab-cdef-EXAMPLE22222". * **DeviceAttributes** *(list) --* Metadata about a user's device, like name and last- access source IP. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **DeviceCreateDate** *(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. * **DeviceLastModifiedDate** *(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. * **DeviceLastAuthenticatedDate** *(datetime) --* The date when the user last signed in with the device. * **PaginationToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" CognitoIdentityProvider / Client / admin_create_user admin_create_user ***************** CognitoIdentityProvider.Client.admin_create_user(**kwargs) Creates a new user in the specified user pool. If "MessageAction" isn't set, the default is to send a welcome message via email or phone (SMS). This message is based on a template that you configured in your call to create or update a user pool. This template includes your custom sign-up instructions and placeholders for user name and temporary password. Alternatively, you can call "AdminCreateUser" with "SUPPRESS" for the "MessageAction" parameter, and Amazon Cognito won't send any email. In either case, if the user has a password, they will be in the "FORCE_CHANGE_PASSWORD" state until they sign in and set their password. Your invitation message template must have the "{####}" password placeholder if your users have passwords. If your template doesn't have this placeholder, Amazon Cognito doesn't deliver the invitation message. In this case, you must update your message template and resend the password with a new "AdminCreateUser" request with a "MessageAction" value of "RESEND". Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_create_user( UserPoolId='string', Username='string', UserAttributes=[ { 'Name': 'string', 'Value': 'string' }, ], ValidationData=[ { 'Name': 'string', 'Value': 'string' }, ], TemporaryPassword='string', ForceAliasCreation=True|False, MessageAction='RESEND'|'SUPPRESS', DesiredDeliveryMediums=[ 'SMS'|'EMAIL', ], ClientMetadata={ 'string': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to create a user. * **Username** (*string*) -- **[REQUIRED]** The value that you want to set as the username sign-in attribute. The following conditions apply to the username parameter. * The username can't be a duplicate of another username in the same user pool. * You can't change the value of a username after you create it. * You can only provide a value if usernames are a valid sign- in attribute for your user pool. If your user pool only supports phone numbers or email addresses as sign-in attributes, Amazon Cognito automatically generates a username value. For more information, see Customizing sign- in attributes. * **UserAttributes** (*list*) -- An array of name-value pairs that contain user attributes and attribute values to be set for the user to be created. You can create a user without specifying any attributes other than "Username". However, any attributes that you specify as required (when creating a user pool or in the **Attributes** tab of the console) either you should supply (in your call to "AdminCreateUser") or the user should supply (when they sign up in response to your welcome message). For custom attributes, you must prepend the "custom:" prefix to the attribute name. To send a message inviting the user to sign up, you must specify the user's email address or phone number. You can do this in your call to AdminCreateUser or in the **Users** tab of the Amazon Cognito console for managing your user pools. You must also provide an email address or phone number when you expect the user to do passwordless sign-in with an email or SMS OTP. These attributes must be provided when passwordless options are the only available, or when you don't submit a "TemporaryPassword". In your "AdminCreateUser" request, you can set the "email_verified" and "phone_number_verified" attributes to "true". The following conditions apply: email The email address where you want the user to receive their confirmation code and username. You must provide a value for "email" when you want to set "email_verified" to "true", or if you set "EMAIL" in the "DesiredDeliveryMediums" parameter. phone_number The phone number where you want the user to receive their confirmation code and username. You must provide a value for "phone_number" when you want to set "phone_number_verified" to "true", or if you set "SMS" in the "DesiredDeliveryMediums" parameter. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* **[REQUIRED]** The name of the attribute. * **Value** *(string) --* The value of the attribute. * **ValidationData** (*list*) -- 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 can automatically confirm and verify select users or perform external API operations like logging user attributes and validation data to Amazon CloudWatch Logs. 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. * **Name** *(string) --* **[REQUIRED]** The name of the attribute. * **Value** *(string) --* The value of the attribute. * **TemporaryPassword** (*string*) -- The user's temporary password. This password must conform to the password policy that you specified when you created the user pool. The exception to the requirement for a password is 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. The temporary password is valid only once. To complete the Admin Create User flow, the user must enter the temporary password in the sign-in page, along with a new password to be used in all future sign-ins. If you don't specify a value, Amazon Cognito generates one for you unless you have passwordless options active for your user pool. The temporary password can only be used until the user account expiration limit that you set for your user pool. To reset the account after that time limit, you must call "AdminCreateUser" again and specify "RESEND" for the "MessageAction" parameter. * **ForceAliasCreation** (*boolean*) -- This parameter is used only if the "phone_number_verified" or "email_verified" attribute is set to "True". Otherwise, it is ignored. If this parameter is set to "True" and the phone number or email address specified in the "UserAttributes" parameter already exists as an alias with a different user, this request migrates the alias from the previous user to the newly-created user. The previous user will no longer be able to log in using that alias. If this parameter is set to "False", the API throws an "AliasExistsException" error if the alias already exists. The default value is "False". * **MessageAction** (*string*) -- Set to "RESEND" to resend the invitation message to a user that already exists, and to reset the temporary-password duration with a new temporary password. Set to "SUPPRESS" to suppress sending the message. You can specify only one value. * **DesiredDeliveryMediums** (*list*) -- Specify "EMAIL" if email will be used to send the welcome message. Specify "SMS" if the phone number will be used. The default value is "SMS". You can specify more than one value. * *(string) --* * **ClientMetadata** (*dict*) -- 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 AdminCreateUser API action, Amazon Cognito invokes the function that is assigned to the *pre sign-up* 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 AdminCreateUser 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** { 'User': { 'Username': 'string', 'Attributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'UserCreateDate': datetime(2015, 1, 1), 'UserLastModifiedDate': datetime(2015, 1, 1), 'Enabled': True|False, 'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD'|'EXTERNAL_PROVIDER', 'MFAOptions': [ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] } } **Response Structure** * *(dict) --* Represents the response from the server to the request to create the user. * **User** *(dict) --* The new user's profile details. * **Username** *(string) --* The user's username. * **Attributes** *(list) --* Names and values of a user's attributes, for example "email". * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **UserCreateDate** *(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. * **UserLastModifiedDate** *(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. * **Enabled** *(boolean) --* Indicates whether the user's account is enabled or disabled. * **UserStatus** *(string) --* The user status. This can be one of the following: * "UNCONFIRMED": User has been created but not confirmed. * "CONFIRMED": User has been confirmed. * "EXTERNAL_PROVIDER": User signed in with a third-party IdP. * "RESET_REQUIRED": User is confirmed, but the user must request a code and reset their password before they can sign in. * "FORCE_CHANGE_PASSWORD": The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change their password to a new value before doing anything else. The statuses "ARCHIVED", "UNKNOWN", and "COMPROMISED" are no longer used. * **MFAOptions** *(list) --* The user's MFA configuration. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UsernameExistsExcepti on" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.CodeDeliveryFailureEx ception" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.PreconditionNotMetExc eption" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UnsupportedUserStateE xception" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / untag_resource untag_resource ************** CognitoIdentityProvider.Client.untag_resource(**kwargs) Given tag IDs that you previously assigned to a user pool, removes them. See also: AWS API Documentation **Request Syntax** response = client.untag_resource( ResourceArn='string', TagKeys=[ 'string', ] ) Parameters: * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the user pool that the tags are assigned to. * **TagKeys** (*list*) -- **[REQUIRED]** An array of tag keys that you want to remove from the user pool. * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / update_user_pool_client update_user_pool_client *********************** CognitoIdentityProvider.Client.update_user_pool_client(**kwargs) Given a user pool app client ID, updates the configuration. To avoid setting parameters to Amazon Cognito defaults, construct this API request to pass the existing configuration of your app client, modified to include the changes that you want to make. Warning: If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. Unlike app clients created in the console, Amazon Cognito doesn't automatically assign a branding style to app clients that you configure with this API operation. Managed login and classic hosted UI pages aren't available for your client until after you apply a branding style. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.update_user_pool_client( UserPoolId='string', ClientId='string', ClientName='string', RefreshTokenValidity=123, AccessTokenValidity=123, IdTokenValidity=123, TokenValidityUnits={ 'AccessToken': 'seconds'|'minutes'|'hours'|'days', 'IdToken': 'seconds'|'minutes'|'hours'|'days', 'RefreshToken': 'seconds'|'minutes'|'hours'|'days' }, ReadAttributes=[ 'string', ], WriteAttributes=[ 'string', ], ExplicitAuthFlows=[ 'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH', ], SupportedIdentityProviders=[ 'string', ], CallbackURLs=[ 'string', ], LogoutURLs=[ 'string', ], DefaultRedirectURI='string', AllowedOAuthFlows=[ 'code'|'implicit'|'client_credentials', ], AllowedOAuthScopes=[ 'string', ], AllowedOAuthFlowsUserPoolClient=True|False, AnalyticsConfiguration={ 'ApplicationId': 'string', 'ApplicationArn': 'string', 'RoleArn': 'string', 'ExternalId': 'string', 'UserDataShared': True|False }, PreventUserExistenceErrors='LEGACY'|'ENABLED', EnableTokenRevocation=True|False, EnablePropagateAdditionalUserContextData=True|False, AuthSessionValidity=123, RefreshTokenRotation={ 'Feature': 'ENABLED'|'DISABLED', 'RetryGracePeriodSeconds': 123 } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to update the app client. * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client that you want to update. * **ClientName** (*string*) -- A friendly name for the app client. * **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 units that validity times are represented in. The default unit for refresh tokens is days, and the default for ID and access tokens are hours. * **AccessToken** *(string) --* A time unit for the value that you set in the "AccessTokenValidity" parameter. The default "AccessTokenValidity" time unit is "hours". "AccessTokenValidity" duration can range from five minutes to one day. * **IdToken** *(string) --* A time unit for the value that you set in the "IdTokenValidity" parameter. The default "IdTokenValidity" time unit is "hours". "IdTokenValidity" duration can range from five minutes to one day. * **RefreshToken** *(string) --* A time unit for the value that you set in the "RefreshTokenValidity" parameter. The default "RefreshTokenValidity" time unit is "days". "RefreshTokenValidity" duration can range from 60 minutes to 10 years. * **ReadAttributes** (*list*) -- The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list. When you don't specify the "ReadAttributes" for your app client, your app can read the values of "email_verified", "phone_number_verified", and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, "ReadAttributes" doesn't return any information. Amazon Cognito only populates "ReadAttributes" in the API response if you have specified your own custom set of read attributes. * *(string) --* * **WriteAttributes** (*list*) -- The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list. When you don't specify the "WriteAttributes" for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, "WriteAttributes" doesn't return any information. Amazon Cognito only populates "WriteAttributes" in the API response if you have specified your own custom set of write attributes. If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool. * *(string) --* * **ExplicitAuthFlows** (*list*) -- The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions. Note: If you don't specify a value for "ExplicitAuthFlows", your app client supports "ALLOW_REFRESH_TOKEN_AUTH", "ALLOW_USER_SRP_AUTH", and "ALLOW_CUSTOM_AUTH". The values for authentication flow options include the following. * "ALLOW_USER_AUTH": Enable selection-based sign-in with "USER_AUTH". This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username- password and SRP authentication without other "ExplicitAuthFlows" permitting them. For example users can complete an SRP challenge through "USER_AUTH" without the flow "USER_SRP_AUTH" being active for the app client. This flow doesn't include "CUSTOM_AUTH". To activate this setting, your user pool must be in the Essentials tier or higher. * "ALLOW_ADMIN_USER_PASSWORD_AUTH": Enable admin based user password authentication flow "ADMIN_USER_PASSWORD_AUTH". This setting replaces the "ADMIN_NO_SRP_AUTH" setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password. * "ALLOW_CUSTOM_AUTH": Enable Lambda trigger based authentication. * "ALLOW_USER_PASSWORD_AUTH": Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords. * "ALLOW_USER_SRP_AUTH": Enable SRP-based authentication. * "ALLOW_REFRESH_TOKEN_AUTH": Enable authflow to refresh tokens. In some environments, you will see the values "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY", or "USER_PASSWORD_AUTH". You can't assign these legacy "ExplicitAuthFlows" values to user pool clients at the same time as values that begin with "ALLOW_", like "ALLOW_USER_SRP_AUTH". * *(string) --* * **SupportedIdentityProviders** (*list*) -- A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: "COGNITO", "Facebook", "Google", "SignInWithApple", and "LoginWithAmazon". You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example "MySAMLIdP" or "MyOIDCIdP". This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of "COGNITO" from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule. * *(string) --* * **CallbackURLs** (*list*) -- A list of allowed redirect, or callback, URLs for managed login authentication. These URLs are the paths where you want to send your users' browsers after they complete authentication with managed login or a third-party IdP. Typically, callback URLs are the home of an application that uses OAuth or OIDC libraries to process authentication outcomes. A redirect URI must meet the following requirements: * Be an absolute URI. * Be registered with the authorization server. Amazon Cognito doesn't accept authorization requests with "redirect_uri" values that aren't in the list of "CallbackURLs" that you provide in this parameter. * Not include a fragment component. See OAuth 2.0 - Redirection Endpoint. Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only. App callback URLs such as "myapp://example" are also supported. * *(string) --* * **LogoutURLs** (*list*) -- A list of allowed logout URLs for managed login authentication. When you pass "logout_uri" and "client_id" parameters to "/logout", Amazon Cognito signs out your user and redirects them to the logout URL. This parameter describes the URLs that you want to be the permitted targets of "logout_uri". A typical use of these URLs is when a user selects "Sign out" and you redirect them to your public homepage. For more information, see Logout endpoint. * *(string) --* * **DefaultRedirectURI** (*string*) -- The default redirect URI. In app clients with one assigned IdP, replaces "redirect_uri" in authentication requests. Must be in the "CallbackURLs" list. * **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, OpenID Connect (OIDC), and custom scopes that you want to permit your app client to authorize access with. Scopes govern access control to user pool self-service API operations, user data from the "userInfo" endpoint, and third- party APIs. Scope values include "phone", "email", "openid", and "profile". The "aws.cognito.signin.user.admin" scope authorizes user self-service operations. Custom scopes with resource servers authorize access to external APIs. * *(string) --* * **AllowedOAuthFlowsUserPoolClient** (*boolean*) -- Set to "true" to use OAuth 2.0 authorization server features in your app client. This parameter must have a value of "true" before you can configure the following features in your app client. * "CallBackURLs": Callback URLs. * "LogoutURLs": Sign-out redirect URLs. * "AllowedOAuthScopes": OAuth 2.0 scopes. * "AllowedOAuthFlows": Support for authorization code, implicit, and client credentials OAuth 2.0 grants. To use authorization server features, configure one of these features in the Amazon Cognito console or set "AllowedOAuthFlowsUserPoolClient" to "true" in a "CreateUserPoolClient" or "UpdateUserPoolClient" API request. If you don't set a value for "AllowedOAuthFlowsUserPoolClient" in a request with the CLI or SDKs, it defaults to "false". When "false", only SDK-based API sign-in is permitted. * **AnalyticsConfiguration** (*dict*) -- The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign. In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools might not have access to analytics or might be configurable with campaigns in the US East (N. Virginia) Region. For more information, see Using Amazon Pinpoint analytics. * **ApplicationId** *(string) --* Your Amazon Pinpoint project ID. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that "ApplicationArn" declares. You can also configure your application to pass an endpoint ID in the "AnalyticsMetadata" parameter of sign-in operations. The endpoint ID is information about the destination for push notifications * **RoleArn** *(string) --* The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics. * **ExternalId** *(string) --* The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint. * **UserDataShared** *(boolean) --* If "UserDataShared" is "true", Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics. * **PreventUserExistenceErrors** (*string*) -- When "ENABLED", suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to "ENABLED" and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to "LEGACY", those APIs return a "UserNotFoundException" exception if the user doesn't exist in the user pool. Defaults to "LEGACY". * **EnableTokenRevocation** (*boolean*) -- Activates or deactivates token revocation in the target app client. * **EnablePropagateAdditionalUserContextData** (*boolean*) -- When "true", your application can include additional "UserContextData" in authentication requests. This data includes the IP address, and contributes to analysis by threat protection features. For more information about propagation of user context data, see Adding session data to API requests. If you don’t include this parameter, you can't send the source IP address to Amazon Cognito threat protection features. You can only activate "EnablePropagateAdditionalUserContextData" in an app client that has a client secret. * **AuthSessionValidity** (*integer*) -- Amazon Cognito creates a session token for each API request in an authentication flow. "AuthSessionValidity" is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. * **RefreshTokenRotation** (*dict*) -- The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens. * **Feature** *(string) --* **[REQUIRED]** The state of refresh token rotation for the current app client. * **RetryGracePeriodSeconds** *(integer) --* When you request a token refresh with "GetTokensFromRefreshToken", the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When "RetryGracePeriodSeconds" is "0", the grace period is disabled and a successful request immediately invalidates the submitted refresh token. Return type: dict Returns: **Response Syntax** { 'UserPoolClient': { 'UserPoolId': 'string', 'ClientName': 'string', 'ClientId': 'string', 'ClientSecret': 'string', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1), 'RefreshTokenValidity': 123, 'AccessTokenValidity': 123, 'IdTokenValidity': 123, 'TokenValidityUnits': { 'AccessToken': 'seconds'|'minutes'|'hours'|'days', 'IdToken': 'seconds'|'minutes'|'hours'|'days', 'RefreshToken': 'seconds'|'minutes'|'hours'|'days' }, 'ReadAttributes': [ 'string', ], 'WriteAttributes': [ 'string', ], 'ExplicitAuthFlows': [ 'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH', ], 'SupportedIdentityProviders': [ 'string', ], 'CallbackURLs': [ 'string', ], 'LogoutURLs': [ 'string', ], 'DefaultRedirectURI': 'string', 'AllowedOAuthFlows': [ 'code'|'implicit'|'client_credentials', ], 'AllowedOAuthScopes': [ 'string', ], 'AllowedOAuthFlowsUserPoolClient': True|False, 'AnalyticsConfiguration': { 'ApplicationId': 'string', 'ApplicationArn': 'string', 'RoleArn': 'string', 'ExternalId': 'string', 'UserDataShared': True|False }, 'PreventUserExistenceErrors': 'LEGACY'|'ENABLED', 'EnableTokenRevocation': True|False, 'EnablePropagateAdditionalUserContextData': True|False, 'AuthSessionValidity': 123, 'RefreshTokenRotation': { 'Feature': 'ENABLED'|'DISABLED', 'RetryGracePeriodSeconds': 123 } } } **Response Structure** * *(dict) --* Represents the response from the server to the request to update the user pool client. * **UserPoolClient** *(dict) --* The updated details of your app client. * **UserPoolId** *(string) --* The ID of the user pool associated with the app client. * **ClientName** *(string) --* The name of the app client. * **ClientId** *(string) --* The ID of the app client. * **ClientSecret** *(string) --* The app client secret. * **LastModifiedDate** *(datetime) --* The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java "Date" object. * **CreationDate** *(datetime) --* The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java "Date" object. * **RefreshTokenValidity** *(integer) --* The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for "RefreshTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "RefreshTokenValidity" as "10" and "TokenValidityUnits" as "days", your user can refresh their session and retrieve new access and ID tokens for 10 days. The default time unit for "RefreshTokenValidity" in an API request is days. You can't set "RefreshTokenValidity" to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days. * **AccessTokenValidity** *(integer) --* The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for "AccessTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "AccessTokenValidity" to "10" and "TokenValidityUnits" to "hours", your user can authorize access with their access token for 10 hours. The default time unit for "AccessTokenValidity" in an API request is hours. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour. * **IdTokenValidity** *(integer) --* The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for "IdTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "IdTokenValidity" as "10" and "TokenValidityUnits" as "hours", your user can authenticate their session with their ID token for 10 hours. The default time unit for "IdTokenValidity" in an API request is hours. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour. * **TokenValidityUnits** *(dict) --* The time units that, with "IdTokenValidity", "AccessTokenValidity", and "RefreshTokenValidity", set and display the duration of ID, access, and refresh tokens for an app client. You can assign a separate token validity unit to each type of token. * **AccessToken** *(string) --* A time unit for the value that you set in the "AccessTokenValidity" parameter. The default "AccessTokenValidity" time unit is "hours". "AccessTokenValidity" duration can range from five minutes to one day. * **IdToken** *(string) --* A time unit for the value that you set in the "IdTokenValidity" parameter. The default "IdTokenValidity" time unit is "hours". "IdTokenValidity" duration can range from five minutes to one day. * **RefreshToken** *(string) --* A time unit for the value that you set in the "RefreshTokenValidity" parameter. The default "RefreshTokenValidity" time unit is "days". "RefreshTokenValidity" duration can range from 60 minutes to 10 years. * **ReadAttributes** *(list) --* The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list. When you don't specify the "ReadAttributes" for your app client, your app can read the values of "email_verified", "phone_number_verified", and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, "ReadAttributes" doesn't return any information. Amazon Cognito only populates "ReadAttributes" in the API response if you have specified your own custom set of read attributes. * *(string) --* * **WriteAttributes** *(list) --* The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list. When you don't specify the "WriteAttributes" for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, "WriteAttributes" doesn't return any information. Amazon Cognito only populates "WriteAttributes" in the API response if you have specified your own custom set of write attributes. If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool. * *(string) --* * **ExplicitAuthFlows** *(list) --* The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions. Note: If you don't specify a value for "ExplicitAuthFlows", your app client supports "ALLOW_REFRESH_TOKEN_AUTH", "ALLOW_USER_SRP_AUTH", and "ALLOW_CUSTOM_AUTH". The values for authentication flow options include the following. * "ALLOW_USER_AUTH": Enable selection-based sign-in with "USER_AUTH". This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username- password and SRP authentication without other "ExplicitAuthFlows" permitting them. For example users can complete an SRP challenge through "USER_AUTH" without the flow "USER_SRP_AUTH" being active for the app client. This flow doesn't include "CUSTOM_AUTH". To activate this setting, your user pool must be in the Essentials tier or higher. * "ALLOW_ADMIN_USER_PASSWORD_AUTH": Enable admin based user password authentication flow "ADMIN_USER_PASSWORD_AUTH". This setting replaces the "ADMIN_NO_SRP_AUTH" setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password. * "ALLOW_CUSTOM_AUTH": Enable Lambda trigger based authentication. * "ALLOW_USER_PASSWORD_AUTH": Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords. * "ALLOW_USER_SRP_AUTH": Enable SRP-based authentication. * "ALLOW_REFRESH_TOKEN_AUTH": Enable authflow to refresh tokens. In some environments, you will see the values "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY", or "USER_PASSWORD_AUTH". You can't assign these legacy "ExplicitAuthFlows" values to user pool clients at the same time as values that begin with "ALLOW_", like "ALLOW_USER_SRP_AUTH". * *(string) --* * **SupportedIdentityProviders** *(list) --* A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: "COGNITO", "Facebook", "Google", "SignInWithApple", and "LoginWithAmazon". You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example "MySAMLIdP" or "MyOIDCIdP". This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of "COGNITO" from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule. * *(string) --* * **CallbackURLs** *(list) --* A list of allowed redirect (callback) URLs for the IdPs. A redirect URI must: * Be an absolute URI. * Be registered with the authorization server. * Not include a fragment component. See OAuth 2.0 - Redirection Endpoint. Amazon Cognito requires HTTPS over HTTP 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 authorization server features in your app client. This parameter must have a value of "true" before you can configure the following features in your app client. * "CallBackURLs": Callback URLs. * "LogoutURLs": Sign-out redirect URLs. * "AllowedOAuthScopes": OAuth 2.0 scopes. * "AllowedOAuthFlows": Support for authorization code, implicit, and client credentials OAuth 2.0 grants. To use authorization server features, configure one of these features in the Amazon Cognito console or set "AllowedOAuthFlowsUserPoolClient" to "true" in a "CreateUserPoolClient" or "UpdateUserPoolClient" API request. If you don't set a value for "AllowedOAuthFlowsUserPoolClient" in a request with the CLI or SDKs, it defaults to "false". When "false", only SDK-based API sign-in is permitted. * **AnalyticsConfiguration** *(dict) --* The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign. Note: In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools only support sending events to Amazon Pinpoint projects in Amazon Web Services Region us-east-1. In Regions where Amazon Pinpoint is available, user pools support sending events to Amazon Pinpoint projects within that same Region. * **ApplicationId** *(string) --* Your Amazon Pinpoint project ID. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that "ApplicationArn" declares. You can also configure your application to pass an endpoint ID in the "AnalyticsMetadata" parameter of sign-in operations. The endpoint ID is information about the destination for push notifications * **RoleArn** *(string) --* The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics. * **ExternalId** *(string) --* The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint. * **UserDataShared** *(boolean) --* If "UserDataShared" is "true", Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics. * **PreventUserExistenceErrors** *(string) --* When "ENABLED", suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to "ENABLED" and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to "LEGACY", those APIs return a "UserNotFoundException" exception if the user doesn't exist in the user pool. Defaults to "LEGACY". * **EnableTokenRevocation** *(boolean) --* Indicates whether token revocation is activated for the user pool client. When you create a new user pool client, token revocation is activated by default. * **EnablePropagateAdditionalUserContextData** *(boolean) --* When "EnablePropagateAdditionalUserContextData" is true, Amazon Cognito accepts an "IpAddress" value that you send in the "UserContextData" parameter. The "UserContextData" parameter sends information to Amazon Cognito threat protection for risk analysis. You can send "UserContextData" when you sign in Amazon Cognito native users with the "InitiateAuth" and "RespondToAuthChallenge" API operations. When "EnablePropagateAdditionalUserContextData" is false, you can't send your user's source IP address to Amazon Cognito threat protection with unauthenticated API operations. "EnablePropagateAdditionalUserContextData" doesn't affect whether you can send a source IP address in a "ContextData" parameter with the authenticated API operations "AdminInitiateAuth" and "AdminRespondToAuthChallenge". You can only activate "EnablePropagateAdditionalUserContextData" in an app client that has a client secret. For more information about propagation of user context data, see Adding user device and session data to API requests. * **AuthSessionValidity** *(integer) --* Amazon Cognito creates a session token for each API request in an authentication flow. "AuthSessionValidity" is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. * **RefreshTokenRotation** *(dict) --* The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens. * **Feature** *(string) --* The state of refresh token rotation for the current app client. * **RetryGracePeriodSeconds** *(integer) --* When you request a token refresh with "GetTokensFromRefreshToken", the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When "RetryGracePeriodSeconds" is "0", the grace period is disabled and a successful request immediately invalidates the submitted refresh token. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ScopeDoesNotExistExce ption" * "CognitoIdentityProvider.Client.exceptions.InvalidOAuthFlowExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / admin_set_user_password admin_set_user_password *********************** CognitoIdentityProvider.Client.admin_set_user_password(**kwargs) Sets the specified user's password in a user pool. This operation administratively sets a temporary or permanent password for a user. With this operation, you can bypass self-service password changes and permit immediate sign-in with the password that you set. To do this, set "Permanent" to "true". You can also set a new temporary password in this request, send it to a user, and require them to choose a new password on their next sign-in. To do this, set "Permanent" to "false". If the password is temporary, the user's "Status" becomes "FORCE_CHANGE_PASSWORD". When the user next tries to sign in, the "InitiateAuth" or "AdminInitiateAuth" response includes the "NEW_PASSWORD_REQUIRED" challenge. If the user doesn't sign in before the temporary password expires, they can no longer sign in and you must repeat this operation to set a temporary or permanent password for them. After the user sets a new password, or if you set a permanent password, their status becomes "Confirmed". "AdminSetUserPassword" can set a password for the user profile that Amazon Cognito creates for third-party federated users. When you set a password, the federated user's status changes from "EXTERNAL_PROVIDER" to "CONFIRMED". A user in this state can sign in as a federated user, and initiate authentication flows in the API like a linked native user. They can also modify their password and attributes in token-authenticated API requests like "ChangePassword" and "UpdateUserAttributes". As a best security practice and to keep users in sync with your external IdP, don't set passwords on federated user profiles. To set up a federated user for native sign-in with a linked native user, refer to Linking federated users to an existing user profile. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_set_user_password( UserPoolId='string', Username='string', Password='string', Permanent=True|False ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to set the user's password. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **Password** (*string*) -- **[REQUIRED]** The new temporary or permanent password that you want to set for the user. You can't remove the password for a user who already has a password so that they can only sign in with passwordless methods. In this scenario, you must create a new user without a password. * **Permanent** (*boolean*) -- Set to "true" to set a password that the user can immediately sign in with. Set to "false" to set a temporary password that the user must change on their next sign-in. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordHistoryPolicy ViolationException" CognitoIdentityProvider / Client / create_user_pool_client create_user_pool_client *********************** CognitoIdentityProvider.Client.create_user_pool_client(**kwargs) Creates an app client in a user pool. This operation sets basic and advanced configuration options. Unlike app clients created in the console, Amazon Cognito doesn't automatically assign a branding style to app clients that you configure with this API operation. Managed login and classic hosted UI pages aren't available for your client until after you apply a branding style. Warning: If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = 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, RefreshTokenRotation={ 'Feature': 'ENABLED'|'DISABLED', 'RetryGracePeriodSeconds': 123 } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to create an app client. * **ClientName** (*string*) -- **[REQUIRED]** A friendly name for the app client that you want to create. * **GenerateSecret** (*boolean*) -- When "true", generates a client secret for the app client. Client secrets are used with server-side and machine-to-machine applications. Client secrets are automatically generated; you can't specify a secret value. For more information, see App client types. * **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 units that validity times are represented in. The default unit for refresh tokens is days, and the default for ID and access tokens are hours. * **AccessToken** *(string) --* A time unit for the value that you set in the "AccessTokenValidity" parameter. The default "AccessTokenValidity" time unit is "hours". "AccessTokenValidity" duration can range from five minutes to one day. * **IdToken** *(string) --* A time unit for the value that you set in the "IdTokenValidity" parameter. The default "IdTokenValidity" time unit is "hours". "IdTokenValidity" duration can range from five minutes to one day. * **RefreshToken** *(string) --* A time unit for the value that you set in the "RefreshTokenValidity" parameter. The default "RefreshTokenValidity" time unit is "days". "RefreshTokenValidity" duration can range from 60 minutes to 10 years. * **ReadAttributes** (*list*) -- The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list. When you don't specify the "ReadAttributes" for your app client, your app can read the values of "email_verified", "phone_number_verified", and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, "ReadAttributes" doesn't return any information. Amazon Cognito only populates "ReadAttributes" in the API response if you have specified your own custom set of read attributes. * *(string) --* * **WriteAttributes** (*list*) -- The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list. When you don't specify the "WriteAttributes" for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, "WriteAttributes" doesn't return any information. Amazon Cognito only populates "WriteAttributes" in the API response if you have specified your own custom set of write attributes. If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool. * *(string) --* * **ExplicitAuthFlows** (*list*) -- The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions. Note: If you don't specify a value for "ExplicitAuthFlows", your app client supports "ALLOW_REFRESH_TOKEN_AUTH", "ALLOW_USER_SRP_AUTH", and "ALLOW_CUSTOM_AUTH". The values for authentication flow options include the following. * "ALLOW_USER_AUTH": Enable selection-based sign-in with "USER_AUTH". This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username- password and SRP authentication without other "ExplicitAuthFlows" permitting them. For example users can complete an SRP challenge through "USER_AUTH" without the flow "USER_SRP_AUTH" being active for the app client. This flow doesn't include "CUSTOM_AUTH". To activate this setting, your user pool must be in the Essentials tier or higher. * "ALLOW_ADMIN_USER_PASSWORD_AUTH": Enable admin based user password authentication flow "ADMIN_USER_PASSWORD_AUTH". This setting replaces the "ADMIN_NO_SRP_AUTH" setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password. * "ALLOW_CUSTOM_AUTH": Enable Lambda trigger based authentication. * "ALLOW_USER_PASSWORD_AUTH": Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords. * "ALLOW_USER_SRP_AUTH": Enable SRP-based authentication. * "ALLOW_REFRESH_TOKEN_AUTH": Enable authflow to refresh tokens. In some environments, you will see the values "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY", or "USER_PASSWORD_AUTH". You can't assign these legacy "ExplicitAuthFlows" values to user pool clients at the same time as values that begin with "ALLOW_", like "ALLOW_USER_SRP_AUTH". * *(string) --* * **SupportedIdentityProviders** (*list*) -- A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: "COGNITO", "Facebook", "Google", "SignInWithApple", and "LoginWithAmazon". You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example "MySAMLIdP" or "MyOIDCIdP". This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of "COGNITO" from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule. * *(string) --* * **CallbackURLs** (*list*) -- A list of allowed redirect, or callback, URLs for managed login authentication. These URLs are the paths where you want to send your users' browsers after they complete authentication with managed login or a third-party IdP. Typically, callback URLs are the home of an application that uses OAuth or OIDC libraries to process authentication outcomes. A redirect URI must meet the following requirements: * Be an absolute URI. * Be registered with the authorization server. Amazon Cognito doesn't accept authorization requests with "redirect_uri" values that aren't in the list of "CallbackURLs" that you provide in this parameter. * Not include a fragment component. See OAuth 2.0 - Redirection Endpoint. Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only. App callback URLs such as myapp://example are also supported. * *(string) --* * **LogoutURLs** (*list*) -- A list of allowed logout URLs for managed login authentication. When you pass "logout_uri" and "client_id" parameters to "/logout", Amazon Cognito signs out your user and redirects them to the logout URL. This parameter describes the URLs that you want to be the permitted targets of "logout_uri". A typical use of these URLs is when a user selects "Sign out" and you redirect them to your public homepage. For more information, see Logout endpoint. * *(string) --* * **DefaultRedirectURI** (*string*) -- The default redirect URI. In app clients with one assigned IdP, replaces "redirect_uri" in authentication requests. Must be in the "CallbackURLs" list. * **AllowedOAuthFlows** (*list*) -- The OAuth grant types that you want your app client to generate for clients in managed login authentication. To create an app client that generates client credentials grants, you must add "client_credentials" as the only allowed OAuth flow. code Use a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the "/oauth2/token" endpoint. implicit Issue the access token, and the ID token when scopes like "openid" and "profile" are requested, directly to your user. client_credentials Issue the access token from the "/oauth2/token" endpoint directly to a non-person user, authorized by a combination of the client ID and client secret. * *(string) --* * **AllowedOAuthScopes** (*list*) -- The OAuth, OpenID Connect (OIDC), and custom scopes that you want to permit your app client to authorize access with. Scopes govern access control to user pool self-service API operations, user data from the "userInfo" endpoint, and third- party APIs. Scope values include "phone", "email", "openid", and "profile". The "aws.cognito.signin.user.admin" scope authorizes user self-service operations. Custom scopes with resource servers authorize access to external APIs. * *(string) --* * **AllowedOAuthFlowsUserPoolClient** (*boolean*) -- Set to "true" to use OAuth 2.0 authorization server features in your app client. This parameter must have a value of "true" before you can configure the following features in your app client. * "CallBackURLs": Callback URLs. * "LogoutURLs": Sign-out redirect URLs. * "AllowedOAuthScopes": OAuth 2.0 scopes. * "AllowedOAuthFlows": Support for authorization code, implicit, and client credentials OAuth 2.0 grants. To use authorization server features, configure one of these features in the Amazon Cognito console or set "AllowedOAuthFlowsUserPoolClient" to "true" in a "CreateUserPoolClient" or "UpdateUserPoolClient" API request. If you don't set a value for "AllowedOAuthFlowsUserPoolClient" in a request with the CLI or SDKs, it defaults to "false". When "false", only SDK-based API sign-in is permitted. * **AnalyticsConfiguration** (*dict*) -- The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign. In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools might not have access to analytics or might be configurable with campaigns in the US East (N. Virginia) Region. For more information, see Using Amazon Pinpoint analytics. * **ApplicationId** *(string) --* Your Amazon Pinpoint project ID. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that "ApplicationArn" declares. You can also configure your application to pass an endpoint ID in the "AnalyticsMetadata" parameter of sign-in operations. The endpoint ID is information about the destination for push notifications * **RoleArn** *(string) --* The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics. * **ExternalId** *(string) --* The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint. * **UserDataShared** *(boolean) --* If "UserDataShared" is "true", Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics. * **PreventUserExistenceErrors** (*string*) -- When "ENABLED", suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to "ENABLED" and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to "LEGACY", those APIs return a "UserNotFoundException" exception if the user doesn't exist in the user pool. Defaults to "LEGACY". * **EnableTokenRevocation** (*boolean*) -- Activates or deactivates token revocation in the target app client. If you don't include this parameter, token revocation is automatically activated for the new user pool client. * **EnablePropagateAdditionalUserContextData** (*boolean*) -- When "true", your application can include additional "UserContextData" in authentication requests. This data includes the IP address, and contributes to analysis by threat protection features. For more information about propagation of user context data, see Adding session data to API requests. If you don’t include this parameter, you can't send the source IP address to Amazon Cognito threat protection features. You can only activate "EnablePropagateAdditionalUserContextData" in an app client that has a client secret. * **AuthSessionValidity** (*integer*) -- Amazon Cognito creates a session token for each API request in an authentication flow. "AuthSessionValidity" is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. * **RefreshTokenRotation** (*dict*) -- The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens. * **Feature** *(string) --* **[REQUIRED]** The state of refresh token rotation for the current app client. * **RetryGracePeriodSeconds** *(integer) --* When you request a token refresh with "GetTokensFromRefreshToken", the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When "RetryGracePeriodSeconds" is "0", the grace period is disabled and a successful request immediately invalidates the submitted refresh token. Return type: dict Returns: **Response Syntax** { 'UserPoolClient': { 'UserPoolId': 'string', 'ClientName': 'string', 'ClientId': 'string', 'ClientSecret': 'string', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1), 'RefreshTokenValidity': 123, 'AccessTokenValidity': 123, 'IdTokenValidity': 123, 'TokenValidityUnits': { 'AccessToken': 'seconds'|'minutes'|'hours'|'days', 'IdToken': 'seconds'|'minutes'|'hours'|'days', 'RefreshToken': 'seconds'|'minutes'|'hours'|'days' }, 'ReadAttributes': [ 'string', ], 'WriteAttributes': [ 'string', ], 'ExplicitAuthFlows': [ 'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH'|'ALLOW_ADMIN_USER_PASSWORD_AUTH'|'ALLOW_CUSTOM_AUTH'|'ALLOW_USER_PASSWORD_AUTH'|'ALLOW_USER_SRP_AUTH'|'ALLOW_REFRESH_TOKEN_AUTH'|'ALLOW_USER_AUTH', ], 'SupportedIdentityProviders': [ 'string', ], 'CallbackURLs': [ 'string', ], 'LogoutURLs': [ 'string', ], 'DefaultRedirectURI': 'string', 'AllowedOAuthFlows': [ 'code'|'implicit'|'client_credentials', ], 'AllowedOAuthScopes': [ 'string', ], 'AllowedOAuthFlowsUserPoolClient': True|False, 'AnalyticsConfiguration': { 'ApplicationId': 'string', 'ApplicationArn': 'string', 'RoleArn': 'string', 'ExternalId': 'string', 'UserDataShared': True|False }, 'PreventUserExistenceErrors': 'LEGACY'|'ENABLED', 'EnableTokenRevocation': True|False, 'EnablePropagateAdditionalUserContextData': True|False, 'AuthSessionValidity': 123, 'RefreshTokenRotation': { 'Feature': 'ENABLED'|'DISABLED', 'RetryGracePeriodSeconds': 123 } } } **Response Structure** * *(dict) --* Represents the response from the server to create a user pool client. * **UserPoolClient** *(dict) --* The details of the new app client. * **UserPoolId** *(string) --* The ID of the user pool associated with the app client. * **ClientName** *(string) --* The name of the app client. * **ClientId** *(string) --* The ID of the app client. * **ClientSecret** *(string) --* The app client secret. * **LastModifiedDate** *(datetime) --* The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java "Date" object. * **CreationDate** *(datetime) --* The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java "Date" object. * **RefreshTokenValidity** *(integer) --* The refresh token time limit. After this limit expires, your user can't use their refresh token. To specify the time unit for "RefreshTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "RefreshTokenValidity" as "10" and "TokenValidityUnits" as "days", your user can refresh their session and retrieve new access and ID tokens for 10 days. The default time unit for "RefreshTokenValidity" in an API request is days. You can't set "RefreshTokenValidity" to 0. If you do, Amazon Cognito overrides the value with the default value of 30 days. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your refresh tokens are valid for 30 days. * **AccessTokenValidity** *(integer) --* The access token time limit. After this limit expires, your user can't use their access token. To specify the time unit for "AccessTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "AccessTokenValidity" to "10" and "TokenValidityUnits" to "hours", your user can authorize access with their access token for 10 hours. The default time unit for "AccessTokenValidity" in an API request is hours. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your access tokens are valid for one hour. * **IdTokenValidity** *(integer) --* The ID token time limit. After this limit expires, your user can't use their ID token. To specify the time unit for "IdTokenValidity" as "seconds", "minutes", "hours", or "days", set a "TokenValidityUnits" value in your API request. For example, when you set "IdTokenValidity" as "10" and "TokenValidityUnits" as "hours", your user can authenticate their session with their ID token for 10 hours. The default time unit for "IdTokenValidity" in an API request is hours. *Valid range* is displayed below in seconds. If you don't specify otherwise in the configuration of your app client, your ID tokens are valid for one hour. * **TokenValidityUnits** *(dict) --* The time units that, with "IdTokenValidity", "AccessTokenValidity", and "RefreshTokenValidity", set and display the duration of ID, access, and refresh tokens for an app client. You can assign a separate token validity unit to each type of token. * **AccessToken** *(string) --* A time unit for the value that you set in the "AccessTokenValidity" parameter. The default "AccessTokenValidity" time unit is "hours". "AccessTokenValidity" duration can range from five minutes to one day. * **IdToken** *(string) --* A time unit for the value that you set in the "IdTokenValidity" parameter. The default "IdTokenValidity" time unit is "hours". "IdTokenValidity" duration can range from five minutes to one day. * **RefreshToken** *(string) --* A time unit for the value that you set in the "RefreshTokenValidity" parameter. The default "RefreshTokenValidity" time unit is "days". "RefreshTokenValidity" duration can range from 60 minutes to 10 years. * **ReadAttributes** *(list) --* The list of user attributes that you want your app client to have read access to. After your user authenticates in your app, their access token authorizes them to read their own attribute value for any attribute in this list. When you don't specify the "ReadAttributes" for your app client, your app can read the values of "email_verified", "phone_number_verified", and the standard attributes of your user pool. When your user pool app client has read access to these default attributes, "ReadAttributes" doesn't return any information. Amazon Cognito only populates "ReadAttributes" in the API response if you have specified your own custom set of read attributes. * *(string) --* * **WriteAttributes** *(list) --* The list of user attributes that you want your app client to have write access to. After your user authenticates in your app, their access token authorizes them to set or modify their own attribute value for any attribute in this list. When you don't specify the "WriteAttributes" for your app client, your app can write the values of the Standard attributes of your user pool. When your user pool has write access to these default attributes, "WriteAttributes" doesn't return any information. Amazon Cognito only populates "WriteAttributes" in the API response if you have specified your own custom set of write attributes. If your app client allows users to sign in through an IdP, this array must include all attributes that you have mapped to IdP attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If your app client does not have write access to a mapped attribute, Amazon Cognito throws an error when it tries to update the attribute. For more information, see Specifying IdP Attribute Mappings for Your user pool. * *(string) --* * **ExplicitAuthFlows** *(list) --* The authentication flows that you want your user pool client to support. For each app client in your user pool, you can sign in your users with any combination of one or more flows, including with a user name and Secure Remote Password (SRP), a user name and password, or a custom authentication process that you define with Lambda functions. Note: If you don't specify a value for "ExplicitAuthFlows", your app client supports "ALLOW_REFRESH_TOKEN_AUTH", "ALLOW_USER_SRP_AUTH", and "ALLOW_CUSTOM_AUTH". The values for authentication flow options include the following. * "ALLOW_USER_AUTH": Enable selection-based sign-in with "USER_AUTH". This setting covers username-password, secure remote password (SRP), passwordless, and passkey authentication. This authentiation flow can do username- password and SRP authentication without other "ExplicitAuthFlows" permitting them. For example users can complete an SRP challenge through "USER_AUTH" without the flow "USER_SRP_AUTH" being active for the app client. This flow doesn't include "CUSTOM_AUTH". To activate this setting, your user pool must be in the Essentials tier or higher. * "ALLOW_ADMIN_USER_PASSWORD_AUTH": Enable admin based user password authentication flow "ADMIN_USER_PASSWORD_AUTH". This setting replaces the "ADMIN_NO_SRP_AUTH" setting. With this authentication flow, your app passes a user name and password to Amazon Cognito in the request, instead of using the Secure Remote Password (SRP) protocol to securely transmit the password. * "ALLOW_CUSTOM_AUTH": Enable Lambda trigger based authentication. * "ALLOW_USER_PASSWORD_AUTH": Enable user password-based authentication. In this flow, Amazon Cognito receives the password in the request instead of using the SRP protocol to verify passwords. * "ALLOW_USER_SRP_AUTH": Enable SRP-based authentication. * "ALLOW_REFRESH_TOKEN_AUTH": Enable authflow to refresh tokens. In some environments, you will see the values "ADMIN_NO_SRP_AUTH", "CUSTOM_AUTH_FLOW_ONLY", or "USER_PASSWORD_AUTH". You can't assign these legacy "ExplicitAuthFlows" values to user pool clients at the same time as values that begin with "ALLOW_", like "ALLOW_USER_SRP_AUTH". * *(string) --* * **SupportedIdentityProviders** *(list) --* A list of provider names for the identity providers (IdPs) that are supported on this client. The following are supported: "COGNITO", "Facebook", "Google", "SignInWithApple", and "LoginWithAmazon". You can also specify the names that you configured for the SAML and OIDC IdPs in your user pool, for example "MySAMLIdP" or "MyOIDCIdP". This parameter sets the IdPs that managed login will display on the login page for your app client. The removal of "COGNITO" from this list doesn't prevent authentication operations for local users with the user pools API in an Amazon Web Services SDK. The only way to prevent SDK-based authentication is to block access with a WAF rule. * *(string) --* * **CallbackURLs** *(list) --* A list of allowed redirect (callback) URLs for the IdPs. A redirect URI must: * Be an absolute URI. * Be registered with the authorization server. * Not include a fragment component. See OAuth 2.0 - Redirection Endpoint. Amazon Cognito requires HTTPS over HTTP 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 authorization server features in your app client. This parameter must have a value of "true" before you can configure the following features in your app client. * "CallBackURLs": Callback URLs. * "LogoutURLs": Sign-out redirect URLs. * "AllowedOAuthScopes": OAuth 2.0 scopes. * "AllowedOAuthFlows": Support for authorization code, implicit, and client credentials OAuth 2.0 grants. To use authorization server features, configure one of these features in the Amazon Cognito console or set "AllowedOAuthFlowsUserPoolClient" to "true" in a "CreateUserPoolClient" or "UpdateUserPoolClient" API request. If you don't set a value for "AllowedOAuthFlowsUserPoolClient" in a request with the CLI or SDKs, it defaults to "false". When "false", only SDK-based API sign-in is permitted. * **AnalyticsConfiguration** *(dict) --* The user pool analytics configuration for collecting metrics and sending them to your Amazon Pinpoint campaign. Note: In Amazon Web Services Regions where Amazon Pinpoint isn't available, user pools only support sending events to Amazon Pinpoint projects in Amazon Web Services Region us-east-1. In Regions where Amazon Pinpoint is available, user pools support sending events to Amazon Pinpoint projects within that same Region. * **ApplicationId** *(string) --* Your Amazon Pinpoint project ID. * **ApplicationArn** *(string) --* The Amazon Resource Name (ARN) of an Amazon Pinpoint project that you want to connect to your user pool app client. Amazon Cognito publishes events to the Amazon Pinpoint project that "ApplicationArn" declares. You can also configure your application to pass an endpoint ID in the "AnalyticsMetadata" parameter of sign-in operations. The endpoint ID is information about the destination for push notifications * **RoleArn** *(string) --* The ARN of an Identity and Access Management role that has the permissions required for Amazon Cognito to publish events to Amazon Pinpoint analytics. * **ExternalId** *(string) --* The external ID of the role that Amazon Cognito assumes to send analytics data to Amazon Pinpoint. * **UserDataShared** *(boolean) --* If "UserDataShared" is "true", Amazon Cognito includes user data in the events that it publishes to Amazon Pinpoint analytics. * **PreventUserExistenceErrors** *(string) --* When "ENABLED", suppresses messages that might indicate a valid user exists when someone attempts sign-in. This parameters sets your preference for the errors and responses that you want Amazon Cognito APIs to return during authentication, account confirmation, and password recovery when the user doesn't exist in the user pool. When set to "ENABLED" and the user doesn't exist, authentication returns an error indicating either the username or password was incorrect. Account confirmation and password recovery return a response indicating a code was sent to a simulated destination. When set to "LEGACY", those APIs return a "UserNotFoundException" exception if the user doesn't exist in the user pool. Defaults to "LEGACY". * **EnableTokenRevocation** *(boolean) --* Indicates whether token revocation is activated for the user pool client. When you create a new user pool client, token revocation is activated by default. * **EnablePropagateAdditionalUserContextData** *(boolean) --* When "EnablePropagateAdditionalUserContextData" is true, Amazon Cognito accepts an "IpAddress" value that you send in the "UserContextData" parameter. The "UserContextData" parameter sends information to Amazon Cognito threat protection for risk analysis. You can send "UserContextData" when you sign in Amazon Cognito native users with the "InitiateAuth" and "RespondToAuthChallenge" API operations. When "EnablePropagateAdditionalUserContextData" is false, you can't send your user's source IP address to Amazon Cognito threat protection with unauthenticated API operations. "EnablePropagateAdditionalUserContextData" doesn't affect whether you can send a source IP address in a "ContextData" parameter with the authenticated API operations "AdminInitiateAuth" and "AdminRespondToAuthChallenge". You can only activate "EnablePropagateAdditionalUserContextData" in an app client that has a client secret. For more information about propagation of user context data, see Adding user device and session data to API requests. * **AuthSessionValidity** *(integer) --* Amazon Cognito creates a session token for each API request in an authentication flow. "AuthSessionValidity" is the duration, in minutes, of that session token. Your user pool native user must respond to each authentication challenge before the session expires. * **RefreshTokenRotation** *(dict) --* The configuration of your app client for refresh token rotation. When enabled, your app client issues new ID, access, and refresh tokens when users renew their sessions with refresh tokens. When disabled, token refresh issues only ID and access tokens. * **Feature** *(string) --* The state of refresh token rotation for the current app client. * **RetryGracePeriodSeconds** *(integer) --* When you request a token refresh with "GetTokensFromRefreshToken", the original refresh token that you're rotating out can remain valid for a period of time of up to 60 seconds. This allows for client-side retries. When "RetryGracePeriodSeconds" is "0", the grace period is disabled and a successful request immediately invalidates the submitted refresh token. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ScopeDoesNotExistExce ption" * "CognitoIdentityProvider.Client.exceptions.InvalidOAuthFlowExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / admin_list_user_auth_events admin_list_user_auth_events *************************** CognitoIdentityProvider.Client.admin_list_user_auth_events(**kwargs) Requests a history of user activity and any risks detected as part of Amazon Cognito threat protection. For more information, see Viewing user event history. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_list_user_auth_events( UserPoolId='string', Username='string', MaxResults=123, NextToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The Id of the user pool that contains the user profile with the logged events. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **MaxResults** (*integer*) -- The maximum number of authentication events to return. Returns 60 events if you set "MaxResults" to 0, or if you don't include a "MaxResults" parameter. * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'AuthEvents': [ { 'EventId': 'string', 'EventType': 'SignIn'|'SignUp'|'ForgotPassword'|'PasswordChange'|'ResendCode', 'CreationDate': datetime(2015, 1, 1), 'EventResponse': 'Pass'|'Fail'|'InProgress', 'EventRisk': { 'RiskDecision': 'NoRisk'|'AccountTakeover'|'Block', 'RiskLevel': 'Low'|'Medium'|'High', 'CompromisedCredentialsDetected': True|False }, 'ChallengeResponses': [ { 'ChallengeName': 'Password'|'Mfa', 'ChallengeResponse': 'Success'|'Failure' }, ], 'EventContextData': { 'IpAddress': 'string', 'DeviceName': 'string', 'Timezone': 'string', 'City': 'string', 'Country': 'string' }, 'EventFeedback': { 'FeedbackValue': 'Valid'|'Invalid', 'Provider': 'string', 'FeedbackDate': datetime(2015, 1, 1) } }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **AuthEvents** *(list) --* The response object. It includes the "EventID", "EventType", "CreationDate", "EventRisk", and "EventResponse". * *(dict) --* One authentication event that Amazon Cognito logged in a user pool with threat protection active. Contains user and device metadata and a risk assessment from your user pool. * **EventId** *(string) --* The event ID. * **EventType** *(string) --* The type of authentication event. * **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. * **EventResponse** *(string) --* The event response. * **EventRisk** *(dict) --* The threat evaluation from your user pool about an event. Contains information about whether your user pool detected compromised credentials, whether the event triggered an automated response, and the level of risk. * **RiskDecision** *(string) --* The action taken by adaptive authentication. If "NoRisk", your user pool took no action. If "AccountTakeover", your user pool applied the adaptive authentication automated response that you configured. If "Block", your user pool prevented the attempt. * **RiskLevel** *(string) --* The risk level that adaptive authentication assessed for the authentication event. * **CompromisedCredentialsDetected** *(boolean) --* Indicates whether compromised credentials were detected during an authentication event. * **ChallengeResponses** *(list) --* A list of the challenges that the user was requested to answer, for example "Password", and the result, for example "Success". * *(dict) --* 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. Warning: You must provide a SECRET_HASH parameter in all challenge responses to an app client that has a client secret. Include a "DEVICE_KEY" for device authentication.SELECT_CHALLENGE ""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. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes.SOFTWARE_TOKEN_MFA ""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. * **ChallengeName** *(string) --* The type of challenge that your previous authentication request returned in the parameter "ChallengeName", for example "SMS_MFA". * **ChallengeResponse** *(string) --* The set of key-value pairs that provides a response to the requested challenge. * **EventContextData** *(dict) --* The user context data captured at the time of an event request. This value provides additional information about the client from which event the request is received. * **IpAddress** *(string) --* The source IP address of your user's device. * **DeviceName** *(string) --* The user's device name. * **Timezone** *(string) --* The user's time zone. * **City** *(string) --* The user's city. * **Country** *(string) --* The user's country. * **EventFeedback** *(dict) --* The "UpdateAuthEventFeedback" or "AdminUpdateAuthEventFeedback" feedback that you or your user provided in response to the event. A value of "Valid" indicates that you disagreed with the level of risk that your user pool assigned, and evaluated a session to be valid, or likely safe. A value of "Invalid" indicates that you agreed with the user pool risk level and evaluated a session to be invalid, or likely malicious. * **FeedbackValue** *(string) --* Your feedback to the authentication event. When you provide a "FeedbackValue" value of "valid", you tell Amazon Cognito that you trust a user session where Amazon Cognito has evaluated some level of risk. When you provide a "FeedbackValue" value of "invalid", you tell Amazon Cognito that you don't trust a user session, or you don't believe that Amazon Cognito evaluated a high-enough risk level. * **Provider** *(string) --* The submitter of the event feedback. For example, if you submit event feedback in the Amazon Cognito console, this value is "Admin". * **FeedbackDate** *(datetime) --* The date that you or your user submitted the feedback. * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserPoolAddOnNotEnabl edException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / update_identity_provider update_identity_provider ************************ CognitoIdentityProvider.Client.update_identity_provider(**kwargs) Modifies the configuration and trust relationship between a third- party identity provider (IdP) and a user pool. Amazon Cognito accepts sign-in with third-party identity providers through managed login and OIDC relying-party libraries. For more information, see Third-party IdP sign-in. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.update_identity_provider( UserPoolId='string', ProviderName='string', ProviderDetails={ 'string': 'string' }, AttributeMapping={ 'string': 'string' }, IdpIdentifiers=[ 'string', ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The Id of the user pool where you want to update your IdP. * **ProviderName** (*string*) -- **[REQUIRED]** The name of the IdP that you want to update. You can pass the identity provider name in the "identity_provider" query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP. * **ProviderDetails** (*dict*) -- The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP "authorize_scopes" values must match the values listed here. OpenID Connect (OIDC) Amazon Cognito accepts the following elements when it can't discover endpoint URLs from "oidc_issuer": "attributes_url", "authorize_url", "jwks_uri", "token_url". Create or update request: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" Describe response: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "attributes_url_add_attributes": "false", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" SAML Create or update request with Metadata URL: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256" }" Create or update request with Metadata file: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" }" The value of "MetadataFile" must be the plaintext metadata document with all quote (") characters escaped by backslashes. Describe response: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256", "SLORedirectBindingURI": "https://auth.example.com/slo/saml", "SSORedirectBindingURI": "https://auth.example.com/sso/saml" }" LoginWithAmazon Create or update request: ""ProviderDetails": { "authorize_scopes": "profile postal_code", "client_id": "amzn1 .application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret"" Describe response: ""ProviderDetails": { "attributes_url": "https://api.amazon.com/user/profile", "attributes_url_add_attributes": "false", "authorize_scopes": "profile postal_code", "authorize_url": "https://www.amazon.com/ap/oa", "client_id": "amzn1 .application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret", "token_request_method": "POST", "token_url": "https://api.amazon.com/auth/o2/token" }" Google Create or update request: ""ProviderDetails": { "authorize_scopes": "email profile openid", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "attributes_url": "https://people.googleapis.com/v1/people/me?personFields=", "attributes_url_add_attributes": "true", "authorize_scopes": "email profile openid", "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret", "oidc_issuer": "https://accounts.google.com", "token_request_method": "POST", "token_url": "https://www.googleapis.com/oauth2/v4/token" }" SignInWithApple Create or update request: ""ProviderDetails": { "authorize_scopes": "email name", "client_id": "com.example.cognito", "private_key": "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" }" Describe response: ""ProviderDetails": { "attributes_url_add_attributes": "false", "authorize_scopes": "email name", "authorize_url": "https://appleid.apple.com/auth/authorize", "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": "https://appleid.apple.com", "team_id": "2EXAMPLE", "token_request_method": "POST", "token_url": "https://appleid.apple.com/auth/token" }" Facebook Create or update request: ""ProviderDetails": { "api_version": "v17.0", "authorize_scopes": "public_profile, email", "client_id": "1example23456789", "client_secret": "provider- app-client-secret" }" Describe response: ""ProviderDetails": { "api_version": "v17.0", "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", "attributes_url_add_attributes": "true", "authorize_scopes": "public_profile, email", "authorize_url": "https://www.facebook.com/v17.0/dialog/oauth", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "token_request_method": "GET", "token_url": "https://graph.facebook.com/v17.0/oauth/access_token" }" * *(string) --* * *(string) --* * **AttributeMapping** (*dict*) -- A mapping of IdP attributes to standard and custom user pool attributes. Specify a user pool attribute as the key of the key-value pair, and the IdP attribute claim name as the value. * *(string) --* * *(string) --* * **IdpIdentifiers** (*list*) -- An array of IdP identifiers, for example ""IdPIdentifiers": [ "MyIdP", "MyIdP2" ]". Identifiers are friendly names that you can pass in the "idp_identifier" query parameter of requests to the Authorize endpoint to silently redirect to sign-in with the associated IdP. Identifiers in a domain format also enable the use of email-address matching with SAML providers. * *(string) --* Return type: dict Returns: **Response Syntax** { 'IdentityProvider': { 'UserPoolId': 'string', 'ProviderName': 'string', 'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'SignInWithApple'|'OIDC', 'ProviderDetails': { 'string': 'string' }, 'AttributeMapping': { 'string': 'string' }, 'IdpIdentifiers': [ 'string', ], 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **IdentityProvider** *(dict) --* The identity provider details. * **UserPoolId** *(string) --* The ID of the user pool associated with the IdP. * **ProviderName** *(string) --* A friendly name for the IdP. * **ProviderType** *(string) --* The type of IdP. Either SAML, OIDC, or a named social identity provider. * **ProviderDetails** *(dict) --* The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP "authorize_scopes" values must match the values listed here. OpenID Connect (OIDC) Amazon Cognito accepts the following elements when it can't discover endpoint URLs from "oidc_issuer": "attributes_url", "authorize_url", "jwks_uri", "token_url". Create or update request: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" Describe response: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "attributes_url_add_attributes": "false", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "jwks_uri": "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" SAML Create or update request with Metadata URL: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256" }" Create or update request with Metadata file: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" }" The value of "MetadataFile" must be the plaintext metadata document with all quote (") characters escaped by backslashes. Describe response: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256", "SLORedirectBindingURI": "https://auth.example.com/slo/saml", "SSORedirectBindingURI": "https://auth.example.com/sso/saml" }" LoginWithAmazon Create or update request: ""ProviderDetails": { "authorize_scopes": "profile postal_code", "client_id": "amzn1.application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret"" Describe response: ""ProviderDetails": { "attributes_url": "https://api.amazon.com/user/profile", "attributes_url_add_attributes": "false", "authorize_scopes": "profile postal_code", "authorize_url": "https://www.amazon.com/ap/oa", "client_id": "amzn1.application- oa2-client.1example23456789", "client_secret": "provider- app-client-secret", "token_request_method": "POST", "token_url": "https://api.amazon.com/auth/o2/token" }" Google Create or update request: ""ProviderDetails": { "authorize_scopes": "email profile openid", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "attributes_url": "https://people.googleapis.com/v1/people/me?personFields= ", "attributes_url_add_attributes": "true", "authorize_scopes": "email profile openid", "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret", "oidc_issuer": "https://accounts.google.com", "token_request_method": "POST", "token_url": "https://www.googleapis.com/oauth2/v4/token" }" SignInWithApple Create or update request: ""ProviderDetails": { "authorize_scopes": "email name", "client_id": "com.example.cognito", "private_key": "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" }" Describe response: ""ProviderDetails": { "attributes_url_add_attributes": "false", "authorize_scopes": "email name", "authorize_url": "https://appleid.apple.com/auth/authorize", "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": "https://appleid.apple.com", "team_id": "2EXAMPLE", "token_request_method": "POST", "token_url": "https://appleid.apple.com/auth/token" }" Facebook Create or update request: ""ProviderDetails": { "api_version": "v17.0", "authorize_scopes": "public_profile, email", "client_id": "1example23456789", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "api_version": "v17.0", "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", "attributes_url_add_attributes": "true", "authorize_scopes": "public_profile, email", "authorize_url": "https://www.facebook.com/v17.0/dialog/oauth", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "token_request_method": "GET", "token_url": "https://graph.facebook.com/v17.0/oauth/access_token" }" * *(string) --* * *(string) --* * **AttributeMapping** *(dict) --* A mapping of IdP attributes to standard and custom user pool attributes. * *(string) --* * *(string) --* * **IdpIdentifiers** *(list) --* A list of IdP identifiers. IdP identifiers are strings that represent friendly names or domain names of IdPs, for example "MyIdP" or "auth.example.com". You can choose to route user authorization requests to the right IdP with either IdP identifiers or IdP names. For more information, see "identity_provider" and "idp_identifier" at Authorize endpoint. * *(string) --* * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnsupportedIdentityPr oviderException" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / get_waiter get_waiter ********** CognitoIdentityProvider.Client.get_waiter(waiter_name) Returns an object that can wait for some condition. Parameters: **waiter_name** (*str*) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters. Returns: The specified waiter object. Return type: "botocore.waiter.Waiter" CognitoIdentityProvider / Client / admin_delete_user admin_delete_user ***************** CognitoIdentityProvider.Client.admin_delete_user(**kwargs) Deletes a user profile in your user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_delete_user( UserPoolId='string', Username='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete the user. * **Username** (*string*) -- **[REQUIRED]** The name 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. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / forgot_password forgot_password *************** CognitoIdentityProvider.Client.forgot_password(**kwargs) Sends a password-reset confirmation code for the currently signed- in user. For the "Username" parameter, you can use the username or user alias. If neither a verified phone number nor a verified email exists, Amazon Cognito responds with an "InvalidParameterException" error . If your app client has a client secret and you don't provide a "SECRET_HASH" parameter, this API returns "NotAuthorizedException". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = client.forgot_password( ClientId='string', SecretHash='string', UserContextData={ 'IpAddress': 'string', 'EncodedData': 'string' }, Username='string', AnalyticsMetadata={ 'AnalyticsEndpointId': 'string' }, ClientMetadata={ 'string': 'string' } ) Parameters: * **ClientId** (*string*) -- **[REQUIRED]** The ID of the user pool app client associated with the current signed-in user. * **SecretHash** (*string*) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about "SecretHash", see Computing secret hash values. * **UserContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **ClientMetadata** (*dict*) -- 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 ForgotPassword API action, Amazon Cognito invokes any functions that are assigned to the following triggers: *pre sign-up*, *custom message*, and *user migration*. 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 ForgotPassword 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** { 'CodeDeliveryDetails': { 'Destination': 'string', 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' } } **Response Structure** * *(dict) --* The response from Amazon Cognito to a request to reset a password. * **CodeDeliveryDetails** *(dict) --* Information about the phone number or email address that Amazon Cognito sent the password-recovery code to. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.CodeDeliveryFailureEx ception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / associate_software_token associate_software_token ************************ CognitoIdentityProvider.Client.associate_software_token(**kwargs) Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA) for a user, with a unique private key that Amazon Cognito generates and returns in the API response. You can authorize an "AssociateSoftwareToken" request with either the user's access token, or a session string from a challenge response that you received from Amazon Cognito. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. 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** response = client.associate_software_token( AccessToken='string', Session='string' ) Parameters: * **AccessToken** (*string*) -- A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". You can provide either an access token or a session ID in the request. * **Session** (*string*) -- The session identifier that maintains the state of authentication requests and challenge responses. In "AssociateSoftwareToken", this is the session ID from a successful sign-in. You can provide either an access token or a session ID in the request. Return type: dict Returns: **Response Syntax** { 'SecretCode': 'string', 'Session': 'string' } **Response Structure** * *(dict) --* * **SecretCode** *(string) --* A unique generated shared secret code that is used by the TOTP algorithm to generate a one-time code. * **Session** *(string) --* The session identifier that maintains the state of authentication requests and challenge responses. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.SoftwareTokenMFANotFo undException" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / admin_remove_user_from_group admin_remove_user_from_group **************************** CognitoIdentityProvider.Client.admin_remove_user_from_group(**kwargs) Given a username and a group name, removes them from the group. User pool groups are identifiers that you can reference from the contents of ID and access tokens, and set preferred IAM roles for identity-pool authentication. For more information, see Adding groups to a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_remove_user_from_group( UserPoolId='string', Username='string', GroupName='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the group and the user that you want to remove. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **GroupName** (*string*) -- **[REQUIRED]** The name of the group that you want to remove the user from, for example "MyTestGroup". Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_managed_login_branding describe_managed_login_branding ******************************* CognitoIdentityProvider.Client.describe_managed_login_branding(**kwargs) Given the ID of a managed login branding style, returns detailed information about the style. See also: AWS API Documentation **Request Syntax** response = client.describe_managed_login_branding( UserPoolId='string', ManagedLoginBrandingId='string', ReturnMergedResources=True|False ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the managed login branding style that you want to get information about. * **ManagedLoginBrandingId** (*string*) -- **[REQUIRED]** The ID of the managed login branding style that you want to get more information about. * **ReturnMergedResources** (*boolean*) -- 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. Return type: 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 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. * **Settings** (*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. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / respond_to_auth_challenge respond_to_auth_challenge ************************* CognitoIdentityProvider.Client.respond_to_auth_challenge(**kwargs) 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. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = 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' } ) Parameters: * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client where the user is signing in. * **ChallengeName** (*string*) -- **[REQUIRED]** The name of the challenge that you are responding to. Note: You can't respond to an "ADMIN_NO_SRP_AUTH" challenge with this operation. Possible challenges include the following: Note: All of the following challenges require "USERNAME" and, when the app client has a client secret, "SECRET_HASH" in the parameters. * "WEB_AUTHN": Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and 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": Respond with an "SMS_MFA_CODE" that your user pool delivered in an SMS message. * "EMAIL_OTP": Respond with an "EMAIL_OTP_CODE" that your user pool delivered in an email message. * "PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after 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. The parameters of the challenge are determined by your Lambda function. * "DEVICE_SRP_AUTH": Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device. * "DEVICE_PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after client-side SRP calculations. For more information, see Signing in with a device. * "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. Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes. * "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 time-based one-time password (TOTP) MFA, use the session returned in this challenge from "InitiateAuth" or "AdminInitiateAuth" as an input to "AssociateSoftwareToken". Then, use the session returned by "VerifySoftwareToken" as an input to "RespondToAuthChallenge" or "AdminRespondToAuthChallenge" with challenge name "MFA_SETUP" to complete sign-in. To set up SMS or email MFA, collect a "phone_number" or "email" attribute for the user. Then restart the authentication flow with an "InitiateAuth" or "AdminInitiateAuth" request. * **Session** (*string*) -- The session identifier that maintains the state of authentication requests and challenge responses. If an "AdminInitiateAuth" or "AdminRespondToAuthChallenge" API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next "AdminRespondToAuthChallenge" request. * **ChallengeResponses** (*dict*) -- 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. Warning: You must provide a SECRET_HASH parameter in all challenge responses to an app client that has a client secret. Include a "DEVICE_KEY" for device authentication.SELECT_CHALLENGE ""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. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes.SOFTWARE_TOKEN_MFA ""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) --* * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **UserContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **ClientMetadata** (*dict*) -- 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: 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 name of the next challenge that you must respond to. Possible challenges include the following: Note: All of the following challenges require "USERNAME" and, when the app client has a client secret, "SECRET_HASH" in the parameters. * "WEB_AUTHN": Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and 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": Respond with an "SMS_MFA_CODE" that your user pool delivered in an SMS message. * "EMAIL_OTP": Respond with an "EMAIL_OTP_CODE" that your user pool delivered in an email message. * "PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after 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. The parameters of the challenge are determined by your Lambda function. * "DEVICE_SRP_AUTH": Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device. * "DEVICE_PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after client-side SRP calculations. For more information, see Signing in with a device. * "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. Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes. * "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 time-based one-time password (TOTP) MFA, use the session returned in this challenge from "InitiateAuth" or "AdminInitiateAuth" as an input to "AssociateSoftwareToken". Then, use the session returned by "VerifySoftwareToken" as an input to "RespondToAuthChallenge" or "AdminRespondToAuthChallenge" with challenge name "MFA_SETUP" to complete sign-in. To set up SMS or email MFA, collect a "phone_number" or "email" attribute for the user. Then restart the authentication flow with an "InitiateAuth" or "AdminInitiateAuth" request. * **Session** *(string) --* The session identifier that maintains the state of authentication requests and challenge responses. If an "InitiateAuth" or "RespondToAuthChallenge" API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next "RespondToAuthChallenge" request. * **ChallengeParameters** *(dict) --* The parameters that define your response to the next challenge. * *(string) --* * *(string) --* * **AuthenticationResult** *(dict) --* The outcome of a successful authentication process. After your application has passed all challenges, Amazon Cognito returns an "AuthenticationResult" with the JSON web tokens (JWTs) that indicate successful sign-in. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.CodeMismatchException" * "CognitoIdentityProvider.Client.exceptions.ExpiredCodeException" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordHistoryPolicy ViolationException" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.MFAMethodNotFoundExce ption" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.SoftwareTokenMFANotFo undException" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / confirm_forgot_password confirm_forgot_password *********************** CognitoIdentityProvider.Client.confirm_forgot_password(**kwargs) This public API operation accepts a confirmation code that Amazon Cognito sent to a user and accepts a new password for that user. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.confirm_forgot_password( ClientId='string', SecretHash='string', Username='string', ConfirmationCode='string', Password='string', AnalyticsMetadata={ 'AnalyticsEndpointId': 'string' }, UserContextData={ 'IpAddress': 'string', 'EncodedData': 'string' }, ClientMetadata={ 'string': 'string' } ) Parameters: * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client where the user wants to reset their password. This parameter is an identifier of the client application that users are resetting their password from, but this operation resets users' irrespective of the app clients they sign in to. * **SecretHash** (*string*) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about "SecretHash", see Computing secret hash values. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **ConfirmationCode** (*string*) -- **[REQUIRED]** The confirmation code that your user pool delivered when your user requested to reset their password. * **Password** (*string*) -- **[REQUIRED]** The new password that your user wants to set. * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **UserContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **ClientMetadata** (*dict*) -- 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 ConfirmForgotPassword 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 ConfirmForgotPassword 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* The response from the server that results from a user's request to retrieve a forgotten password. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordHistoryPolicy ViolationException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.CodeMismatchException" * "CognitoIdentityProvider.Client.exceptions.ExpiredCodeException" * "CognitoIdentityProvider.Client.exceptions.TooManyFailedAttempts Exception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / admin_disable_user admin_disable_user ****************** CognitoIdentityProvider.Client.admin_disable_user(**kwargs) Deactivates a user profile and revokes all access tokens for the user. A deactivated user can't sign in, but still appears in the responses to "ListUsers" API requests. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_disable_user( UserPoolId='string', Username='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to disable the user. * **Username** (*string*) -- **[REQUIRED]** The name 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. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response received from the server to disable the user as an administrator. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_update_device_status admin_update_device_status ************************** CognitoIdentityProvider.Client.admin_update_device_status(**kwargs) Updates the status of a user's device so that it is marked as remembered or not remembered for the purpose of device authentication. Device authentication is a "remember me" mechanism that silently completes sign-in from trusted devices with a device key instead of a user-provided MFA code. This operation changes the status of a device without deleting it, so you can enable it again later. For more information about device authentication, see Working with devices. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_update_device_status( UserPoolId='string', Username='string', DeviceKey='string', DeviceRememberedStatus='remembered'|'not_remembered' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to change a user's device status. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **DeviceKey** (*string*) -- **[REQUIRED]** The unique identifier, or device key, of the device that you want to update the status for. * **DeviceRememberedStatus** (*string*) -- To enable device authentication with the specified device, set to "remembered".To disable, set to "not_remembered". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* The status response to the request to update the device, as an administrator. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_users list_users ********** CognitoIdentityProvider.Client.list_users(**kwargs) Given a user pool ID, returns a list of users and their basic details in a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_users( UserPoolId='string', AttributesToGet=[ 'string', ], Limit=123, PaginationToken='string', Filter='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to display or search for users. * **AttributesToGet** (*list*) -- A JSON array of user attribute names, for example "given_name", that you want Amazon Cognito to include in the response for each user. When you don't provide an "AttributesToGet" parameter, Amazon Cognito returns all attributes for each user. Use "AttributesToGet" with required attributes in your user pool, or in conjunction with "Filter". Amazon Cognito returns an error if not all users in the results have set a value for the attribute you request. Attributes that you can't filter on, including custom attributes, must have a value set in every user profile before an "AttributesToGet" parameter returns results. * *(string) --* * **Limit** (*integer*) -- The maximum number of users that you want Amazon Cognito to return in the response. * **PaginationToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. * **Filter** (*string*) -- A filter string of the form ""AttributeName Filter-Type "AttributeValue"". Quotation marks within the filter string must be escaped using the backslash ( "\") character. For example, ""family_name = \"Reddy\""". * *AttributeName*: The name of the attribute to search for. You can only search for one attribute at a time. * *Filter-Type*: For an exact match, use "=", for example, " "given_name = \"Jon\""". For a prefix ("starts with") match, use "^=", for example, " "given_name ^= \"Jon\""". * *AttributeValue*: The attribute value that must be matched for each user. If the filter string is empty, "ListUsers" returns all users in the user pool. You can only search for the following standard attributes: * "username" (case-sensitive) * "email" * "phone_number" * "name" * "given_name" * "family_name" * "preferred_username" * "cognito:user_status" (called **Status** in the Console) (case-insensitive) * "status (called **Enabled** in the Console) (case- sensitive)" * "sub" Custom attributes aren't searchable. Note: You can also list users with a client-side filter. The server-side filter matches no more than one attribute. For an advanced search, use a client-side filter with the "-- query" parameter of the "list-users" action in the CLI. When you use a client-side filter, ListUsers returns a paginated list of zero or more users. You can receive multiple pages in a row with zero results. Repeat the query with each pagination token that is returned until you receive a null pagination token value, and then review the combined result.For more information about server-side and client- side filtering, see FilteringCLI output in the Command Line Interface User Guide. For more information, see Searching for Users Using the ListUsers API and Examples of Using the ListUsers API in the *Amazon Cognito Developer Guide*. Return type: dict Returns: **Response Syntax** { 'Users': [ { 'Username': 'string', 'Attributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'UserCreateDate': datetime(2015, 1, 1), 'UserLastModifiedDate': datetime(2015, 1, 1), 'Enabled': True|False, 'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD'|'EXTERNAL_PROVIDER', 'MFAOptions': [ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] }, ], 'PaginationToken': 'string' } **Response Structure** * *(dict) --* The response from the request to list users. * **Users** *(list) --* An array of user pool users who match your query, and their attributes. * *(dict) --* A user profile in a Amazon Cognito user pool. * **Username** *(string) --* The user's username. * **Attributes** *(list) --* Names and values of a user's attributes, for example "email". * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **UserCreateDate** *(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. * **UserLastModifiedDate** *(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. * **Enabled** *(boolean) --* Indicates whether the user's account is enabled or disabled. * **UserStatus** *(string) --* The user status. This can be one of the following: * "UNCONFIRMED": User has been created but not confirmed. * "CONFIRMED": User has been confirmed. * "EXTERNAL_PROVIDER": User signed in with a third-party IdP. * "RESET_REQUIRED": User is confirmed, but the user must request a code and reset their password before they can sign in. * "FORCE_CHANGE_PASSWORD": The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change their password to a new value before doing anything else. The statuses "ARCHIVED", "UNKNOWN", and "COMPROMISED" are no longer used. * **MFAOptions** *(list) --* The user's MFA configuration. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". * **PaginationToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / update_user_attributes update_user_attributes ********************** CognitoIdentityProvider.Client.update_user_attributes(**kwargs) Updates the currently signed-in user's attributes. To delete an attribute from the user, submit the attribute in your API request with a blank value. For custom attributes, you must add a "custom:" prefix to the attribute name, for example "custom:department". Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = client.update_user_attributes( UserAttributes=[ { 'Name': 'string', 'Value': 'string' }, ], AccessToken='string', ClientMetadata={ 'string': 'string' } ) Parameters: * **UserAttributes** (*list*) -- **[REQUIRED]** An array of name-value pairs representing user attributes. For custom attributes, you must add a "custom:" prefix to the attribute name. If you have set an attribute to require verification before Amazon Cognito updates its value, this request doesn’t immediately update the value of that attribute. After your user receives and responds to a verification message to verify the new value, Amazon Cognito updates the attribute value. Your user can sign in and receive messages with the original attribute value until they verify the new value. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* **[REQUIRED]** The name of the attribute. * **Value** *(string) --* The value of the attribute. * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **ClientMetadata** (*dict*) -- A map of custom key-value pairs that you can provide as input for any custom workflows that this action initiates. You create custom workflows by assigning Lambda functions to user pool triggers. When you use the UpdateUserAttributes API action, Amazon Cognito invokes the function that is assigned to the *custom message* 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 UpdateUserAttributes 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** { 'CodeDeliveryDetailsList': [ { 'Destination': 'string', 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] } **Response Structure** * *(dict) --* Represents the response from the server for the request to update user attributes. * **CodeDeliveryDetailsList** *(list) --* When the attribute-update request includes an email address or phone number attribute, Amazon Cognito sends a message to users with a code that confirms ownership of the new value that they entered. The "CodeDeliveryDetails" object is information about the delivery destination for that link or code. This behavior happens in user pools configured to automatically verify changes to those attributes. For more information, see Verifying when users change their email or phone number. * *(dict) --* The delivery details for an email or SMS message that Amazon Cognito sent for authentication or verification. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.CodeMismatchException" * "CognitoIdentityProvider.Client.exceptions.ExpiredCodeException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.CodeDeliveryFailureEx ception" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / get_tokens_from_refresh_token get_tokens_from_refresh_token ***************************** CognitoIdentityProvider.Client.get_tokens_from_refresh_token(**kwargs) Given a refresh token, issues new ID, access, and optionally refresh tokens for the user who owns the submitted token. This operation issues a new refresh token and invalidates the original refresh token after an optional grace period when refresh token rotation is enabled. If refresh token rotation is disabled, issues new ID and access tokens only. See also: AWS API Documentation **Request Syntax** response = client.get_tokens_from_refresh_token( RefreshToken='string', ClientId='string', ClientSecret='string', DeviceKey='string', ClientMetadata={ 'string': 'string' } ) Parameters: * **RefreshToken** (*string*) -- **[REQUIRED]** A valid refresh token that can authorize the request for new tokens. When refresh token rotation is active in the requested app client, this token is invalidated after the request is complete. * **ClientId** (*string*) -- **[REQUIRED]** The app client that issued the refresh token to the user who wants to request new tokens. * **ClientSecret** (*string*) -- The client secret of the requested app client, if the client has a secret. * **DeviceKey** (*string*) -- When you enable device remembering, Amazon Cognito issues a device key that you can use for device authentication that bypasses multi-factor authentication (MFA). To implement "GetTokensFromRefreshToken" in a user pool with device remembering, you must capture the device key from the initial authentication request. If your application doesn't provide the key of a registered device, Amazon Cognito issues a new one. You must provide the confirmed device key in this request if device remembering is enabled in your user pool. For more information about device remembering, see Working with devices. * **ClientMetadata** (*dict*) -- 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 "GetTokensFromRefreshToken" API action, Amazon Cognito invokes the Lambda function the pre token generation trigger. For more information, see Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** { 'AuthenticationResult': { 'AccessToken': 'string', 'ExpiresIn': 123, 'TokenType': 'string', 'RefreshToken': 'string', 'IdToken': 'string', 'NewDeviceMetadata': { 'DeviceKey': 'string', 'DeviceGroupKey': 'string' } } } **Response Structure** * *(dict) --* * **AuthenticationResult** *(dict) --* The object that your application receives after authentication. Contains tokens and information for device authentication. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" * "CognitoIdentityProvider.Client.exceptions.RefreshTokenReuseExce ption" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / delete_user delete_user *********** CognitoIdentityProvider.Client.delete_user(**kwargs) Deletes the profile of the currently signed-in user. A deleted user profile can no longer be used to sign in and can't be restored. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.delete_user( AccessToken='string' ) Parameters: **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / set_user_settings set_user_settings ***************** CognitoIdentityProvider.Client.set_user_settings(**kwargs) *This action is no longer supported.* You can use it to configure only SMS MFA. You can't use it to configure time-based one-time password (TOTP) software token or email MFA. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.set_user_settings( AccessToken='string', MFAOptions=[ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **MFAOptions** (*list*) -- **[REQUIRED]** You can use this parameter only to set an SMS configuration that uses SMS for delivery. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* The response from the server for a set user settings request. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / list_user_import_jobs list_user_import_jobs ********************* CognitoIdentityProvider.Client.list_user_import_jobs(**kwargs) Given a user pool ID, returns user import jobs and their details. Import jobs are retained in user pool configuration so that you can stage, stop, start, review, and delete them. For more information about user import, see Importing users from a CSV file. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_user_import_jobs( UserPoolId='string', MaxResults=123, PaginationToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list import jobs. * **MaxResults** (*integer*) -- **[REQUIRED]** The maximum number of import jobs that you want Amazon Cognito to return in the response. * **PaginationToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'UserImportJobs': [ { 'JobName': 'string', 'JobId': 'string', 'UserPoolId': 'string', 'PreSignedUrl': 'string', 'CreationDate': datetime(2015, 1, 1), 'StartDate': datetime(2015, 1, 1), 'CompletionDate': datetime(2015, 1, 1), 'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded', 'CloudWatchLogsRoleArn': 'string', 'ImportedUsers': 123, 'SkippedUsers': 123, 'FailedUsers': 123, 'CompletionMessage': 'string' }, ], 'PaginationToken': 'string' } **Response Structure** * *(dict) --* Represents the response from the server to the request to list the user import jobs. * **UserImportJobs** *(list) --* An array of user import jobs from the requested user pool. For each, the response includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload. * *(dict) --* A user import job in a user pool. Describes the status of user import with a CSV file. For more information, see Importing users into user pools from a CSV file. * **JobName** *(string) --* The friendly name of the user import job. * **JobId** *(string) --* The ID of the user import job. * **UserPoolId** *(string) --* The ID of the user pool that the users are being imported into. * **PreSignedUrl** *(string) --* The pre-signed URL target for uploading the CSV file. * **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. * **StartDate** *(datetime) --* The date when the user import job was started. * **CompletionDate** *(datetime) --* The date when the user import job was completed. * **Status** *(string) --* The status of the user import job. One of the following: * "Created" - The job was created but not started. * "Pending" - A transition state. You have started the job, but it has not begun importing users yet. * "InProgress" - The job has started, and users are being imported. * "Stopping" - You have stopped the job, but the job has not stopped importing users yet. * "Stopped" - You have stopped the job, and the job has stopped importing users. * "Succeeded" - The job has completed successfully. * "Failed" - The job has stopped due to an error. * "Expired" - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job can't be started. * **CloudWatchLogsRoleArn** *(string) --* The role Amazon Resource Name (ARN) for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide. * **ImportedUsers** *(integer) --* The number of users that were successfully imported. * **SkippedUsers** *(integer) --* The number of users that were skipped. * **FailedUsers** *(integer) --* The number of users that couldn't be imported. * **CompletionMessage** *(string) --* The message returned when the user import job is completed. * **PaginationToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_user_pools list_user_pools *************** CognitoIdentityProvider.Client.list_user_pools(**kwargs) Lists user pools and their details in the current Amazon Web Services account. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_user_pools( NextToken='string', MaxResults=123 ) Parameters: * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. * **MaxResults** (*integer*) -- **[REQUIRED]** The maximum number of user pools that you want Amazon Cognito to return in the response. Return type: dict Returns: **Response Syntax** { 'UserPools': [ { 'Id': 'string', 'Name': 'string', 'LambdaConfig': { 'PreSignUp': 'string', 'CustomMessage': 'string', 'PostConfirmation': 'string', 'PreAuthentication': 'string', 'PostAuthentication': 'string', 'DefineAuthChallenge': 'string', 'CreateAuthChallenge': 'string', 'VerifyAuthChallengeResponse': 'string', 'PreTokenGeneration': 'string', 'UserMigration': 'string', 'PreTokenGenerationConfig': { 'LambdaVersion': 'V1_0'|'V2_0'|'V3_0', 'LambdaArn': 'string' }, 'CustomSMSSender': { 'LambdaVersion': 'V1_0', 'LambdaArn': 'string' }, 'CustomEmailSender': { 'LambdaVersion': 'V1_0', 'LambdaArn': 'string' }, 'KMSKeyID': 'string' }, 'Status': 'Enabled'|'Disabled', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* Represents the response to list user pools. * **UserPools** *(list) --* An array of user pools and their configuration details. * *(dict) --* A short description of a user pool. * **Id** *(string) --* The user pool ID. * **Name** *(string) --* The user pool name. * **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) --* The user pool status. * **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. * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / forget_device forget_device ************* CognitoIdentityProvider.Client.forget_device(**kwargs) Given a device key, deletes a remembered device as the currently signed-in user. For more information about device authentication, see Working with user devices in your user pool. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.forget_device( AccessToken='string', DeviceKey='string' ) Parameters: * **AccessToken** (*string*) -- A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **DeviceKey** (*string*) -- **[REQUIRED]** The unique identifier, or device key, of the device that the user wants to forget. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / get_log_delivery_configuration get_log_delivery_configuration ****************************** CognitoIdentityProvider.Client.get_log_delivery_configuration(**kwargs) Given a user pool ID, returns the logging configuration. User pools can export message-delivery error and threat-protection activity logs to external Amazon Web Services services. For more information, see Exporting user pool logs. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.get_log_delivery_configuration( UserPoolId='string' ) Parameters: **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that has the logging configuration that you want to view. Return type: dict Returns: **Response Syntax** { 'LogDeliveryConfiguration': { 'UserPoolId': 'string', 'LogConfigurations': [ { 'LogLevel': 'ERROR'|'INFO', 'EventSource': 'userNotification'|'userAuthEvents', 'CloudWatchLogsConfiguration': { 'LogGroupArn': 'string' }, 'S3Configuration': { 'BucketArn': 'string' }, 'FirehoseConfiguration': { 'StreamArn': 'string' } }, ] } } **Response Structure** * *(dict) --* * **LogDeliveryConfiguration** *(dict) --* The logging configuration of the requested user pool. Includes types of logs configured and their destinations. * **UserPoolId** *(string) --* The ID of the user pool where you configured logging. * **LogConfigurations** *(list) --* A logging destination of a user pool. User pools can have multiple logging destinations for message-delivery and user-activity logs. * *(dict) --* The configuration of user event logs to an external Amazon Web Services service like Amazon Data Firehose, Amazon S3, or Amazon CloudWatch Logs. * **LogLevel** *(string) --* The "errorlevel" selection of logs that a user pool sends for detailed activity logging. To send "userNotification" activity with information about message delivery, choose "ERROR" with "CloudWatchLogsConfiguration". To send "userAuthEvents" activity with user logs from threat protection with the Plus feature plan, choose "INFO" with one of "CloudWatchLogsConfiguration", "FirehoseConfiguration", or "S3Configuration". * **EventSource** *(string) --* The source of events that your user pool sends for logging. To send error-level logs about user notification activity, set to "userNotification". To send info-level logs about threat-protection user activity in user pools with the Plus feature plan, set to "userAuthEvents". * **CloudWatchLogsConfiguration** *(dict) --* The CloudWatch log group destination of user pool detailed activity logs, or of user activity log export with threat protection. * **LogGroupArn** *(string) --* The Amazon Resource Name (arn) of a CloudWatch Logs log group where your user pool sends logs. The log group must not be encrypted with Key Management Service and must be in the same Amazon Web Services account as your user pool. To send logs to log groups with a resource policy of a size greater than 5120 characters, configure a log group with a path that starts with "/aws/vendedlogs". For more information, see Enabling logging from certain Amazon Web Services services. * **S3Configuration** *(dict) --* The Amazon S3 bucket destination of user activity log export with threat protection. To activate this setting, your user pool must be on the Plus tier. * **BucketArn** *(string) --* The ARN of an Amazon S3 bucket that's the destination for threat protection log export. * **FirehoseConfiguration** *(dict) --* The Amazon Data Firehose stream destination of user activity log export with threat protection. To activate this setting, your user pool must be on the Plus tier. * **StreamArn** *(string) --* The ARN of an Amazon Data Firehose stream that's the destination for threat protection log export. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" CognitoIdentityProvider / Client / admin_forget_device admin_forget_device ******************* CognitoIdentityProvider.Client.admin_forget_device(**kwargs) Forgets, or deletes, a remembered device from a user's profile. After you forget the device, the user can no longer complete device authentication with that device and when applicable, must submit MFA codes again. For more information, see Working with devices. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_forget_device( UserPoolId='string', Username='string', DeviceKey='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where the device owner is a user. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **DeviceKey** (*string*) -- **[REQUIRED]** The key ID of the device that you want to delete. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / update_resource_server update_resource_server ********************** CognitoIdentityProvider.Client.update_resource_server(**kwargs) Updates the name and scopes of a resource server. All other fields are read-only. For more information about resource servers, see Access control with resource servers. Warning: If you don't provide a value for an attribute, it is set to the default value. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.update_resource_server( UserPoolId='string', Identifier='string', Name='string', Scopes=[ { 'ScopeName': 'string', 'ScopeDescription': 'string' }, ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the resource server that you want to update. * **Identifier** (*string*) -- **[REQUIRED]** A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system- data". You can also set an API URL like "https://solar-system- data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope- identifier strings increase the size of your access tokens. * **Name** (*string*) -- **[REQUIRED]** The updated name of the resource server. * **Scopes** (*list*) -- An array of updated custom scope names and descriptions that you want to associate with your resource server. * *(dict) --* One custom scope associated with a user pool resource server. This data type is a member of "ResourceServerScopeType". For more information, see Scopes, M2M, and API authorization with resource servers. * **ScopeName** *(string) --* **[REQUIRED]** The name of the scope. Amazon Cognito renders custom scopes in the format "resourceServerIdentifier/ScopeName". For example, if this parameter is "exampleScope" in the resource server with the identifier "exampleResourceServer", you request and receive the scope "exampleResourceServer/exampleScope". * **ScopeDescription** *(string) --* **[REQUIRED]** A friendly description of a custom scope. Return type: dict Returns: **Response Syntax** { 'ResourceServer': { 'UserPoolId': 'string', 'Identifier': 'string', 'Name': 'string', 'Scopes': [ { 'ScopeName': 'string', 'ScopeDescription': 'string' }, ] } } **Response Structure** * *(dict) --* * **ResourceServer** *(dict) --* The updated details of the requested resource server. * **UserPoolId** *(string) --* The ID of the user pool that contains the resource server configuration. * **Identifier** *(string) --* A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system-data". You can also set an API URL like "https://solar-system-data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope-identifier strings increase the size of your access tokens. * **Name** *(string) --* The name of the resource server. * **Scopes** *(list) --* A list of scopes that are defined for the resource server. * *(dict) --* One custom scope associated with a user pool resource server. This data type is a member of "ResourceServerScopeType". For more information, see Scopes, M2M, and API authorization with resource servers. * **ScopeName** *(string) --* The name of the scope. Amazon Cognito renders custom scopes in the format "resourceServerIdentifier/ScopeName". For example, if this parameter is "exampleScope" in the resource server with the identifier "exampleResourceServer", you request and receive the scope "exampleResourceServer/exampleScope". * **ScopeDescription** *(string) --* A friendly description of a custom scope. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / create_user_pool_domain create_user_pool_domain *********************** CognitoIdentityProvider.Client.create_user_pool_domain(**kwargs) A user pool domain hosts managed login, an authorization server and web server for authentication in your application. This operation creates a new user pool prefix domain or custom domain and sets the managed login branding version. Set the branding version to "1" for hosted UI (classic) or "2" for managed login. When you choose a custom domain, you must provide an SSL certificate in the US East (N. Virginia) Amazon Web Services Region in your request. Your prefix domain might take up to one minute to take effect. Your custom domain is online within five minutes, but it can take up to one hour to distribute your SSL certificate. For more information about adding a custom domain to your user pool, see Configuring a user pool domain. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.create_user_pool_domain( Domain='string', UserPoolId='string', ManagedLoginVersion=123, CustomDomainConfig={ 'CertificateArn': 'string' } ) Parameters: * **Domain** (*string*) -- **[REQUIRED]** The domain string. For custom domains, this is the fully- qualified domain name, such as "auth.example.com". For prefix domains, this is the prefix alone, such as "myprefix". A prefix value of "myprefix" for a user pool in the "us-east-1" Region results in a domain of "myprefix.auth.us- east-1.amazoncognito.com". * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to add a 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) and a version of "2" indicates managed login. Managed login requires that your user pool be configured for any feature plan other than "Lite". * **CustomDomainConfig** (*dict*) -- The configuration for a custom domain. Configures your domain with an Certificate Manager certificate in the "us-east-1" Region. Provide this parameter only if you want to use a custom domain for your user pool. Otherwise, you can omit this parameter and use a prefix domain instead. 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. * **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. Return type: 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) and a version of "2" indicates managed login. * **CloudFrontDomain** *(string) --* The fully-qualified domain name (FQDN) of the Amazon CloudFront distribution that hosts your managed login or classic hosted UI pages. Your domain-name authority must have an alias record that points requests for your custom domain to this FQDN. Amazon Cognito returns this value if you set a custom domain with "CustomDomainConfig". If you set an Amazon Cognito prefix domain, this parameter returns null. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / update_user_pool_domain update_user_pool_domain *********************** CognitoIdentityProvider.Client.update_user_pool_domain(**kwargs) A user pool domain hosts managed login, an authorization server and web server for authentication in your application. This operation updates the branding version for user pool domains between "1" for hosted UI (classic) and "2" for managed login. It also updates the SSL certificate for user pool custom domains. Changes to the domain branding version take up to one minute to take effect for a prefix domain and up to five minutes for a custom domain. This operation doesn't change the name of your user pool domain. To change your domain, delete it with "DeleteUserPoolDomain" and create a new domain with "CreateUserPoolDomain". You can pass the ARN of a new Certificate Manager certificate in this request. Typically, ACM certificates automatically renew and you user pool can continue to use the same ARN. But if you generate a new certificate for your custom domain name, replace the original configuration with the new ARN in this request. ACM certificates for custom domains must be in the US East (N. Virginia) 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 Configuring a user pool domain. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.update_user_pool_domain( Domain='string', UserPoolId='string', ManagedLoginVersion=123, CustomDomainConfig={ 'CertificateArn': 'string' } ) Parameters: * **Domain** (*string*) -- **[REQUIRED]** The name of the domain that you want to update. For custom domains, this is the fully-qualified domain name, for example "auth.example.com". For prefix domains, this is the prefix alone, such as "myprefix". * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that is associated with the domain you're updating. * **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. * **CustomDomainConfig** (*dict*) -- The configuration for a custom domain that hosts managed login for your application. In an "UpdateUserPoolDomain" request, this parameter specifies an SSL certificate for the managed login hosted webserver. The certificate must be an ACM ARN in "us-east-1". 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. * **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. Return type: 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 fully-qualified domain name (FQDN) of the Amazon CloudFront distribution that hosts your managed login or classic hosted UI pages. You domain-name authority must have an alias record that points requests for your custom domain to this FQDN. 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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / set_ui_customization set_ui_customization ******************** CognitoIdentityProvider.Client.set_ui_customization(**kwargs) Configures UI branding settings for domains with the hosted UI (classic) branding version. Your user pool must have a domain. Configure a domain with . Set the default configuration for all clients with a "ClientId" of "ALL". When the "ClientId" value is an app client ID, the settings you pass in this request apply to that app client and override the default "ALL" configuration. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.set_ui_customization( UserPoolId='string', ClientId='string', CSS='string', ImageFile=b'bytes' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to apply branding to the classic hosted UI. * **ClientId** (*string*) -- The ID of the app client that you want to customize. To apply a default style to all app clients not configured with client-level branding, set this parameter value to "ALL". * **CSS** (*string*) -- A plaintext CSS file that contains the custom fields that you want to apply to your user pool or app client. To download a template, go to the Amazon Cognito console. Navigate to your user pool *App clients* tab, select *Login pages*, edit *Hosted UI (classic) style*, and select the link to "CSS template.css". * **ImageFile** (*bytes*) -- The image that you want to set as your login in the classic hosted UI, as a Base64-formatted binary object. Return type: dict Returns: **Response Syntax** { 'UICustomization': { 'UserPoolId': 'string', 'ClientId': 'string', 'ImageUrl': 'string', 'CSS': 'string', 'CSSVersion': 'string', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **UICustomization** *(dict) --* Information about the hosted UI branding that you applied. * **UserPoolId** *(string) --* The ID of the user pool with hosted UI customizations. * **ClientId** *(string) --* The app client ID for your UI customization. When this value isn't present, the customization applies to all user pool app clients that don't have client-level settings.. * **ImageUrl** *(string) --* A URL path to the hosted logo image of your UI customization. * **CSS** *(string) --* The CSS values in the UI customization. * **CSSVersion** *(string) --* The CSS version number. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / get_user_attribute_verification_code get_user_attribute_verification_code ************************************ CognitoIdentityProvider.Client.get_user_attribute_verification_code(**kwargs) Given an attribute name, sends a user attribute verification code for the specified attribute name to 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". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = client.get_user_attribute_verification_code( AccessToken='string', AttributeName='string', ClientMetadata={ 'string': 'string' } ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **AttributeName** (*string*) -- **[REQUIRED]** The name of the attribute that the user wants to verify, for example "email". * **ClientMetadata** (*dict*) -- 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 GetUserAttributeVerificationCode API action, Amazon Cognito invokes the function that is assigned to the *custom message* 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 GetUserAttributeVerificationCode 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** { 'CodeDeliveryDetails': { 'Destination': 'string', 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' } } **Response Structure** * *(dict) --* The verification code response returned by the server response to get the user attribute verification code. * **CodeDeliveryDetails** *(dict) --* Information about the delivery destination of the user attribute verification code. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.CodeDeliveryFailureEx ception" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / get_group get_group ********* CognitoIdentityProvider.Client.get_group(**kwargs) Given a user pool ID and a group name, returns information about the user group. For more information about user pool groups, see Adding groups to a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.get_group( GroupName='string', UserPoolId='string' ) Parameters: * **GroupName** (*string*) -- **[REQUIRED]** The name of the group that you want to get information about. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the group that you want to query. Return type: dict Returns: **Response Syntax** { 'Group': { 'GroupName': 'string', 'UserPoolId': 'string', 'Description': 'string', 'RoleArn': 'string', 'Precedence': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **Group** *(dict) --* A container for the requested group. Includes description, precedence, and IAM role values. * **GroupName** *(string) --* The name of the group. * **UserPoolId** *(string) --* The ID of the user pool that contains the group. * **Description** *(string) --* A friendly description of the group. * **RoleArn** *(string) --* The ARN of the IAM role associated with the group. If a group has the highest priority of a user's groups, users who authenticate with an identity pool get credentials for the "RoleArn" that's associated with the group. * **Precedence** *(integer) --* A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher ornull "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is "null". * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_risk_configuration describe_risk_configuration *************************** CognitoIdentityProvider.Client.describe_risk_configuration(**kwargs) Given an app client or user pool ID where threat protection is configured, describes the risk configuration. This operation returns details about adaptive authentication, compromised credentials, and IP-address allow- and denylists. For more information about threat protection, see Threat protection. See also: AWS API Documentation **Request Syntax** response = client.describe_risk_configuration( UserPoolId='string', ClientId='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool with the risk configuration that you want to inspect. You can apply default risk configuration at the user pool level and further customize it from user pool defaults at the app-client level. Specify "ClientId" to inspect client-level configuration, or "UserPoolId" to inspect pool-level configuration. * **ClientId** (*string*) -- The ID of the app client with the risk configuration that you want to inspect. You can apply default risk configuration at the user pool level and further customize it from user pool defaults at the app-client level. Specify "ClientId" to inspect client-level configuration, or "UserPoolId" to inspect pool-level configuration. Return type: dict Returns: **Response Syntax** { 'RiskConfiguration': { 'UserPoolId': 'string', 'ClientId': 'string', 'CompromisedCredentialsRiskConfiguration': { 'EventFilter': [ 'SIGN_IN'|'PASSWORD_CHANGE'|'SIGN_UP', ], 'Actions': { 'EventAction': 'BLOCK'|'NO_ACTION' } }, 'AccountTakeoverRiskConfiguration': { 'NotifyConfiguration': { 'From': 'string', 'ReplyTo': 'string', 'SourceArn': 'string', 'BlockEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' }, 'NoActionEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' }, 'MfaEmail': { 'Subject': 'string', 'HtmlBody': 'string', 'TextBody': 'string' } }, 'Actions': { 'LowAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' }, 'MediumAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' }, 'HighAction': { 'Notify': True|False, 'EventAction': 'BLOCK'|'MFA_IF_CONFIGURED'|'MFA_REQUIRED'|'NO_ACTION' } } }, 'RiskExceptionConfiguration': { 'BlockedIPRangeList': [ 'string', ], 'SkippedIPRangeList': [ 'string', ] }, 'LastModifiedDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **RiskConfiguration** *(dict) --* The details of the requested risk configuration. * **UserPoolId** *(string) --* The ID of the user pool that has the risk configuration applied. * **ClientId** *(string) --* The app client where this configuration is applied. When this parameter isn't present, the risk configuration applies to all user pool app clients that don't have client-level settings. * **CompromisedCredentialsRiskConfiguration** *(dict) --* Settings for compromised-credentials actions and authentication types with threat protection in full- function "ENFORCED" mode. * **EventFilter** *(list) --* Settings for the sign-in activity where you want to configure compromised-credentials actions. Defaults to all events. * *(string) --* * **Actions** *(dict) --* Settings for the actions that you want your user pool to take when Amazon Cognito detects compromised credentials. * **EventAction** *(string) --* The action that Amazon Cognito takes when it detects compromised credentials. * **AccountTakeoverRiskConfiguration** *(dict) --* The settings for automated responses and notification templates for adaptive authentication with threat protection. * **NotifyConfiguration** *(dict) --* The settings for composing and sending an email message when threat protection assesses a risk level with adaptive authentication. When you choose to notify users in "AccountTakeoverRiskConfiguration", Amazon Cognito sends an email message using the method and template that you set with this data type. * **From** *(string) --* The email address that sends the email message. The address must be either individually verified with Amazon Simple Email Service, or from a domain that has been verified with Amazon SES. * **ReplyTo** *(string) --* The reply-to email address of an email template. * **SourceArn** *(string) --* The Amazon Resource Name (ARN) of the identity that is associated with the sending authorization policy. This identity permits Amazon Cognito to send for the email address specified in the "From" parameter. * **BlockEmail** *(dict) --* The template for the email message that your user pool sends when a detected risk event is blocked. * **Subject** *(string) --* The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **NoActionEmail** *(dict) --* The template for the email message that your user pool sends when no action is taken in response to a detected risk. * **Subject** *(string) --* The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **MfaEmail** *(dict) --* The template for the email message that your user pool sends when MFA is challenged in response to a detected risk. * **Subject** *(string) --* The subject of the threat protection email notification. * **HtmlBody** *(string) --* The body of an email notification formatted in HTML. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **TextBody** *(string) --* The body of an email notification formatted in plaintext. Choose an "HtmlBody" or a "TextBody" to send an HTML-formatted or plaintext message, respectively. * **Actions** *(dict) --* A list of account-takeover actions for each level of risk that Amazon Cognito might assess with threat protection. * **LowAction** *(dict) --* The action that you assign to a low-risk assessment by threat protection. * **Notify** *(boolean) --* Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **MediumAction** *(dict) --* The action that you assign to a medium-risk assessment by threat protection. * **Notify** *(boolean) --* Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **HighAction** *(dict) --* The action that you assign to a high-risk assessment by threat protection. * **Notify** *(boolean) --* Determines whether Amazon Cognito sends a user a notification message when your user pools assesses a user's session at the associated risk level. * **EventAction** *(string) --* The action to take for the attempted account takeover action for the associated risk level. Valid values are as follows: * "BLOCK": Block the request. * "MFA_IF_CONFIGURED": Present an MFA challenge if possible. MFA is possible if the user pool has active MFA methods that the user can set up. For example, if the user pool only supports SMS message MFA but the user doesn't have a phone number attribute, MFA setup isn't possible. If MFA setup isn't possible, allow the request. * "MFA_REQUIRED": Present an MFA challenge if possible. Block the request if a user hasn't set up MFA. To sign in with required MFA, users must have an email address or phone number attribute, or a registered TOTP factor. * "NO_ACTION": Take no action. Permit sign-in. * **RiskExceptionConfiguration** *(dict) --* Exceptions to the risk evaluation configuration, including always-allow and always-block IP address ranges. * **BlockedIPRangeList** *(list) --* An always-block IP address list. Overrides the risk decision and always blocks authentication requests. This parameter is displayed and set in CIDR notation. * *(string) --* * **SkippedIPRangeList** *(list) --* An always-allow IP address list. Risk detection isn't performed on the IP addresses in this range list. This parameter is displayed and set in CIDR notation. * *(string) --* * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserPoolAddOnNotEnabl edException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / verify_software_token verify_software_token ********************* CognitoIdentityProvider.Client.verify_software_token(**kwargs) Registers the current user's time-based one-time password (TOTP) authenticator with a code generated in their authenticator app from a private key that's supplied by your user pool. Marks the user's software token MFA status as "verified" if successful. The request takes an access token or a session string, but not both. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.verify_software_token( AccessToken='string', Session='string', UserCode='string', FriendlyDeviceName='string' ) Parameters: * **AccessToken** (*string*) -- A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **Session** (*string*) -- The session ID from an "AssociateSoftwareToken" request. * **UserCode** (*string*) -- **[REQUIRED]** A TOTP that the user generated in their configured authenticator app. * **FriendlyDeviceName** (*string*) -- A friendly name for the device that's running the TOTP authenticator. Return type: dict Returns: **Response Syntax** { 'Status': 'SUCCESS'|'ERROR', 'Session': 'string' } **Response Structure** * *(dict) --* * **Status** *(string) --* Amazon Cognito can accept or reject the code that you provide. This response parameter indicates the success of TOTP verification. Some reasons that this operation might return an error are clock skew on the user's device and excessive retries. * **Session** *(string) --* This session ID satisfies an "MFA_SETUP" challenge. Supply the session ID in your challenge response. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.EnableSoftwareTokenMF AException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.SoftwareTokenMFANotFo undException" * "CognitoIdentityProvider.Client.exceptions.CodeMismatchException" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / admin_get_user admin_get_user ************** CognitoIdentityProvider.Client.admin_get_user(**kwargs) Given a username, returns details about a user profile in a user pool. You can specify alias attributes in the "Username" request parameter. This operation contributes to your monthly active user (MAU) count for the purpose of billing. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_get_user( UserPoolId='string', Username='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to get information about the user. * **Username** (*string*) -- **[REQUIRED]** The name 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. Return type: dict Returns: **Response Syntax** { 'Username': 'string', 'UserAttributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'UserCreateDate': datetime(2015, 1, 1), 'UserLastModifiedDate': datetime(2015, 1, 1), 'Enabled': True|False, 'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD'|'EXTERNAL_PROVIDER', 'MFAOptions': [ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ], 'PreferredMfaSetting': 'string', 'UserMFASettingList': [ 'string', ] } **Response Structure** * *(dict) --* Represents the response from the server from the request to get the specified user as an administrator. * **Username** *(string) --* The username of the user that you requested. * **UserAttributes** *(list) --* An array of name-value pairs of user attributes and their values, for example ""email": "testuser@example.com"". * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **UserCreateDate** *(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. * **UserLastModifiedDate** *(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. * **Enabled** *(boolean) --* Indicates whether the user is activated for sign-in. * **UserStatus** *(string) --* The user's status. Can be one of the following: * UNCONFIRMED - User has been created but not confirmed. * CONFIRMED - User has been confirmed. * UNKNOWN - User status isn't known. * RESET_REQUIRED - User is confirmed, but the user must request a code and reset their password before they can sign in. * FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a temporary password, but on first sign- in, the user must change their password to a new value before doing anything else. * EXTERNAL_PROVIDER - The user signed in with a third-party identity provider. * **MFAOptions** *(list) --* *This response parameter is no longer supported.* It provides information only about SMS MFA configurations. It doesn't provide information about time-based one-time password (TOTP) software token MFA configurations. To look up information about either type of MFA configuration, use UserMFASettingList instead. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". * **PreferredMfaSetting** *(string) --* The user's preferred MFA. Users can prefer SMS message, email message, or TOTP MFA. * **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) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_update_auth_event_feedback admin_update_auth_event_feedback ******************************** CognitoIdentityProvider.Client.admin_update_auth_event_feedback(**kwargs) Provides the feedback for an authentication event generated by threat protection features. Your response indicates that you think that the event either was from a valid user or was an unwanted authentication attempt. This feedback improves the risk evaluation decision for the user pool as part of Amazon Cognito threat protection. To activate this setting, your user pool must be on the Plus tier. To train the threat-protection model to recognize trusted and untrusted sign-in characteristics, configure threat protection in audit-only mode and provide a mechanism for users or administrators to submit feedback. Your feedback can tell Amazon Cognito that a risk rating was assigned at a level you don't agree with. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_update_auth_event_feedback( UserPoolId='string', Username='string', EventId='string', FeedbackValue='Valid'|'Invalid' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to submit authentication-event feedback. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **EventId** (*string*) -- **[REQUIRED]** The ID of the threat protection authentication event that you want to update. * **FeedbackValue** (*string*) -- **[REQUIRED]** Your feedback to the authentication event. When you provide a "FeedbackValue" value of "valid", you tell Amazon Cognito that you trust a user session where Amazon Cognito has evaluated some level of risk. When you provide a "FeedbackValue" value of "invalid", you tell Amazon Cognito that you don't trust a user session, or you don't believe that Amazon Cognito evaluated a high-enough risk level. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserPoolAddOnNotEnabl edException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_respond_to_auth_challenge admin_respond_to_auth_challenge ******************************* CognitoIdentityProvider.Client.admin_respond_to_auth_challenge(**kwargs) 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. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = 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' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to respond to an authentication challenge. * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client where you initiated sign-in. * **ChallengeName** (*string*) -- **[REQUIRED]** The name of the challenge that you are responding to. Possible challenges include the following: Note: All of the following challenges require "USERNAME" and, when the app client has a client secret, "SECRET_HASH" in the parameters. * "WEB_AUTHN": Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and 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": Respond with an "SMS_MFA_CODE" that your user pool delivered in an SMS message. * "EMAIL_OTP": Respond with an "EMAIL_OTP_CODE" that your user pool delivered in an email message. * "PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after 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. The parameters of the challenge are determined by your Lambda function. * "DEVICE_SRP_AUTH": Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device. * "DEVICE_PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after client-side SRP calculations. For more information, see Signing in with a device. * "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. Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes. * "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 time-based one-time password (TOTP) MFA, use the session returned in this challenge from "InitiateAuth" or "AdminInitiateAuth" as an input to "AssociateSoftwareToken". Then, use the session returned by "VerifySoftwareToken" as an input to "RespondToAuthChallenge" or "AdminRespondToAuthChallenge" with challenge name "MFA_SETUP" to complete sign-in. To set up SMS or email MFA, collect a "phone_number" or "email" attribute for the user. Then restart the authentication flow with an "InitiateAuth" or "AdminInitiateAuth" request. * **ChallengeResponses** (*dict*) -- 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. Warning: You must provide a SECRET_HASH parameter in all challenge responses to an app client that has a client secret. Include a "DEVICE_KEY" for device authentication.SELECT_CHALLENGE ""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. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes.SOFTWARE_TOKEN_MFA ""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) --* * **Session** (*string*) -- The session identifier that maintains the state of authentication requests and challenge responses. If an "AdminInitiateAuth" or "AdminRespondToAuthChallenge" API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next "AdminRespondToAuthChallenge" request. * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **ContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **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. * **ClientMetadata** (*dict*) -- 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: 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 next challenge that you must respond to. Possible challenges include the following: Note: All of the following challenges require "USERNAME" and, when the app client has a client secret, "SECRET_HASH" in the parameters. * "WEB_AUTHN": Respond to the challenge with the results of a successful authentication with a WebAuthn authenticator, or passkey. Examples of WebAuthn authenticators include biometric devices and 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": Respond with an "SMS_MFA_CODE" that your user pool delivered in an SMS message. * "EMAIL_OTP": Respond with an "EMAIL_OTP_CODE" that your user pool delivered in an email message. * "PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after 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. The parameters of the challenge are determined by your Lambda function. * "DEVICE_SRP_AUTH": Respond with the initial parameters of device SRP authentication. For more information, see Signing in with a device. * "DEVICE_PASSWORD_VERIFIER": Respond with "PASSWORD_CLAIM_SIGNATURE", "PASSWORD_CLAIM_SECRET_BLOCK", and "TIMESTAMP" after client-side SRP calculations. For more information, see Signing in with a device. * "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. Amazon Cognito only returns this challenge for users who have temporary passwords. When you create passwordless users, you must provide values for all required attributes. Note: In a "NEW_PASSWORD_REQUIRED" challenge response, you can't modify a required attribute that already has a value. In "AdminRespondToAuthChallenge" or "RespondToAuthChallenge", set a value for any keys that Amazon Cognito returned in the "requiredAttributes" parameter, then use the "AdminUpdateUserAttributes" or "UpdateUserAttributes" API operation to modify the value of any additional attributes. * "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 time-based one-time password (TOTP) MFA, use the session returned in this challenge from "InitiateAuth" or "AdminInitiateAuth" as an input to "AssociateSoftwareToken". Then, use the session returned by "VerifySoftwareToken" as an input to "RespondToAuthChallenge" or "AdminRespondToAuthChallenge" with challenge name "MFA_SETUP" to complete sign-in. To set up SMS or email MFA, collect a "phone_number" or "email" attribute for the user. Then restart the authentication flow with an "InitiateAuth" or "AdminInitiateAuth" request. * **Session** *(string) --* The session identifier that maintains the state of authentication requests and challenge responses. If an "AdminInitiateAuth" or "AdminRespondToAuthChallenge" API request results in a determination that your application must pass another challenge, Amazon Cognito returns a session with other challenge parameters. Send this session identifier, unmodified, to the next "AdminRespondToAuthChallenge" request. * **ChallengeParameters** *(dict) --* The parameters that define your response to the next challenge. * *(string) --* * *(string) --* * **AuthenticationResult** *(dict) --* The outcome of a successful authentication process. After your application has passed all challenges, Amazon Cognito returns an "AuthenticationResult" with the JSON web tokens (JWTs) that indicate successful sign-in. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.CodeMismatchException" * "CognitoIdentityProvider.Client.exceptions.ExpiredCodeException" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordHistoryPolicy ViolationException" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.MFAMethodNotFoundExce ption" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.SoftwareTokenMFANotFo undException" CognitoIdentityProvider / Client / create_group create_group ************ CognitoIdentityProvider.Client.create_group(**kwargs) Creates a new group in the specified user pool. For more information about user pool groups, see Adding groups to a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.create_group( GroupName='string', UserPoolId='string', Description='string', RoleArn='string', Precedence=123 ) Parameters: * **GroupName** (*string*) -- **[REQUIRED]** A name for the group. This name must be unique in your user pool. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to create a user group. * **Description** (*string*) -- A description of the group that you're creating. * **RoleArn** (*string*) -- The Amazon Resource Name (ARN) for the IAM role that you want to associate with the group. A group role primarily declares a preferred role for the credentials that you get from an identity pool. Amazon Cognito ID tokens have a "cognito:preferred_role" claim that presents the highest-precedence group that a user belongs to. Both ID and access tokens also contain a "cognito:groups" claim that list all the groups that a user is a member of. * **Precedence** (*integer*) -- A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher or null "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is null. The maximum "Precedence" value is "2^31-1". Return type: dict Returns: **Response Syntax** { 'Group': { 'GroupName': 'string', 'UserPoolId': 'string', 'Description': 'string', 'RoleArn': 'string', 'Precedence': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **Group** *(dict) --* The response object for a created group. * **GroupName** *(string) --* The name of the group. * **UserPoolId** *(string) --* The ID of the user pool that contains the group. * **Description** *(string) --* A friendly description of the group. * **RoleArn** *(string) --* The ARN of the IAM role associated with the group. If a group has the highest priority of a user's groups, users who authenticate with an identity pool get credentials for the "RoleArn" that's associated with the group. * **Precedence** *(integer) --* A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher ornull "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is "null". * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.GroupExistsException" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_list_groups_for_user admin_list_groups_for_user ************************** CognitoIdentityProvider.Client.admin_list_groups_for_user(**kwargs) Lists the groups that a user belongs to. User pool groups are identifiers that you can reference from the contents of ID and access tokens, and set preferred IAM roles for identity-pool authentication. For more information, see Adding groups to a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_list_groups_for_user( Username='string', UserPoolId='string', Limit=123, NextToken='string' ) Parameters: * **Username** (*string*) -- **[REQUIRED]** The name 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. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to view a user's groups. * **Limit** (*integer*) -- The maximum number of groups that you want Amazon Cognito to return in the response. * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'Groups': [ { 'GroupName': 'string', 'UserPoolId': 'string', 'Description': 'string', 'RoleArn': 'string', 'Precedence': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Groups** *(list) --* An array of groups and information about them. * *(dict) --* A user pool group. Contains details about the group and the way that it contributes to IAM role decisions with identity pools. Identity pools can make decisions about the IAM role to assign based on groups: users get credentials for the role associated with their highest- priority group. * **GroupName** *(string) --* The name of the group. * **UserPoolId** *(string) --* The ID of the user pool that contains the group. * **Description** *(string) --* A friendly description of the group. * **RoleArn** *(string) --* The ARN of the IAM role associated with the group. If a group has the highest priority of a user's groups, users who authenticate with an identity pool get credentials for the "RoleArn" that's associated with the group. * **Precedence** *(integer) --* A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher ornull "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is "null". * **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. * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_identity_provider describe_identity_provider ************************** CognitoIdentityProvider.Client.describe_identity_provider(**kwargs) Given a user pool ID and identity provider (IdP) name, returns details about the IdP. See also: AWS API Documentation **Request Syntax** response = client.describe_identity_provider( UserPoolId='string', ProviderName='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that has the IdP that you want to describe.. * **ProviderName** (*string*) -- **[REQUIRED]** The name of the IdP that you want to describe. Return type: dict Returns: **Response Syntax** { 'IdentityProvider': { 'UserPoolId': 'string', 'ProviderName': 'string', 'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'SignInWithApple'|'OIDC', 'ProviderDetails': { 'string': 'string' }, 'AttributeMapping': { 'string': 'string' }, 'IdpIdentifiers': [ 'string', ], 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **IdentityProvider** *(dict) --* The details of the requested IdP. * **UserPoolId** *(string) --* The ID of the user pool associated with the IdP. * **ProviderName** *(string) --* A friendly name for the IdP. * **ProviderType** *(string) --* The type of IdP. Either SAML, OIDC, or a named social identity provider. * **ProviderDetails** *(dict) --* The scopes, URLs, and identifiers for your external identity provider. The following examples describe the provider detail keys for each IdP type. These values and their schema are subject to change. Social IdP "authorize_scopes" values must match the values listed here. OpenID Connect (OIDC) Amazon Cognito accepts the following elements when it can't discover endpoint URLs from "oidc_issuer": "attributes_url", "authorize_url", "jwks_uri", "token_url". Create or update request: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client- secret", "jwks_uri": "https://auth.example.com/.well- known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" Describe response: ""ProviderDetails": { "attributes_request_method": "GET", "attributes_url": "https://auth.example.com/userInfo", "attributes_url_add_attributes": "false", "authorize_scopes": "openid profile email", "authorize_url": "https://auth.example.com/authorize", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "jwks_uri": "https://auth.example.com/.well-known/jwks.json", "oidc_issuer": "https://auth.example.com", "token_url": "https://example.com/token" }" SAML Create or update request with Metadata URL: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256" }" Create or update request with Metadata file: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "MetadataFile": "[metadata XML]", "RequestSigningAlgorithm": "rsa-sha256" }" The value of "MetadataFile" must be the plaintext metadata document with all quote (") characters escaped by backslashes. Describe response: ""ProviderDetails": { "IDPInit": "true", "IDPSignout": "true", "EncryptedResponses" : "true", "ActiveEncryptionCertificate": "[certificate]", "MetadataURL": "https://auth.example.com/sso/saml/metadata", "RequestSigningAlgorithm": "rsa-sha256", "SLORedirectBindingURI": "https://auth.example.com/slo/saml", "SSORedirectBindingURI": "https://auth.example.com/sso/saml" }" LoginWithAmazon Create or update request: ""ProviderDetails": { "authorize_scopes": "profile postal_code", "client_id": "amzn1.application-oa2-client.1example23456789", "client_secret": "provider-app-client-secret"" Describe response: ""ProviderDetails": { "attributes_url": "https://api.amazon.com/user/profile", "attributes_url_add_attributes": "false", "authorize_scopes": "profile postal_code", "authorize_url": "https://www.amazon.com/ap/oa", "client_id": "amzn1.application- oa2-client.1example23456789", "client_secret": "provider- app-client-secret", "token_request_method": "POST", "token_url": "https://api.amazon.com/auth/o2/token" }" Google Create or update request: ""ProviderDetails": { "authorize_scopes": "email profile openid", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "attributes_url": "https://people.googleapis.com/v1/people/me?personFields= ", "attributes_url_add_attributes": "true", "authorize_scopes": "email profile openid", "authorize_url": "https://accounts.google.com/o/oauth2/v2/auth", "client_id": "1example23456789.apps.googleusercontent.com", "client_secret": "provider-app-client-secret", "oidc_issuer": "https://accounts.google.com", "token_request_method": "POST", "token_url": "https://www.googleapis.com/oauth2/v4/token" }" SignInWithApple Create or update request: ""ProviderDetails": { "authorize_scopes": "email name", "client_id": "com.example.cognito", "private_key": "1EXAMPLE", "key_id": "2EXAMPLE", "team_id": "3EXAMPLE" }" Describe response: ""ProviderDetails": { "attributes_url_add_attributes": "false", "authorize_scopes": "email name", "authorize_url": "https://appleid.apple.com/auth/authorize", "client_id": "com.example.cognito", "key_id": "1EXAMPLE", "oidc_issuer": "https://appleid.apple.com", "team_id": "2EXAMPLE", "token_request_method": "POST", "token_url": "https://appleid.apple.com/auth/token" }" Facebook Create or update request: ""ProviderDetails": { "api_version": "v17.0", "authorize_scopes": "public_profile, email", "client_id": "1example23456789", "client_secret": "provider-app-client-secret" }" Describe response: ""ProviderDetails": { "api_version": "v17.0", "attributes_url": "https://graph.facebook.com/v17.0/me?fields=", "attributes_url_add_attributes": "true", "authorize_scopes": "public_profile, email", "authorize_url": "https://www.facebook.com/v17.0/dialog/oauth", "client_id": "1example23456789", "client_secret": "provider-app-client-secret", "token_request_method": "GET", "token_url": "https://graph.facebook.com/v17.0/oauth/access_token" }" * *(string) --* * *(string) --* * **AttributeMapping** *(dict) --* A mapping of IdP attributes to standard and custom user pool attributes. * *(string) --* * *(string) --* * **IdpIdentifiers** *(list) --* A list of IdP identifiers. IdP identifiers are strings that represent friendly names or domain names of IdPs, for example "MyIdP" or "auth.example.com". You can choose to route user authorization requests to the right IdP with either IdP identifiers or IdP names. For more information, see "identity_provider" and "idp_identifier" at Authorize endpoint. * *(string) --* * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_user_pool describe_user_pool ****************** CognitoIdentityProvider.Client.describe_user_pool(**kwargs) Given a user pool ID, returns configuration information. This operation is useful when you want to inspect an existing user pool and programmatically replicate the configuration to another user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.describe_user_pool( UserPoolId='string' ) Parameters: **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool you want to describe. Return type: dict Returns: **Response Syntax** { 'UserPool': { 'Id': 'string', 'Name': 'string', 'Policies': { 'PasswordPolicy': { 'MinimumLength': 123, 'RequireUppercase': True|False, 'RequireLowercase': True|False, 'RequireNumbers': True|False, 'RequireSymbols': True|False, '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'|'V3_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 details of the requested user pool. * **Id** *(string) --* The ID of the user pool. * **Name** *(string) --* The name of the user pool. * **Policies** *(dict) --* A list of user pool policies. Contains the policy that sets password-complexity requirements. * **PasswordPolicy** *(dict) --* The password policy settings for a user pool, including complexity, history, and length requirements. * **MinimumLength** *(integer) --* The minimum length of the password in the policy that you have set. This value can't be less than 6. * **RequireUppercase** *(boolean) --* The requirement in a password policy that users must include at least one uppercase letter in their password. * **RequireLowercase** *(boolean) --* The requirement in a password policy that users must include at least one lowercase letter in their password. * **RequireNumbers** *(boolean) --* The requirement in a password policy that users must include at least one number in their password. * **RequireSymbols** *(boolean) --* The requirement in a password policy that users must include at least one symbol in their password. * **PasswordHistorySize** *(integer) --* The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of "n" previous passwords, where "n" is the value of "PasswordHistorySize". * **TemporaryPasswordValidityDays** *(integer) --* The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to "7". If you submit a value of "0", Amazon Cognito treats it as a null value and sets "TemporaryPasswordValidityDays" to its default value. Note: When you set "TemporaryPasswordValidityDays" for a user pool, you can no longer set a value for the legacy "UnusedAccountValidityDays" parameter in that user pool. * **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. * **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) --* Note: You should use WriteAttributes in the user pool client to control how attributes can be mutated for new use cases instead of using "DeveloperOnlyAttribute". Specifies whether the attribute type is developer only. This attribute can only be modified by an administrator. Users won't be able to modify this attribute using their access token. For example, "DeveloperOnlyAttribute" can be modified using AdminUpdateUserAttributes but can't be updated using UpdateUserAttributes. * **Mutable** *(boolean) --* Specifies whether the value of the attribute can be changed. Any user pool attribute whose value you map from an IdP attribute must be mutable, with a parameter value of "true". Amazon Cognito updates mapped attributes when users sign in to your application through an IdP. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute. For more information, see Specifying Identity Provider Attribute Mappings for Your User Pool. * **Required** *(boolean) --* Specifies whether a user pool attribute is required. If the attribute is required and the user doesn't provide a value, registration or sign-in will fail. * **NumberAttributeConstraints** *(dict) --* Specifies the constraints for an attribute of the number type. * **MinValue** *(string) --* The minimum value of an attribute that is of the number data type. * **MaxValue** *(string) --* The maximum length of a number attribute value. Must be a number less than or equal to "2^1023", represented as a string with a length of 131072 characters or fewer. * **StringAttributeConstraints** *(dict) --* Specifies the constraints for an attribute of the string type. * **MinLength** *(string) --* The minimum length of a string attribute value. * **MaxLength** *(string) --* The maximum length of a string attribute value. Must be a number less than or equal to "2^1023", represented as a string with a length of 131072 characters or fewer. * **AutoVerifiedAttributes** *(list) --* The attributes that are auto-verified in a user pool. * *(string) --* * **AliasAttributes** *(list) --* Attributes supported as an alias for this user pool. An alias is an attribute that users can enter as an alternative username. Possible values: **phone_number**, **email**, or **preferred_username**. * *(string) --* * **UsernameAttributes** *(list) --* Specifies whether a user can use an email address or phone number as a username when they sign up. * *(string) --* * **SmsVerificationMessage** *(string) --* This parameter is no longer used. * **EmailVerificationMessage** *(string) --* This parameter is no longer used. * **EmailVerificationSubject** *(string) --* This parameter is no longer used. * **VerificationMessageTemplate** *(dict) --* The template for the verification message that your user pool delivers to users who set an email address or phone number attribute. * **SmsMessage** *(string) --* The template for SMS messages that Amazon Cognito sends to your users. * **EmailMessage** *(string) --* The template for email messages that Amazon Cognito sends to your users. You can set an "EmailMessage" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **EmailSubject** *(string) --* The subject line for the email message template. You can set an "EmailSubject" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **EmailMessageByLink** *(string) --* The email message template for sending a confirmation link to the user. You can set an "EmailMessageByLink" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **EmailSubjectByLink** *(string) --* The subject line for the email message template for sending a confirmation link to the user. You can set an "EmailSubjectByLink" template only if the value of EmailSendingAccount is "DEVELOPER". When your EmailSendingAccount is "DEVELOPER", your user pool sends email messages with your own Amazon SES configuration. * **DefaultEmailOption** *(string) --* The configuration of verification emails to contain a clickable link or a verification code. For link, your template body must contain link text in the format "{##Click here##}". "Click here" in the example is a customizable string. For code, your template body must contain a code placeholder in the format "{####}". * **SmsAuthenticationMessage** *(string) --* The contents of the SMS authentication message. * **UserAttributeUpdateSettings** *(dict) --* The settings for updates to user attributes. These settings include the property "AttributesRequireVerificationBeforeUpdate", a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers. * **AttributesRequireVerificationBeforeUpdate** *(list) --* Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value. When "AttributesRequireVerificationBeforeUpdate" is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where "AttributesRequireVerificationBeforeUpdate" is false, API operations that change attribute values can immediately update a user’s "email" or "phone_number" attribute. * *(string) --* * **MfaConfiguration** *(string) --* Can be one of the following values: * "OFF" - MFA tokens aren't required and can't be specified during user registration. * "ON" - MFA tokens are required for all user registrations. You can only specify required when you're initially creating a user pool. * "OPTIONAL" - Users have the option when registering to create an MFA token. * **DeviceConfiguration** *(dict) --* The device-remembering configuration for a user pool. A null value indicates that you have deactivated device remembering in your user pool. Note: When you provide a value for any "DeviceConfiguration" field, you activate the Amazon Cognito device- remembering feature. * **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). Note: Whether or not "ChallengeRequiredOnNewDevice" is true, users who sign in with devices that have not been confirmed or remembered must still provide a second factor in a user pool that requires 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 ". 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. The password expiration limit in days for administrator- created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call "AdminCreateUser" again, specifying "RESEND" for the "MessageAction" parameter. The default value for this parameter is 7. * **InviteMessageTemplate** *(dict) --* The template for the welcome message to new users. This template must include the "{####}" temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder. See also Customizing User Invitation Messages. * **SMSMessage** *(string) --* The message template for SMS messages. * **EmailMessage** *(string) --* The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER. * **EmailSubject** *(string) --* The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER. * **UserPoolAddOns** *(dict) --* Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to "AUDIT". To configure automatic security responses to potentially unwanted traffic to your user pool, set to "ENFORCED". For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier. * **AdvancedSecurityMode** *(string) --* The operating mode of threat protection for standard authentication types in your user pool, including username-password and secure remote password (SRP) authentication. * **AdvancedSecurityAdditionalFlows** *(dict) --* Threat protection configuration options for additional authentication types in your user pool, including custom authentication. * **CustomAuthMode** *(string) --* The operating mode of threat protection in custom authentication with Custom authentication challenge Lambda triggers. * **UsernameConfiguration** *(dict) --* Case sensitivity of the username input for the selected sign-in option. When case sensitivity is set to "False" (case insensitive), users can sign in with any combination of capital and lowercase letters. For example, "username", "USERNAME", or "UserName", or for email, "email@example.com" or "EMaiL@eXamplE.Com". For most use cases, set case sensitivity to "False" (case insensitive) as a best practice. When usernames and email addresses are case insensitive, Amazon Cognito treats any variation in case as the same user, and prevents a case variation from being assigned to the same attribute for a different user. * **CaseSensitive** *(boolean) --* Specifies whether user name case sensitivity will be applied for all users in the user pool through Amazon Cognito APIs. For most use cases, set case sensitivity to "False" (case insensitive) as a best practice. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name. Valid values include: true Enables case sensitivity for all username input. When this option is set to "true", users must sign in using the exact capitalization of their given username, such as “UserName”. This is the default value. false Enables case insensitivity for all username input. For example, when this option is set to "false", users can sign in using "username", "USERNAME", or "UserName". This option also enables both "preferred_username" and "email" alias to be case insensitive, in addition to the "username" attribute. * **Arn** *(string) --* The Amazon Resource Name (ARN) of the user pool. * **AccountRecoverySetting** *(dict) --* The available verified method a user can use to recover their password when they call "ForgotPassword". You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email. * **RecoveryMechanisms** *(list) --* The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators. * *(dict) --* A recovery option for a user. The "AccountRecoverySettingType" data type is an array of this object. Each "RecoveryOptionType" has a priority property that determines whether it is a primary or secondary option. For example, if "verified_email" has a priority of "1" and "verified_phone_number" has a priority of "2", your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The "admin_only" option prevents self-service account recovery. * **Priority** *(integer) --* Your priority preference for using the specified attribute in account recovery. The highest priority is "1". * **Name** *(string) --* The recovery method that this object sets a recovery option for. * **UserPoolTier** *(string) --* The user pool feature plan, or tier. This parameter determines the eligibility of the user pool for features like managed login, access-token customization, and threat protection. Defaults to "ESSENTIALS". **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserPoolTaggingExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_identity_providers list_identity_providers *********************** CognitoIdentityProvider.Client.list_identity_providers(**kwargs) Given a user pool ID, returns information about configured identity providers (IdPs). For more information about IdPs, see Third-party IdP sign-in. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_identity_providers( UserPoolId='string', MaxResults=123, NextToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list IdPs. * **MaxResults** (*integer*) -- The maximum number of IdPs that you want Amazon Cognito to return in the response. * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'Providers': [ { 'ProviderName': 'string', 'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'SignInWithApple'|'OIDC', 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Providers** *(list) --* An array of the IdPs in your user pool. For each, the response includes identifiers, the IdP name and type, and trust-relationship details like the issuer URL. * *(dict) --* The details of a user pool identity provider (IdP), including name and type. * **ProviderName** *(string) --* The name of the IdP, for example "MySAMLProvider". * **ProviderType** *(string) --* The type of the provider, for example "SAML". Amazon Cognito supports SAML 2.0, OIDC, and social IdPs. User pools list supported social IdPs by name in this response parameter: Facebook, Google, Login with Amazon, and Sign in with Apple. * **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. * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / close close ***** CognitoIdentityProvider.Client.close() Closes underlying endpoint connections. CognitoIdentityProvider / Client / update_device_status update_device_status ******************** CognitoIdentityProvider.Client.update_device_status(**kwargs) Updates the status of a the currently signed-in user's device so that it is marked as remembered or not remembered for the purpose of device authentication. Device authentication is a "remember me" mechanism that silently completes sign-in from trusted devices with a device key instead of a user-provided MFA code. This operation changes the status of a device without deleting it, so you can enable it again later. For more information about device authentication, see Working with devices. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.update_device_status( AccessToken='string', DeviceKey='string', DeviceRememberedStatus='remembered'|'not_remembered' ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **DeviceKey** (*string*) -- **[REQUIRED]** The device key of the device you want to update, for example "us-west-2_a1b2c3d4-5678-90ab-cdef-EXAMPLE11111". * **DeviceRememberedStatus** (*string*) -- To enable device authentication with the specified device, set to "remembered".To disable, set to "not_remembered". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* The response to the request to update the device status. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / complete_web_authn_registration complete_web_authn_registration ******************************* CognitoIdentityProvider.Client.complete_web_authn_registration(**kwargs) Completes registration of a passkey authenticator 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** response = client.complete_web_authn_registration( AccessToken='string', Credential={...}|[...]|123|123.4|'string'|True|None ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **Credential** (*document*) -- **[REQUIRED]** A RegistrationResponseJSON public-key credential response from the user's passkey provider. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.WebAuthnNotEnabledExc eption" * "CognitoIdentityProvider.Client.exceptions.WebAuthnChallengeNotF oundException" * "CognitoIdentityProvider.Client.exceptions.WebAuthnRelyingPartyM ismatchException" * "CognitoIdentityProvider.Client.exceptions.WebAuthnClientMismatc hException" * "CognitoIdentityProvider.Client.exceptions.WebAuthnOriginNotAllo wedException" * "CognitoIdentityProvider.Client.exceptions.WebAuthnCredentialNot SupportedException" CognitoIdentityProvider / Client / list_groups list_groups *********** CognitoIdentityProvider.Client.list_groups(**kwargs) Given a user pool ID, returns user pool groups and their details. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_groups( UserPoolId='string', Limit=123, NextToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list user groups. * **Limit** (*integer*) -- The maximum number of groups that you want Amazon Cognito to return in the response. * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'Groups': [ { 'GroupName': 'string', 'UserPoolId': 'string', 'Description': 'string', 'RoleArn': 'string', 'Precedence': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Groups** *(list) --* An array of groups and their details. Each entry that's returned includes description, precedence, and IAM role values. * *(dict) --* A user pool group. Contains details about the group and the way that it contributes to IAM role decisions with identity pools. Identity pools can make decisions about the IAM role to assign based on groups: users get credentials for the role associated with their highest- priority group. * **GroupName** *(string) --* The name of the group. * **UserPoolId** *(string) --* The ID of the user pool that contains the group. * **Description** *(string) --* A friendly description of the group. * **RoleArn** *(string) --* The ARN of the IAM role associated with the group. If a group has the highest priority of a user's groups, users who authenticate with an identity pool get credentials for the "RoleArn" that's associated with the group. * **Precedence** *(integer) --* A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher ornull "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is "null". * **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. * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_users_in_group list_users_in_group ******************* CognitoIdentityProvider.Client.list_users_in_group(**kwargs) Given a user pool ID and a group name, returns a list of users in the group. For more information about user pool groups, see Adding groups to a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_users_in_group( UserPoolId='string', GroupName='string', Limit=123, NextToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to view the membership of the requested group. * **GroupName** (*string*) -- **[REQUIRED]** The name of the group that you want to query for user membership. * **Limit** (*integer*) -- The maximum number of groups that you want Amazon Cognito to return in the response. * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'Users': [ { 'Username': 'string', 'Attributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'UserCreateDate': datetime(2015, 1, 1), 'UserLastModifiedDate': datetime(2015, 1, 1), 'Enabled': True|False, 'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD'|'EXTERNAL_PROVIDER', 'MFAOptions': [ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Users** *(list) --* An array of users who are members in the group, and their attributes. * *(dict) --* A user profile in a Amazon Cognito user pool. * **Username** *(string) --* The user's username. * **Attributes** *(list) --* Names and values of a user's attributes, for example "email". * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **UserCreateDate** *(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. * **UserLastModifiedDate** *(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. * **Enabled** *(boolean) --* Indicates whether the user's account is enabled or disabled. * **UserStatus** *(string) --* The user status. This can be one of the following: * "UNCONFIRMED": User has been created but not confirmed. * "CONFIRMED": User has been confirmed. * "EXTERNAL_PROVIDER": User signed in with a third-party IdP. * "RESET_REQUIRED": User is confirmed, but the user must request a code and reset their password before they can sign in. * "FORCE_CHANGE_PASSWORD": The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change their password to a new value before doing anything else. The statuses "ARCHIVED", "UNKNOWN", and "COMPROMISED" are no longer used. * **MFAOptions** *(list) --* The user's MFA configuration. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_web_authn_credentials list_web_authn_credentials ************************** CognitoIdentityProvider.Client.list_web_authn_credentials(**kwargs) Generates a list of the currently signed-in user's registered passkey, or WebAuthn, credentials. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.list_web_authn_credentials( AccessToken='string', NextToken='string', MaxResults=123 ) Parameters: * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. * **MaxResults** (*integer*) -- The maximum number of the user's passkey credentials that you want to return. Return type: 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. * **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) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" CognitoIdentityProvider / Client / delete_identity_provider delete_identity_provider ************************ CognitoIdentityProvider.Client.delete_identity_provider(**kwargs) Deletes a user pool identity provider (IdP). After you delete an IdP, users can no longer sign in to your user pool through that IdP. For more information about user pool IdPs, see Third-party IdP sign-in. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.delete_identity_provider( UserPoolId='string', ProviderName='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete the identity provider. * **ProviderName** (*string*) -- **[REQUIRED]** The name of the IdP that you want to delete. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnsupportedIdentityPr oviderException" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / get_csv_header get_csv_header ************** CognitoIdentityProvider.Client.get_csv_header(**kwargs) Given a user pool ID, generates a comma-separated value (CSV) list populated with available user attributes in the user pool. This list is the header for the CSV file that determines the users in a user import job. Save the content of "CSVHeader" in the response as a ".csv" file and populate it with the usernames and attributes of users that you want to import. For more information about CSV user import, see Importing users from a CSV file. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.get_csv_header( UserPoolId='string' ) Parameters: **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that you want to import users into. Return type: dict Returns: **Response Syntax** { 'UserPoolId': 'string', 'CSVHeader': [ 'string', ] } **Response Structure** * *(dict) --* Represents the response from the server to the request to get the header information of the CSV file for the user import job. * **UserPoolId** *(string) --* The ID of the requested user pool. * **CSVHeader** *(list) --* A comma-separated list of attributes from your user pool. Save this output to a ".csv" file and populate it with the attributes of the users that you want to import. * *(string) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_user_pool_domain describe_user_pool_domain ************************* CognitoIdentityProvider.Client.describe_user_pool_domain(**kwargs) Given a user pool domain name, returns information about the domain configuration. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.describe_user_pool_domain( Domain='string' ) Parameters: **Domain** (*string*) -- **[REQUIRED]** The domain that you want to describe. 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". Return type: 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) --* The details of the requested user pool 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". **Exceptions** * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / create_resource_server create_resource_server ********************** CognitoIdentityProvider.Client.create_resource_server(**kwargs) Creates a new OAuth2.0 resource server and defines custom scopes within it. Resource servers are associated with custom scopes and machine-to-machine (M2M) authorization. For more information, see Access control with resource servers. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.create_resource_server( UserPoolId='string', Identifier='string', Name='string', Scopes=[ { 'ScopeName': 'string', 'ScopeDescription': 'string' }, ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to create a resource server. * **Identifier** (*string*) -- **[REQUIRED]** A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system- data". You can also set an API URL like "https://solar-system- data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope- identifier strings increase the size of your access tokens. * **Name** (*string*) -- **[REQUIRED]** A friendly name for the resource server. * **Scopes** (*list*) -- A list of custom scopes. Each scope is a key-value map with the keys "ScopeName" and "ScopeDescription". The name of a custom scope is a combination of "ScopeName" and the resource server "Name" in this request, for example "MyResourceServerName/MyScopeName". * *(dict) --* One custom scope associated with a user pool resource server. This data type is a member of "ResourceServerScopeType". For more information, see Scopes, M2M, and API authorization with resource servers. * **ScopeName** *(string) --* **[REQUIRED]** The name of the scope. Amazon Cognito renders custom scopes in the format "resourceServerIdentifier/ScopeName". For example, if this parameter is "exampleScope" in the resource server with the identifier "exampleResourceServer", you request and receive the scope "exampleResourceServer/exampleScope". * **ScopeDescription** *(string) --* **[REQUIRED]** A friendly description of a custom scope. Return type: dict Returns: **Response Syntax** { 'ResourceServer': { 'UserPoolId': 'string', 'Identifier': 'string', 'Name': 'string', 'Scopes': [ { 'ScopeName': 'string', 'ScopeDescription': 'string' }, ] } } **Response Structure** * *(dict) --* * **ResourceServer** *(dict) --* The details of the new resource server. * **UserPoolId** *(string) --* The ID of the user pool that contains the resource server configuration. * **Identifier** *(string) --* A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system-data". You can also set an API URL like "https://solar-system-data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope-identifier strings increase the size of your access tokens. * **Name** *(string) --* The name of the resource server. * **Scopes** *(list) --* A list of scopes that are defined for the resource server. * *(dict) --* One custom scope associated with a user pool resource server. This data type is a member of "ResourceServerScopeType". For more information, see Scopes, M2M, and API authorization with resource servers. * **ScopeName** *(string) --* The name of the scope. Amazon Cognito renders custom scopes in the format "resourceServerIdentifier/ScopeName". For example, if this parameter is "exampleScope" in the resource server with the identifier "exampleResourceServer", you request and receive the scope "exampleResourceServer/exampleScope". * **ScopeDescription** *(string) --* A friendly description of a custom scope. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_user_pool_clients list_user_pool_clients ********************** CognitoIdentityProvider.Client.list_user_pool_clients(**kwargs) Given a user pool ID, lists app clients. App clients are sets of rules for the access that you want a user pool to grant to one application. For more information, see App clients. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_user_pool_clients( UserPoolId='string', MaxResults=123, NextToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list user pool clients. * **MaxResults** (*integer*) -- The maximum number of app clients that you want Amazon Cognito to return in the response. * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'UserPoolClients': [ { 'ClientId': 'string', 'UserPoolId': 'string', 'ClientName': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* Represents the response from the server that lists user pool clients. * **UserPoolClients** *(list) --* An array of app clients and their details. Includes app client ID and name. * *(dict) --* A short description of a user pool app client. * **ClientId** *(string) --* The app client ID. * **UserPoolId** *(string) --* The ID of the user pool that's associated with the app client. * **ClientName** *(string) --* The app client name. * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / list_resource_servers list_resource_servers ********************* CognitoIdentityProvider.Client.list_resource_servers(**kwargs) Given a user pool ID, returns all resource servers and their details. For more information about resource servers, see Access control with resource servers. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.list_resource_servers( UserPoolId='string', MaxResults=123, NextToken='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to list resource servers. * **MaxResults** (*integer*) -- The maximum number of resource servers that you want Amazon Cognito to return in the response. * **NextToken** (*string*) -- This API operation returns a limited number of results. The pagination token is an identifier that you can present in an additional API request with the same parameters. When you include the pagination token, Amazon Cognito returns the next set of items after the current list. Subsequent requests return a new pagination token. By use of this token, you can paginate through the full list of items. Return type: dict Returns: **Response Syntax** { 'ResourceServers': [ { 'UserPoolId': 'string', 'Identifier': 'string', 'Name': 'string', 'Scopes': [ { 'ScopeName': 'string', 'ScopeDescription': 'string' }, ] }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **ResourceServers** *(list) --* An array of resource servers and the details of their configuration. For each, the response includes names, identifiers, and custom scopes. * *(dict) --* The details of a resource server configuration and associated custom scopes in a user pool. * **UserPoolId** *(string) --* The ID of the user pool that contains the resource server configuration. * **Identifier** *(string) --* A unique resource server identifier for the resource server. The identifier can be an API friendly name like "solar-system-data". You can also set an API URL like "https://solar-system-data-api.example.com" as your identifier. Amazon Cognito represents scopes in the access token in the format "$resource-server-identifier/$scope". Longer scope-identifier strings increase the size of your access tokens. * **Name** *(string) --* The name of the resource server. * **Scopes** *(list) --* A list of scopes that are defined for the resource server. * *(dict) --* One custom scope associated with a user pool resource server. This data type is a member of "ResourceServerScopeType". For more information, see Scopes, M2M, and API authorization with resource servers. * **ScopeName** *(string) --* The name of the scope. Amazon Cognito renders custom scopes in the format "resourceServerIdentifier/ScopeName". For example, if this parameter is "exampleScope" in the resource server with the identifier "exampleResourceServer", you request and receive the scope "exampleResourceServer/exampleScope". * **ScopeDescription** *(string) --* A friendly description of a custom scope. * **NextToken** *(string) --* The identifier that Amazon Cognito returned with the previous request to this operation. When you include a pagination token in your request, Amazon Cognito returns the next set of items in the list. By use of this token, you can paginate through the full list of items. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_get_device admin_get_device **************** CognitoIdentityProvider.Client.admin_get_device(**kwargs) Given the device key, returns details for a user's device. For more information, see Working with devices. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_get_device( DeviceKey='string', UserPoolId='string', Username='string' ) Parameters: * **DeviceKey** (*string*) -- **[REQUIRED]** The key of the device that you want to delete. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where the device owner is a user. * **Username** (*string*) -- **[REQUIRED]** The name 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. Return type: dict Returns: **Response Syntax** { 'Device': { 'DeviceKey': 'string', 'DeviceAttributes': [ { 'Name': 'string', 'Value': 'string' }, ], 'DeviceCreateDate': datetime(2015, 1, 1), 'DeviceLastModifiedDate': datetime(2015, 1, 1), 'DeviceLastAuthenticatedDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* Gets the device response, as an administrator. * **Device** *(dict) --* Details of the requested device. Includes device information, last-accessed and created dates, and the device key. * **DeviceKey** *(string) --* The device key, for example "us-west-2_EXAMPLE- a1b2c3d4-5678-90ab-cdef-EXAMPLE22222". * **DeviceAttributes** *(list) --* Metadata about a user's device, like name and last-access source IP. * *(dict) --* The name and value of a user attribute. * **Name** *(string) --* The name of the attribute. * **Value** *(string) --* The value of the attribute. * **DeviceCreateDate** *(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. * **DeviceLastModifiedDate** *(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. * **DeviceLastAuthenticatedDate** *(datetime) --* The date when the user last signed in with the device. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfig urationException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" CognitoIdentityProvider / Client / update_group update_group ************ CognitoIdentityProvider.Client.update_group(**kwargs) Given the name of a user pool group, updates any of the properties for precedence, IAM role, or description. For more information about user pool groups, see Adding groups to a user pool. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.update_group( GroupName='string', UserPoolId='string', Description='string', RoleArn='string', Precedence=123 ) Parameters: * **GroupName** (*string*) -- **[REQUIRED]** The name of the group that you want to update. * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the group you want to update. * **Description** (*string*) -- A new description of the existing group. * **RoleArn** (*string*) -- The Amazon Resource Name (ARN) of an IAM role that you want to associate with the group. The role assignment contributes to the "cognito:roles" and "cognito:preferred_role" claims in group members' tokens. * **Precedence** (*integer*) -- A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher or null "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is null. The maximum "Precedence" value is "2^31-1". Return type: dict Returns: **Response Syntax** { 'Group': { 'GroupName': 'string', 'UserPoolId': 'string', 'Description': 'string', 'RoleArn': 'string', 'Precedence': 123, 'LastModifiedDate': datetime(2015, 1, 1), 'CreationDate': datetime(2015, 1, 1) } } **Response Structure** * *(dict) --* * **Group** *(dict) --* Contains the updated details of the group, including precedence, IAM role, and description. * **GroupName** *(string) --* The name of the group. * **UserPoolId** *(string) --* The ID of the user pool that contains the group. * **Description** *(string) --* A friendly description of the group. * **RoleArn** *(string) --* The ARN of the IAM role associated with the group. If a group has the highest priority of a user's groups, users who authenticate with an identity pool get credentials for the "RoleArn" that's associated with the group. * **Precedence** *(integer) --* A non-negative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower "Precedence" values take precedence over groups with higher ornull "Precedence" values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN is given in the user's tokens for the "cognito:roles" and "cognito:preferred_role" claims. Two groups can have the same "Precedence" value. If this happens, neither group takes precedence over the other. If two groups with the same "Precedence" have the same role ARN, that role is used in the "cognito:preferred_role" claim in tokens for users in each group. If the two groups have different role ARNs, the "cognito:preferred_role" claim isn't set in users' tokens. The default "Precedence" value is "null". * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / update_user_pool update_user_pool **************** CognitoIdentityProvider.Client.update_user_pool(**kwargs) Updates the configuration of a user pool. To avoid setting parameters to Amazon Cognito defaults, construct this API request to pass the existing configuration of your user pool, modified to include the changes that you want to make. Warning: If you don't provide a value for an attribute, Amazon Cognito sets it to its default value. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.update_user_pool( UserPoolId='string', Policies={ 'PasswordPolicy': { 'MinimumLength': 123, 'RequireUppercase': True|False, 'RequireLowercase': True|False, 'RequireNumbers': True|False, 'RequireSymbols': True|False, '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'|'V3_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' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool you want to update. * **Policies** (*dict*) -- The password policy and sign-in policy in the user pool. The password policy sets options like password complexity requirements and password history. The sign-in policy sets the options available to applications in choice-based authentication. * **PasswordPolicy** *(dict) --* The password policy settings for a user pool, including complexity, history, and length requirements. * **MinimumLength** *(integer) --* The minimum length of the password in the policy that you have set. This value can't be less than 6. * **RequireUppercase** *(boolean) --* The requirement in a password policy that users must include at least one uppercase letter in their password. * **RequireLowercase** *(boolean) --* The requirement in a password policy that users must include at least one lowercase letter in their password. * **RequireNumbers** *(boolean) --* The requirement in a password policy that users must include at least one number in their password. * **RequireSymbols** *(boolean) --* The requirement in a password policy that users must include at least one symbol in their password. * **PasswordHistorySize** *(integer) --* The number of previous passwords that you want Amazon Cognito to restrict each user from reusing. Users can't set a password that matches any of "n" previous passwords, where "n" is the value of "PasswordHistorySize". * **TemporaryPasswordValidityDays** *(integer) --* The number of days a temporary password is valid in the password policy. If the user doesn't sign in during this time, an administrator must reset their password. Defaults to "7". If you submit a value of "0", Amazon Cognito treats it as a null value and sets "TemporaryPasswordValidityDays" to its default value. Note: When you set "TemporaryPasswordValidityDays" for a user pool, you can no longer set a value for the legacy "UnusedAccountValidityDays" parameter in that user pool. * **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 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. * **AutoVerifiedAttributes** (*list*) -- The attributes that you want your user pool to automatically verify. Possible values: **email**, **phone_number**. For more information see Verifying contact information at sign-up. * *(string) --* * **SmsVerificationMessage** (*string*) -- This parameter is no longer used. * **EmailVerificationMessage** (*string*) -- This parameter is no longer used. * **EmailVerificationSubject** (*string*) -- This parameter is no longer used. * **VerificationMessageTemplate** (*dict*) -- The template for the verification message that your user pool delivers to users who set an email address or phone number attribute. 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 "{####}". * **SmsAuthenticationMessage** (*string*) -- The contents of the SMS message that your user pool sends to users in SMS authentication. * **UserAttributeUpdateSettings** (*dict*) -- The settings for updates to user attributes. These settings include the property "AttributesRequireVerificationBeforeUpdate", a user-pool setting that tells Amazon Cognito how to handle changes to the value of your users' email address and phone number attributes. For more information, see Verifying updates to email addresses and phone numbers. * **AttributesRequireVerificationBeforeUpdate** *(list) --* Requires that your user verifies their email address, phone number, or both before Amazon Cognito updates the value of that attribute. When you update a user attribute that has this option activated, Amazon Cognito sends a verification message to the new phone number or email address. Amazon Cognito doesn’t change the value of the attribute until your user responds to the verification message and confirms the new value. When "AttributesRequireVerificationBeforeUpdate" is false, your user pool doesn't require that your users verify attribute changes before Amazon Cognito updates them. In a user pool where "AttributesRequireVerificationBeforeUpdate" is false, API operations that change attribute values can immediately update a user’s "email" or "phone_number" attribute. * *(string) --* * **MfaConfiguration** (*string*) -- Sets multi-factor authentication (MFA) to be on, off, or optional. When "ON", all users must set up MFA before they can sign in. When "OPTIONAL", your application must make a client- side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, choose "OPTIONAL". When "MfaConfiguration" is "OPTIONAL", managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor. * **DeviceConfiguration** (*dict*) -- The device-remembering configuration for a user pool. Device remembering or device tracking is a "Remember me on this device" option for user pools that perform authentication with the device key of a trusted device in the back end, instead of a user-provided MFA code. For more information about device authentication, see Working with user devices in your user pool. A null value indicates that you have deactivated device remembering in your user pool. Note: When you provide a value for any "DeviceConfiguration" field, you activate the Amazon Cognito device-remembering feature. For more information, see Working with devices. * **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). Note: Whether or not "ChallengeRequiredOnNewDevice" is true, users who sign in with devices that have not been confirmed or remembered must still provide a second factor in a user pool that requires 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. * **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 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 ". 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*) -- The SMS configuration with the settings for your Amazon Cognito user pool to send SMS message with Amazon Simple Notification Service. To send SMS messages with Amazon SNS in the Amazon Web Services Region that you want, the Amazon Cognito user pool uses an Identity and Access Management (IAM) role in your Amazon Web Services account. For more information see SMS message settings. * **SnsCallerArn** *(string) --* **[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. * **UserPoolTags** (*dict*) -- 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) --* * **AdminCreateUserConfig** (*dict*) -- The configuration for administrative creation of users. Includes the template for the invitation message for new users, the duration of temporary passwords, and permitting self-service sign-up. * **AllowAdminCreateUserOnly** *(boolean) --* The setting for allowing self-service sign-up. When "true", only administrators can create new user profiles. When "false", users can register themselves and create a new user profile with the "SignUp" operation. * **UnusedAccountValidityDays** *(integer) --* This parameter is no longer in use. The password expiration limit in days for administrator- created users. When this time expires, the user can't sign in with their temporary password. To reset the account after that time limit, you must call "AdminCreateUser" again, specifying "RESEND" for the "MessageAction" parameter. The default value for this parameter is 7. * **InviteMessageTemplate** *(dict) --* The template for the welcome message to new users. This template must include the "{####}" temporary password placeholder if you are creating users with passwords. If your users don't have passwords, you can omit the placeholder. See also Customizing User Invitation Messages. * **SMSMessage** *(string) --* The message template for SMS messages. * **EmailMessage** *(string) --* The message template for email messages. EmailMessage is allowed only if EmailSendingAccount is DEVELOPER. * **EmailSubject** *(string) --* The subject line for email messages. EmailSubject is allowed only if EmailSendingAccount is DEVELOPER. * **UserPoolAddOns** (*dict*) -- Contains settings for activation of threat protection, including the operating mode and additional authentication types. To log user security information but take no action, set to "AUDIT". To configure automatic security responses to potentially unwanted traffic to your user pool, set to "ENFORCED". For more information, see Adding advanced security to a user pool. To activate this setting, your user pool must be on the Plus tier. * **AdvancedSecurityMode** *(string) --* **[REQUIRED]** The operating mode of threat protection for standard authentication types in your user pool, including username- password and secure remote password (SRP) authentication. * **AdvancedSecurityAdditionalFlows** *(dict) --* Threat protection configuration options for additional authentication types in your user pool, including custom authentication. * **CustomAuthMode** *(string) --* The operating mode of threat protection in custom authentication with Custom authentication challenge Lambda triggers. * **AccountRecoverySetting** (*dict*) -- The available verified method a user can use to recover their password when they call "ForgotPassword". You can use this setting to define a preferred method when a user has more than one method available. With this setting, SMS doesn't qualify for a valid password recovery mechanism if the user also has SMS multi-factor authentication (MFA) activated. In the absence of this setting, Amazon Cognito uses the legacy behavior to determine the recovery method where SMS is preferred through email. * **RecoveryMechanisms** *(list) --* The list of options and priorities for user message delivery in forgot-password operations. Sets or displays user pool preferences for email or SMS message priority, whether users should fall back to a second delivery method, and whether passwords should only be reset by administrators. * *(dict) --* A recovery option for a user. The "AccountRecoverySettingType" data type is an array of this object. Each "RecoveryOptionType" has a priority property that determines whether it is a primary or secondary option. For example, if "verified_email" has a priority of "1" and "verified_phone_number" has a priority of "2", your user pool sends account-recovery messages to a verified email address but falls back to an SMS message if the user has a verified phone number. The "admin_only" option prevents self-service account recovery. * **Priority** *(integer) --* **[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. * **PoolName** (*string*) -- The updated name of your user pool. * **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". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server when you make a request to update the user pool. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserImportInProgressE xception" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.UserPoolTaggingExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.TierChangeNotAllowedE xception" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / update_auth_event_feedback update_auth_event_feedback ************************** CognitoIdentityProvider.Client.update_auth_event_feedback(**kwargs) Provides the feedback for an authentication event generated by threat protection features. The user's response indicates that you think that the event either was from a valid user or was an unwanted authentication attempt. This feedback improves the risk evaluation decision for the user pool as part of Amazon Cognito threat protection. To activate this setting, your user pool must be on the Plus tier. This operation requires a "FeedbackToken" that Amazon Cognito generates and adds to notification emails when users have potentially suspicious authentication events. Users invoke this operation when they select the link that corresponds to "{one- click-link-valid}" or "{one-click-link-invalid}" in your notification template. Because "FeedbackToken" is a required parameter, you can' make requests to "UpdateAuthEventFeedback" without the contents of the notification email message. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.update_auth_event_feedback( UserPoolId='string', Username='string', EventId='string', FeedbackToken='string', FeedbackValue='Valid'|'Invalid' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to update auth event feedback. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **EventId** (*string*) -- **[REQUIRED]** The ID of the authentication event that you want to submit feedback for. * **FeedbackToken** (*string*) -- **[REQUIRED]** The feedback token, an encrypted object generated by Amazon Cognito and passed to your user in the notification email message from the event. * **FeedbackValue** (*string*) -- **[REQUIRED]** Your feedback to the authentication event. When you provide a "FeedbackValue" value of "valid", you tell Amazon Cognito that you trust a user session where Amazon Cognito has evaluated some level of risk. When you provide a "FeedbackValue" value of "invalid", you tell Amazon Cognito that you don't trust a user session, or you don't believe that Amazon Cognito evaluated a high-enough risk level. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserPoolAddOnNotEnabl edException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_user_global_sign_out admin_user_global_sign_out ************************** CognitoIdentityProvider.Client.admin_user_global_sign_out(**kwargs) Invalidates the identity, access, and refresh tokens that Amazon Cognito issued to a user. Call this operation with your administrative credentials when your user signs out of your app. This results in the following behavior. * Amazon Cognito no longer accepts *token-authorized* user operations that you authorize with a signed-out user's access tokens. For more information, see Using the Amazon Cognito user pools API and user pool endpoints. Amazon Cognito returns an "Access Token has been revoked" error when your app attempts to authorize a user pools API request with a revoked access token that contains the scope "aws.cognito.signin.user.admin". * Amazon Cognito no longer accepts a signed-out user's ID token in a GetId request to an identity pool with "ServerSideTokenCheck" enabled for its user pool IdP configuration in CognitoIdentityProvider. * Amazon Cognito no longer accepts a signed-out user's refresh tokens in refresh requests. Other requests might be valid until your user's token expires. This operation doesn't clear the managed login session cookie. To clear the session for a user who signed in with managed login or the classic hosted UI, direct their browser session to the logout endpoint. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_user_global_sign_out( UserPoolId='string', Username='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to sign out a user. * **Username** (*string*) -- **[REQUIRED]** The name 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. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* The global sign-out response, as an administrator. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_set_user_settings admin_set_user_settings *********************** CognitoIdentityProvider.Client.admin_set_user_settings(**kwargs) *This action is no longer supported.* You can use it to configure only SMS MFA. You can't use it to configure time-based one-time password (TOTP) software token MFA. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_set_user_settings( UserPoolId='string', Username='string', MFAOptions=[ { 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' }, ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the user whose options you're setting. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **MFAOptions** (*list*) -- **[REQUIRED]** You can use this parameter only to set an SMS configuration that uses SMS for delivery. * *(dict) --* *This data type is no longer supported.* Applies only to SMS multi-factor authentication (MFA) configurations. Does not apply to time-based one-time password (TOTP) software token MFA configurations. * **DeliveryMedium** *(string) --* The delivery medium to send the MFA code. You can use this parameter to set only the "SMS" delivery medium value. * **AttributeName** *(string) --* The attribute name of the MFA option type. The only valid value is "phone_number". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server to set user settings as an administrator. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / set_log_delivery_configuration set_log_delivery_configuration ****************************** CognitoIdentityProvider.Client.set_log_delivery_configuration(**kwargs) Sets up or modifies the logging configuration of a user pool. User pools can export user notification logs and, when threat protection is active, user-activity logs. For more information, see Exporting user pool logs. See also: AWS API Documentation **Request Syntax** response = client.set_log_delivery_configuration( UserPoolId='string', LogConfigurations=[ { 'LogLevel': 'ERROR'|'INFO', 'EventSource': 'userNotification'|'userAuthEvents', 'CloudWatchLogsConfiguration': { 'LogGroupArn': 'string' }, 'S3Configuration': { 'BucketArn': 'string' }, 'FirehoseConfiguration': { 'StreamArn': 'string' } }, ] ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to configure logging. * **LogConfigurations** (*list*) -- **[REQUIRED]** A collection of the logging configurations for a user pool. * *(dict) --* The configuration of user event logs to an external Amazon Web Services service like Amazon Data Firehose, Amazon S3, or Amazon CloudWatch Logs. * **LogLevel** *(string) --* **[REQUIRED]** The "errorlevel" selection of logs that a user pool sends for detailed activity logging. To send "userNotification" activity with information about message delivery, choose "ERROR" with "CloudWatchLogsConfiguration". To send "userAuthEvents" activity with user logs from threat protection with the Plus feature plan, choose "INFO" with one of "CloudWatchLogsConfiguration", "FirehoseConfiguration", or "S3Configuration". * **EventSource** *(string) --* **[REQUIRED]** The source of events that your user pool sends for logging. To send error-level logs about user notification activity, set to "userNotification". To send info-level logs about threat-protection user activity in user pools with the Plus feature plan, set to "userAuthEvents". * **CloudWatchLogsConfiguration** *(dict) --* The CloudWatch log group destination of user pool detailed activity logs, or of user activity log export with threat protection. * **LogGroupArn** *(string) --* The Amazon Resource Name (arn) of a CloudWatch Logs log group where your user pool sends logs. The log group must not be encrypted with Key Management Service and must be in the same Amazon Web Services account as your user pool. To send logs to log groups with a resource policy of a size greater than 5120 characters, configure a log group with a path that starts with "/aws/vendedlogs". For more information, see Enabling logging from certain Amazon Web Services services. * **S3Configuration** *(dict) --* The Amazon S3 bucket destination of user activity log export with threat protection. To activate this setting, your user pool must be on the Plus tier. * **BucketArn** *(string) --* The ARN of an Amazon S3 bucket that's the destination for threat protection log export. * **FirehoseConfiguration** *(dict) --* The Amazon Data Firehose stream destination of user activity log export with threat protection. To activate this setting, your user pool must be on the Plus tier. * **StreamArn** *(string) --* The ARN of an Amazon Data Firehose stream that's the destination for threat protection log export. Return type: dict Returns: **Response Syntax** { 'LogDeliveryConfiguration': { 'UserPoolId': 'string', 'LogConfigurations': [ { 'LogLevel': 'ERROR'|'INFO', 'EventSource': 'userNotification'|'userAuthEvents', 'CloudWatchLogsConfiguration': { 'LogGroupArn': 'string' }, 'S3Configuration': { 'BucketArn': 'string' }, 'FirehoseConfiguration': { 'StreamArn': 'string' } }, ] } } **Response Structure** * *(dict) --* * **LogDeliveryConfiguration** *(dict) --* The logging configuration that you applied to the requested user pool. * **UserPoolId** *(string) --* The ID of the user pool where you configured logging. * **LogConfigurations** *(list) --* A logging destination of a user pool. User pools can have multiple logging destinations for message-delivery and user-activity logs. * *(dict) --* The configuration of user event logs to an external Amazon Web Services service like Amazon Data Firehose, Amazon S3, or Amazon CloudWatch Logs. * **LogLevel** *(string) --* The "errorlevel" selection of logs that a user pool sends for detailed activity logging. To send "userNotification" activity with information about message delivery, choose "ERROR" with "CloudWatchLogsConfiguration". To send "userAuthEvents" activity with user logs from threat protection with the Plus feature plan, choose "INFO" with one of "CloudWatchLogsConfiguration", "FirehoseConfiguration", or "S3Configuration". * **EventSource** *(string) --* The source of events that your user pool sends for logging. To send error-level logs about user notification activity, set to "userNotification". To send info-level logs about threat-protection user activity in user pools with the Plus feature plan, set to "userAuthEvents". * **CloudWatchLogsConfiguration** *(dict) --* The CloudWatch log group destination of user pool detailed activity logs, or of user activity log export with threat protection. * **LogGroupArn** *(string) --* The Amazon Resource Name (arn) of a CloudWatch Logs log group where your user pool sends logs. The log group must not be encrypted with Key Management Service and must be in the same Amazon Web Services account as your user pool. To send logs to log groups with a resource policy of a size greater than 5120 characters, configure a log group with a path that starts with "/aws/vendedlogs". For more information, see Enabling logging from certain Amazon Web Services services. * **S3Configuration** *(dict) --* The Amazon S3 bucket destination of user activity log export with threat protection. To activate this setting, your user pool must be on the Plus tier. * **BucketArn** *(string) --* The ARN of an Amazon S3 bucket that's the destination for threat protection log export. * **FirehoseConfiguration** *(dict) --* The Amazon Data Firehose stream destination of user activity log export with threat protection. To activate this setting, your user pool must be on the Plus tier. * **StreamArn** *(string) --* The ARN of an Amazon Data Firehose stream that's the destination for threat protection log export. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / delete_resource_server delete_resource_server ********************** CognitoIdentityProvider.Client.delete_resource_server(**kwargs) Deletes a resource server. After you delete a resource server, users can no longer generate access tokens with scopes that are associate with that resource server. Resource servers are associated with custom scopes and machine-to- machine (M2M) authorization. For more information, see Access control with resource servers. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.delete_resource_server( UserPoolId='string', Identifier='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete the resource server. * **Identifier** (*string*) -- **[REQUIRED]** The identifier of the resource server that you want to delete. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / tag_resource tag_resource ************ CognitoIdentityProvider.Client.tag_resource(**kwargs) Assigns a set of tags to an Amazon Cognito 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. Each tag consists of a key and value, both of which you define. A key is a general category for more specific values. For example, if you have two versions of a user pool, one for testing and another for production, you might assign an "Environment" tag key to both user pools. The value of this key might be "Test" for one user pool, and "Production" for the other. Tags are useful for cost tracking and access control. You can activate your tags so that they appear on the Billing and Cost Management console, where you can track the costs associated with your user pools. In an Identity and Access Management policy, you can constrain permissions for user pools based on specific tags or tag values. You can use this action up to 5 times per second, per account. A user pool can have as many as 50 tags. See also: AWS API Documentation **Request Syntax** response = client.tag_resource( ResourceArn='string', Tags={ 'string': 'string' } ) Parameters: * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the user pool to assign the tags to. * **Tags** (*dict*) -- **[REQUIRED]** An array of tag keys and values that you want to assign to the user pool. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / describe_user_import_job describe_user_import_job ************************ CognitoIdentityProvider.Client.describe_user_import_job(**kwargs) Describes a user import job. For more information about user CSV import, see Importing users from a CSV file. See also: AWS API Documentation **Request Syntax** response = client.describe_user_import_job( UserPoolId='string', JobId='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that's associated with the import job. * **JobId** (*string*) -- **[REQUIRED]** The Id of the user import job that you want to describe. Return type: dict Returns: **Response Syntax** { 'UserImportJob': { 'JobName': 'string', 'JobId': 'string', 'UserPoolId': 'string', 'PreSignedUrl': 'string', 'CreationDate': datetime(2015, 1, 1), 'StartDate': datetime(2015, 1, 1), 'CompletionDate': datetime(2015, 1, 1), 'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded', 'CloudWatchLogsRoleArn': 'string', 'ImportedUsers': 123, 'SkippedUsers': 123, 'FailedUsers': 123, 'CompletionMessage': 'string' } } **Response Structure** * *(dict) --* Represents the response from the server to the request to describe the user import job. * **UserImportJob** *(dict) --* The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload. * **JobName** *(string) --* The friendly name of the user import job. * **JobId** *(string) --* The ID of the user import job. * **UserPoolId** *(string) --* The ID of the user pool that the users are being imported into. * **PreSignedUrl** *(string) --* The pre-signed URL target for uploading the CSV file. * **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. * **StartDate** *(datetime) --* The date when the user import job was started. * **CompletionDate** *(datetime) --* The date when the user import job was completed. * **Status** *(string) --* The status of the user import job. One of the following: * "Created" - The job was created but not started. * "Pending" - A transition state. You have started the job, but it has not begun importing users yet. * "InProgress" - The job has started, and users are being imported. * "Stopping" - You have stopped the job, but the job has not stopped importing users yet. * "Stopped" - You have stopped the job, and the job has stopped importing users. * "Succeeded" - The job has completed successfully. * "Failed" - The job has stopped due to an error. * "Expired" - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job can't be started. * **CloudWatchLogsRoleArn** *(string) --* The role Amazon Resource Name (ARN) for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide. * **ImportedUsers** *(integer) --* The number of users that were successfully imported. * **SkippedUsers** *(integer) --* The number of users that were skipped. * **FailedUsers** *(integer) --* The number of users that couldn't be imported. * **CompletionMessage** *(string) --* The message returned when the user import job is completed. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_reset_user_password admin_reset_user_password ************************* CognitoIdentityProvider.Client.admin_reset_user_password(**kwargs) Resets the specified user's password in a user pool. This operation doesn't change the user's password, but sends a password-reset code. To use this API operation, your user pool must have self-service account recovery configured. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_reset_user_password( UserPoolId='string', Username='string', ClientMetadata={ 'string': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to reset the user's password. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **ClientMetadata** (*dict*) -- 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. The "AdminResetUserPassword" API operation invokes the function that is assigned to the *custom message* 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 AdminResetUserPassword 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* Represents the response from the server to reset a user password as an administrator. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / resend_confirmation_code resend_confirmation_code ************************ CognitoIdentityProvider.Client.resend_confirmation_code(**kwargs) Resends the code that confirms a new account for a user who has signed up in your user pool. Amazon Cognito sends confirmation codes to the user attribute in the "AutoVerifiedAttributes" property of your user pool. When you prompt new users for the confirmation code, include a "Resend code" option that generates a call to this API operation. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = client.resend_confirmation_code( ClientId='string', SecretHash='string', UserContextData={ 'IpAddress': 'string', 'EncodedData': 'string' }, Username='string', AnalyticsMetadata={ 'AnalyticsEndpointId': 'string' }, ClientMetadata={ 'string': 'string' } ) Parameters: * **ClientId** (*string*) -- **[REQUIRED]** The ID of the user pool app client where the user signed up. * **SecretHash** (*string*) -- A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message. For more information about "SecretHash", see Computing secret hash values. * **UserContextData** (*dict*) -- Contextual data about your user session like the device fingerprint, IP address, or location. Amazon Cognito threat protection 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. For more information, see Collecting data for threat protection in applications. * **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. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **AnalyticsMetadata** (*dict*) -- Information that supports analytics outcomes with Amazon Pinpoint, including the user's endpoint ID. The endpoint ID is a destination for Amazon Pinpoint push notifications, for example a device identifier, email address, or phone number. * **AnalyticsEndpointId** *(string) --* The endpoint ID. Information that you want to pass to Amazon Pinpoint about where to send notifications. * **ClientMetadata** (*dict*) -- 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 ResendConfirmationCode API action, Amazon Cognito invokes the function that is assigned to the *custom message* 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 ResendConfirmationCode 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 Using Lambda triggers in the *Amazon Cognito Developer Guide*. Note: When you use the "ClientMetadata" parameter, note that Amazon Cognito won't do the following: * Store the "ClientMetadata" value. This data is available only to Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, the "ClientMetadata" parameter serves no purpose. * Validate the "ClientMetadata" value. * Encrypt the "ClientMetadata" value. Don't send sensitive information in this parameter. * *(string) --* * *(string) --* Return type: dict Returns: **Response Syntax** { 'CodeDeliveryDetails': { 'Destination': 'string', 'DeliveryMedium': 'SMS'|'EMAIL', 'AttributeName': 'string' } } **Response Structure** * *(dict) --* The response from the server when Amazon Cognito makes the request to resend a confirmation code. * **CodeDeliveryDetails** *(dict) --* Information about the phone number or email address that Amazon Cognito sent the confirmation code to. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnexpectedLambdaExcep tion" * "CognitoIdentityProvider.Client.exceptions.UserLambdaValidationE xception" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidLambdaResponse Exception" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.InvalidEmailRoleAcces sPolicyException" * "CognitoIdentityProvider.Client.exceptions.CodeDeliveryFailureEx ception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / set_user_mfa_preference set_user_mfa_preference *********************** CognitoIdentityProvider.Client.set_user_mfa_preference(**kwargs) Set the user's multi-factor authentication (MFA) method preference, including which MFA factors are activated and if any are preferred. Only one factor can be set as preferred. The preferred MFA factor will be used to authenticate a user if multiple factors are activated. If multiple options are activated and no preference is set, a challenge to choose an MFA option will be returned during sign-in. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts unless device tracking is turned on and the device has been trusted. If you want MFA to be applied selectively based on the assessed risk level of sign-in attempts, deactivate MFA for users and turn on Adaptive Authentication for the user pool. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.set_user_mfa_preference( SMSMfaSettings={ 'Enabled': True|False, 'PreferredMfa': True|False }, SoftwareTokenMfaSettings={ 'Enabled': True|False, 'PreferredMfa': True|False }, EmailMfaSettings={ 'Enabled': True|False, 'PreferredMfa': True|False }, AccessToken='string' ) Parameters: * **SMSMfaSettings** (*dict*) -- User preferences for SMS message MFA. Activates or deactivates SMS MFA and sets it as the preferred MFA method when multiple methods are available. * **Enabled** *(boolean) --* Specifies whether SMS message MFA is activated. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. * **PreferredMfa** *(boolean) --* Specifies whether SMS is the preferred MFA method. If true, your user pool prompts the specified user for a code delivered by SMS message after username-password sign-in succeeds. * **SoftwareTokenMfaSettings** (*dict*) -- User preferences for time-based one-time password (TOTP) MFA. Activates or deactivates TOTP MFA and sets it as the preferred MFA method when multiple methods are available. Users must register a TOTP authenticator before they set this as their preferred MFA method. * **Enabled** *(boolean) --* Specifies whether software token MFA is activated. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. * **PreferredMfa** *(boolean) --* Specifies whether software token MFA is the preferred MFA method. * **EmailMfaSettings** (*dict*) -- User preferences for email message MFA. Activates or deactivates email MFA and sets it as the preferred MFA method when multiple methods are available. To activate this setting, your user pool must be in the Essentials tier or higher. * **Enabled** *(boolean) --* Specifies whether email message MFA is active for a user. When the value of this parameter is "Enabled", the user will be prompted for MFA during all sign-in attempts, unless device tracking is turned on and the device has been trusted. * **PreferredMfa** *(boolean) --* Specifies whether email message MFA is the user's preferred method. * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / change_password change_password *************** CognitoIdentityProvider.Client.change_password(**kwargs) Changes the password 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". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.change_password( PreviousPassword='string', ProposedPassword='string', AccessToken='string' ) Parameters: * **PreviousPassword** (*string*) -- The user's previous password. Required if the user has a password. If the user has no password and only signs in with passwordless authentication options, you can omit this parameter. * **ProposedPassword** (*string*) -- **[REQUIRED]** A new password that you prompted the user to enter in your application. * **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the user whose password you want to change. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* The response from the server to the change password request. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidPasswordExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordHistoryPolicy ViolationException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.LimitExceededExceptio n" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / start_user_import_job start_user_import_job ********************* CognitoIdentityProvider.Client.start_user_import_job(**kwargs) Instructs your user pool to start importing users from a CSV file that contains their usernames and attributes. For more information about importing users from a CSV file, see Importing users from a CSV file. See also: AWS API Documentation **Request Syntax** response = client.start_user_import_job( UserPoolId='string', JobId='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that you want to start importing users into. * **JobId** (*string*) -- **[REQUIRED]** The ID of a user import job that you previously created. Return type: dict Returns: **Response Syntax** { 'UserImportJob': { 'JobName': 'string', 'JobId': 'string', 'UserPoolId': 'string', 'PreSignedUrl': 'string', 'CreationDate': datetime(2015, 1, 1), 'StartDate': datetime(2015, 1, 1), 'CompletionDate': datetime(2015, 1, 1), 'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded', 'CloudWatchLogsRoleArn': 'string', 'ImportedUsers': 123, 'SkippedUsers': 123, 'FailedUsers': 123, 'CompletionMessage': 'string' } } **Response Structure** * *(dict) --* Represents the response from the server to the request to start the user import job. * **UserImportJob** *(dict) --* The details of the user import job. Includes logging destination, status, and the Amazon S3 pre-signed URL for CSV upload. * **JobName** *(string) --* The friendly name of the user import job. * **JobId** *(string) --* The ID of the user import job. * **UserPoolId** *(string) --* The ID of the user pool that the users are being imported into. * **PreSignedUrl** *(string) --* The pre-signed URL target for uploading the CSV file. * **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. * **StartDate** *(datetime) --* The date when the user import job was started. * **CompletionDate** *(datetime) --* The date when the user import job was completed. * **Status** *(string) --* The status of the user import job. One of the following: * "Created" - The job was created but not started. * "Pending" - A transition state. You have started the job, but it has not begun importing users yet. * "InProgress" - The job has started, and users are being imported. * "Stopping" - You have stopped the job, but the job has not stopped importing users yet. * "Stopped" - You have stopped the job, and the job has stopped importing users. * "Succeeded" - The job has completed successfully. * "Failed" - The job has stopped due to an error. * "Expired" - You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job can't be started. * **CloudWatchLogsRoleArn** *(string) --* The role Amazon Resource Name (ARN) for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide. * **ImportedUsers** *(integer) --* The number of users that were successfully imported. * **SkippedUsers** *(integer) --* The number of users that were skipped. * **FailedUsers** *(integer) --* The number of users that couldn't be imported. * **CompletionMessage** *(string) --* The message returned when the user import job is completed. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.PreconditionNotMetExc eption" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" CognitoIdentityProvider / Client / global_sign_out global_sign_out *************** CognitoIdentityProvider.Client.global_sign_out(**kwargs) Invalidates the identity, access, and refresh tokens that Amazon Cognito issued to a user. Call this operation when your user signs out of your app. This results in the following behavior. * Amazon Cognito no longer accepts *token-authorized* user operations that you authorize with a signed-out user's access tokens. For more information, see Using the Amazon Cognito user pools API and user pool endpoints. Amazon Cognito returns an "Access Token has been revoked" error when your app attempts to authorize a user pools API request with a revoked access token that contains the scope "aws.cognito.signin.user.admin". * Amazon Cognito no longer accepts a signed-out user's ID token in a GetId request to an identity pool with "ServerSideTokenCheck" enabled for its user pool IdP configuration in CognitoIdentityProvider. * Amazon Cognito no longer accepts a signed-out user's refresh tokens in refresh requests. Other requests might be valid until your user's token expires. This operation doesn't clear the managed login session cookie. To clear the session for a user who signed in with managed login or the classic hosted UI, direct their browser session to the logout endpoint. Authorize this action with a signed-in user's access token. It must include the scope "aws.cognito.signin.user.admin". Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.global_sign_out( AccessToken='string' ) Parameters: **AccessToken** (*string*) -- **[REQUIRED]** A valid access token that Amazon Cognito issued to the currently signed-in user. Must include a scope claim for "aws.cognito.signin.user.admin". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* The response to the request to sign out all devices. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.PasswordResetRequired Exception" * "CognitoIdentityProvider.Client.exceptions.UserNotConfirmedExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / get_signing_certificate get_signing_certificate *********************** CognitoIdentityProvider.Client.get_signing_certificate(**kwargs) Given a user pool ID, returns the signing certificate for SAML 2.0 federation. Issued certificates are valid for 10 years from the date of issue. Amazon Cognito issues and assigns a new signing certificate annually. This renewal process returns a new value in the response to "GetSigningCertificate", but doesn't invalidate the original certificate. For more information, see Signing SAML requests. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.get_signing_certificate( UserPoolId='string' ) Parameters: **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to view the signing certificate. Return type: dict Returns: **Response Syntax** { 'Certificate': 'string' } **Response Structure** * *(dict) --* Response from Amazon Cognito for a signing certificate request. * **Certificate** *(string) --* The x.509 certificate that signs SAML 2.0 authentication requests for your user pool. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" CognitoIdentityProvider / Client / update_managed_login_branding update_managed_login_branding ***************************** CognitoIdentityProvider.Client.update_managed_login_branding(**kwargs) 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. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = 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' }, ] ) Parameters: * **UserPoolId** (*string*) -- The ID of the user pool that contains the managed login branding style that you want to update. * **ManagedLoginBrandingId** (*string*) -- The ID of the managed login branding style that you want to update. * **UseCognitoProvidedValues** (*boolean*) -- 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. * **Settings** (*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. * **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. Return type: 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 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. * **Settings** (*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. * **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. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / revoke_token revoke_token ************ CognitoIdentityProvider.Client.revoke_token(**kwargs) Revokes all of the access tokens generated by, and at the same time as, the specified refresh token. After a token is revoked, you can't use the revoked token to access Amazon Cognito user APIs, or to authorize access to your resource server. Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints. See also: AWS API Documentation **Request Syntax** response = client.revoke_token( Token='string', ClientId='string', ClientSecret='string' ) Parameters: * **Token** (*string*) -- **[REQUIRED]** The refresh token that you want to revoke. * **ClientId** (*string*) -- **[REQUIRED]** The ID of the app client where the token that you want to revoke was issued. * **ClientSecret** (*string*) -- The client secret of the requested app client, if the client has a secret. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.UnauthorizedException" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.UnsupportedOperationE xception" * "CognitoIdentityProvider.Client.exceptions.UnsupportedTokenTypeE xception" * "CognitoIdentityProvider.Client.exceptions.ForbiddenException" CognitoIdentityProvider / Client / admin_disable_provider_for_user admin_disable_provider_for_user ******************************* CognitoIdentityProvider.Client.admin_disable_provider_for_user(**kwargs) Prevents the user from signing in with the specified external (SAML or social) identity provider (IdP). If the user that you want to deactivate is a Amazon Cognito user pools native username + password user, they can't use their password to sign in. If the user to deactivate is a linked external IdP user, any link between that user and an existing user is removed. When the external user signs in again, and the user is no longer attached to the previously linked "DestinationUser", the user must create a new user account. The value of "ProviderName" must match the name of a user pool IdP. To deactivate a local user, set "ProviderName" to "Cognito" and the "ProviderAttributeName" to "Cognito_Subject". The "ProviderAttributeValue" must be user's local username. The "ProviderAttributeName" must always be "Cognito_Subject" for social IdPs. The "ProviderAttributeValue" must always be the exact subject that was used when the user was originally linked as a source user. For de-linking a SAML identity, there are two scenarios. If the linked identity has not yet been used to sign in, the "ProviderAttributeName" and "ProviderAttributeValue" must be the same values that were used for the "SourceUser" when the identities were originally linked using "AdminLinkProviderForUser" call. This is also true if the linking was done with "ProviderAttributeName" set to "Cognito_Subject". If the user has already signed in, the "ProviderAttributeName" must be "Cognito_Subject" and "ProviderAttributeValue" must be the "NameID" from their SAML assertion. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_disable_provider_for_user( UserPoolId='string', User={ 'ProviderName': 'string', 'ProviderAttributeName': 'string', 'ProviderAttributeValue': 'string' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete the user's linked identities. * **User** (*dict*) -- **[REQUIRED]** The user profile that you want to delete a linked identity from. * **ProviderName** *(string) --* The name of the provider, such as Facebook, Google, or Login with Amazon. * **ProviderAttributeName** *(string) --* The name of the provider attribute to link to, such as "NameID". * **ProviderAttributeValue** *(string) --* The value of the provider attribute to link to, such as "xxxxx_account". Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.AliasExistsException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / set_user_pool_mfa_config set_user_pool_mfa_config ************************ CognitoIdentityProvider.Client.set_user_pool_mfa_config(**kwargs) Sets user pool multi-factor authentication (MFA) and passkey configuration. For more information about user pool MFA, see Adding MFA. For more information about WebAuthn passkeys see Authentication flows. Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in.If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the *Amazon Cognito Developer Guide*. See also: AWS API Documentation **Request Syntax** response = 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' } ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The user pool ID. * **SmsMfaConfiguration** (*dict*) -- 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. * **SoftwareTokenMfaConfiguration** (*dict*) -- Configures a user pool for time-based one-time password (TOTP) MFA. Enables or disables TOTP. * **Enabled** *(boolean) --* The activation state of TOTP MFA. * **EmailMfaConfiguration** (*dict*) -- Sets configuration for user pool email message MFA and sign-in with one-time passwords (OTPs). Includes the subject and body of the email message template for sign-in and MFA messages. To activate this setting, your user pool must be in the Essentials tier or higher. * **Message** *(string) --* The template for the email messages that your user pool sends to users with codes for MFA and sign-in with email OTPs. 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 messages that your user pool sends to users with codes for MFA and email OTP sign-in. * **MfaConfiguration** (*string*) -- Sets multi-factor authentication (MFA) to be on, off, or optional. When "ON", all users must set up MFA before they can sign in. When "OPTIONAL", your application must make a client- side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, choose "OPTIONAL". When "MfaConfiguration" is "OPTIONAL", managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor. * **WebAuthnConfiguration** (*dict*) -- 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) --* When "required", users can only register and sign in users with passkeys that are capable of user verification. When "preferred", your user pool doesn't require the use of authenticators with user verification but encourages it. Return type: 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 and sign- in with SMS-message OTPs. 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 configuration for user pool email message MFA and sign-in with one-time passwords (OTPs). Includes the subject and body of the email message template for sign-in and MFA messages. To activate this setting, your user pool must be in the Essentials tier or higher. * **Message** *(string) --* The template for the email messages that your user pool sends to users with codes for MFA and sign-in with email OTPs. 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 messages that your user pool sends to users with codes for MFA and email OTP sign-in. * **MfaConfiguration** *(string) --* Displays multi-factor authentication (MFA) as on, off, or optional. When "ON", all users must set up MFA before they can sign in. When "OPTIONAL", your application must make a client-side determination of whether a user wants to register an MFA device. For user pools with adaptive authentication with threat protection, choose "OPTIONAL". When "MfaConfiguration" is "OPTIONAL", managed login doesn't automatically prompt users to set up MFA. Amazon Cognito generates MFA prompts in API responses and in managed login for users who have chosen and configured a preferred MFA factor. * **WebAuthnConfiguration** *(dict) --* The configuration of your user pool for passkey, or WebAuthn, sign-in with authenticators like biometric and security-key devices. Includes relying-party configuration and settings for user-verification requirements. * **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) --* When "required", users can only register and sign in users with passkeys that are capable of user verification. When "preferred", your user pool doesn't require the use of authenticators with user verification but encourages it. **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleAccessP olicyException" * "CognitoIdentityProvider.Client.exceptions.InvalidSmsRoleTrustRe lationshipException" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" * "CognitoIdentityProvider.Client.exceptions.FeatureUnavailableInT ierException" CognitoIdentityProvider / Client / delete_user_pool_domain delete_user_pool_domain *********************** CognitoIdentityProvider.Client.delete_user_pool_domain(**kwargs) Given a user pool ID and domain identifier, deletes a user pool domain. After you delete a user pool domain, your managed login pages and authorization server are no longer available. See also: AWS API Documentation **Request Syntax** response = client.delete_user_pool_domain( Domain='string', UserPoolId='string' ) Parameters: * **Domain** (*string*) -- **[REQUIRED]** The domain that you want to delete. For custom domains, this is the fully-qualified domain name like "auth.example.com". For Amazon Cognito prefix domains, this is the prefix alone, like "myprefix". * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool where you want to delete the domain. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ConcurrentModificatio nException" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n" CognitoIdentityProvider / Client / admin_add_user_to_group admin_add_user_to_group *********************** CognitoIdentityProvider.Client.admin_add_user_to_group(**kwargs) Adds a user to a group. A user who is in a group can present a preferred-role claim to an identity pool, and populates a "cognito:groups" claim to their access and identity tokens. Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.**Learn more** * Signing Amazon Web Services API Requests * Using the Amazon Cognito user pools API and user pool endpoints See also: AWS API Documentation **Request Syntax** response = client.admin_add_user_to_group( UserPoolId='string', Username='string', GroupName='string' ) Parameters: * **UserPoolId** (*string*) -- **[REQUIRED]** The ID of the user pool that contains the group that you want to add the user to. * **Username** (*string*) -- **[REQUIRED]** The name 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. * **GroupName** (*string*) -- **[REQUIRED]** The name of the group that you want to add your user to. Returns: None **Exceptions** * "CognitoIdentityProvider.Client.exceptions.InvalidParameterExcep tion" * "CognitoIdentityProvider.Client.exceptions.ResourceNotFoundExcep tion" * "CognitoIdentityProvider.Client.exceptions.TooManyRequestsExcept ion" * "CognitoIdentityProvider.Client.exceptions.NotAuthorizedExceptio n" * "CognitoIdentityProvider.Client.exceptions.UserNotFoundException" * "CognitoIdentityProvider.Client.exceptions.InternalErrorExceptio n"