Table of Contents
A low-level client representing Amazon Cognito Identity Provider:
import boto3
client = boto3.client('cognito-idp')
These are the available methods:
Adds additional user attributes to the user pool schema.
See also: AWS API Documentation
Request Syntax
response = client.add_custom_attributes(
UserPoolId='string',
CustomAttributes=[
{
'Name': 'string',
'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean',
'DeveloperOnlyAttribute': True|False,
'Mutable': True|False,
'Required': True|False,
'NumberAttributeConstraints': {
'MinValue': 'string',
'MaxValue': 'string'
},
'StringAttributeConstraints': {
'MinLength': 'string',
'MaxLength': 'string'
}
},
]
)
[REQUIRED]
The user pool ID for the user pool where you want to add custom attributes.
[REQUIRED]
An array of custom attributes, such as Mutable and Name.
Contains information about the schema attribute.
A schema attribute of the name type.
The attribute data type.
Specifies whether the attribute type is developer only.
Specifies whether the value of the attribute can be changed.
For any user pool attribute that's mapped to an identity provider attribute, you must set this parameter to true . Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. 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 .
Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.
Specifies the constraints for an attribute of the number type.
The minimum value of an attribute that is of the number data type.
The maximum value of an attribute that is of the number data type.
Specifies the constraints for an attribute of the string type.
The minimum length.
The maximum length.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server for the request to add custom attributes.
Adds the specified user to the specified group.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_add_user_to_group(
UserPoolId='string',
Username='string',
GroupName='string'
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
The username for the user.
[REQUIRED]
The group name.
None
Confirms user registration as an admin without using a confirmation code. Works on any user.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_confirm_sign_up(
UserPoolId='string',
Username='string'
)
[REQUIRED]
The user pool ID for which you want to confirm user registration.
[REQUIRED]
The user name for which you want to confirm user registration.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server for the request to confirm registration.
Creates a new user in the specified user pool.
If MessageAction is not set, the default is to send a welcome message via email or phone (SMS).
Note
This message is based on a template that you configured in your call to or . 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 will not send any email.
In either case, the user will be in the FORCE_CHANGE_PASSWORD state until they sign in and change their password.
AdminCreateUser requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_create_user(
UserPoolId='string',
Username='string',
UserAttributes=[
{
'Name': 'string',
'Value': 'string'
},
],
ValidationData=[
{
'Name': 'string',
'Value': 'string'
},
],
TemporaryPassword='string',
ForceAliasCreation=True|False,
MessageAction='RESEND'|'SUPPRESS',
DesiredDeliveryMediums=[
'SMS'|'EMAIL',
]
)
[REQUIRED]
The user pool ID for the user pool where the user will be created.
[REQUIRED]
The username for the user. Must be unique within the user pool. Must be a UTF-8 string between 1 and 128 characters. After the user is created, the username cannot be changed.
An array of name-value pairs that contain user attributes and attribute values to be set for the user to be created. You can create a user without specifying any attributes other than Username . However, any attributes that you specify as required (in or in the Attributes tab of the console) must be supplied either by you (in your call to AdminCreateUser ) or by the user (when he or she signs up in response to your welcome message).
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. This can be done in your call to AdminCreateUser or in the Users tab of the Amazon Cognito console for managing your user pools.
In your call to AdminCreateUser , you can set the email_verified attribute to True , and you can set the phone_number_verified attribute to True . (You can also do this by calling .)
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
The user's validation data. This is an array of name-value pairs that contain user attributes and attribute values that you can use for custom validation, such as restricting the types of user accounts that can be registered. For example, you might choose to allow or disallow user sign-up based on the user's domain.
To configure custom validation, you must create a Pre Sign-up Lambda trigger for the user pool as described in the Amazon Cognito Developer Guide. The Lambda trigger receives the validation data and uses it in the validation process.
The user's validation data is not persisted.
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
The user's temporary password. This password must conform to the password policy that you specified when you created the user pool.
The temporary password is valid only once. To complete the Admin Create User flow, the user must enter the temporary password in the sign-in page along with a new password to be used in all future sign-ins.
This parameter is not required. If you do not specify a value, Amazon Cognito generates one for you.
The temporary password can only be used until the user account expiration limit that you specified when you created the user pool. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter.
This parameter is only used if the phone_number_verified or email_verified attribute is set to True . Otherwise, it is ignored.
If this parameter is set to True and the phone number or email address specified in the UserAttributes parameter already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user. The previous user will no longer be able to log in using that alias.
If this parameter is set to False , the API throws an AliasExistsException error if the alias already exists. The default value is False .
Specify "EMAIL" if email will be used to send the welcome message. Specify "SMS" if the phone number will be used. The default value is "SMS" . More than one value can be specified.
dict
Response Syntax
{
'User': {
'Username': 'string',
'Attributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'UserCreateDate': datetime(2015, 1, 1),
'UserLastModifiedDate': datetime(2015, 1, 1),
'Enabled': True|False,
'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
'MFAOptions': [
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
]
}
}
Response Structure
(dict) --
Represents the response from the server to the request to create the user.
User (dict) --
The newly created user.
Username (string) --
The user name of the user you wish to describe.
Attributes (list) --
A container with information about the user type attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
UserCreateDate (datetime) --
The creation date of the user.
UserLastModifiedDate (datetime) --
The last modified date of the user.
Enabled (boolean) --
Specifies whether the user is enabled.
UserStatus (string) --
The user status. Can be one of the following:
MFAOptions (list) --
The MFA options for the user.
(dict) --
Specifies the different settings for multi-factor authentication (MFA).
DeliveryMedium (string) --
The delivery medium (email message or SMS message) to send the MFA code.
AttributeName (string) --
The attribute name of the MFA option type.
Deletes a user as an administrator. Works on any user.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_delete_user(
UserPoolId='string',
Username='string'
)
[REQUIRED]
The user pool ID for the user pool where you want to delete the user.
[REQUIRED]
The user name of the user you wish to delete.
None
Deletes the user attributes in a user pool as an administrator. Works on any user.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_delete_user_attributes(
UserPoolId='string',
Username='string',
UserAttributeNames=[
'string',
]
)
[REQUIRED]
The user pool ID for the user pool where you want to delete user attributes.
[REQUIRED]
The user name of the user from which you would like to delete attributes.
[REQUIRED]
An array of strings representing the user attribute names you wish to delete.
For custom attributes, you must prepend the custom: prefix to the attribute name.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response received from the server for a request to delete user attributes.
Disables the user from signing in with the specified external (SAML or social) identity provider. If the user to disable is a Cognito User Pools native username + password user, they are not permitted to use their password to sign-in. If the user to disable is a linked external IdP user, any link between that user and an existing user is removed. The next time the external user (no longer attached to the previously linked DestinationUser ) signs in, they must create a new user account. See .
This action is enabled only for admin access and requires developer credentials.
The ProviderName must match the value specified when creating an IdP for the pool.
To disable a native username + password user, the ProviderName value must be Cognito and the ProviderAttributeName must be Cognito_Subject , with the ProviderAttributeValue being the name that is used in the user pool for the user.
The ProviderAttributeName must always be Cognito_Subject for social identity providers. 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 in the call. (If the linking was done with ProviderAttributeName set to Cognito_Subject , the same applies here). However, if the user has already signed in, the ProviderAttributeName must be Cognito_Subject and ProviderAttributeValue must be the subject of the SAML assertion.
See also: AWS API Documentation
Request Syntax
response = client.admin_disable_provider_for_user(
UserPoolId='string',
User={
'ProviderName': 'string',
'ProviderAttributeName': 'string',
'ProviderAttributeValue': 'string'
}
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
The user to be disabled.
The name of the provider, for example, Facebook, Google, or Login with Amazon.
The name of the provider attribute to link to, for example, NameID .
The value of the provider attribute to link to, for example, xxxxx_account .
dict
Response Syntax
{}
Response Structure
Disables the specified user as an administrator. Works on any user.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_disable_user(
UserPoolId='string',
Username='string'
)
[REQUIRED]
The user pool ID for the user pool where you want to disable the user.
[REQUIRED]
The user name of the user you wish to disable.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response received from the server to disable the user as an administrator.
Enables the specified user as an administrator. Works on any user.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_enable_user(
UserPoolId='string',
Username='string'
)
[REQUIRED]
The user pool ID for the user pool where you want to enable the user.
[REQUIRED]
The user name of the user you wish to enable.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server for the request to enable a user as an administrator.
Forgets the device, as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_forget_device(
UserPoolId='string',
Username='string',
DeviceKey='string'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user name.
[REQUIRED]
The device key.
None
Gets the device, as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_get_device(
DeviceKey='string',
UserPoolId='string',
Username='string'
)
[REQUIRED]
The device key.
[REQUIRED]
The user pool ID.
[REQUIRED]
The user name.
dict
Response Syntax
{
'Device': {
'DeviceKey': 'string',
'DeviceAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'DeviceCreateDate': datetime(2015, 1, 1),
'DeviceLastModifiedDate': datetime(2015, 1, 1),
'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Gets the device response, as an administrator.
Device (dict) --
The device.
DeviceKey (string) --
The device key.
DeviceAttributes (list) --
The device attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
DeviceCreateDate (datetime) --
The creation date of the device.
DeviceLastModifiedDate (datetime) --
The last modified date of the device.
DeviceLastAuthenticatedDate (datetime) --
The date in which the device was last authenticated.
Gets the specified user by user name in a user pool as an administrator. Works on any user.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_get_user(
UserPoolId='string',
Username='string'
)
[REQUIRED]
The user pool ID for the user pool where you want to get information about the user.
[REQUIRED]
The user name of the user you wish to retrieve.
dict
Response Syntax
{
'Username': 'string',
'UserAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'UserCreateDate': datetime(2015, 1, 1),
'UserLastModifiedDate': datetime(2015, 1, 1),
'Enabled': True|False,
'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
'MFAOptions': [
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
],
'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 user name of the user about whom you are receiving information.
UserAttributes (list) --
An array of name-value pairs representing user attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
UserCreateDate (datetime) --
The date the user was created.
UserLastModifiedDate (datetime) --
The date the user was last modified.
Enabled (boolean) --
Indicates that the status is enabled.
UserStatus (string) --
The user status. Can be one of the following:
MFAOptions (list) --
Specifies the options for MFA (e.g., email or phone number).
(dict) --
Specifies the different settings for multi-factor authentication (MFA).
DeliveryMedium (string) --
The delivery medium (email message or SMS message) to send the MFA code.
AttributeName (string) --
The attribute name of the MFA option type.
PreferredMfaSetting (string) --
The user's preferred MFA setting.
UserMFASettingList (list) --
The list of the user's MFA settings.
Initiates the authentication flow, as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_initiate_auth(
UserPoolId='string',
ClientId='string',
AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'USER_PASSWORD_AUTH',
AuthParameters={
'string': 'string'
},
ClientMetadata={
'string': 'string'
},
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
},
ContextData={
'IpAddress': 'string',
'ServerName': 'string',
'ServerPath': 'string',
'HttpHeaders': [
{
'headerName': 'string',
'headerValue': 'string'
},
],
'EncodedData': 'string'
}
)
[REQUIRED]
The ID of the Amazon Cognito user pool.
[REQUIRED]
The app client ID.
[REQUIRED]
The authentication flow for this call to execute. The API action will depend on this value. For example:
Valid values include:
The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow :
This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda trigger as-is. It can be used to implement additional validations around authentication.
The analytics metadata for collecting Amazon Pinpoint metrics for AdminInitiateAuth calls.
The endpoint ID.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Source IP address of your user.
Your server endpoint where this API is invoked.
Your server path where this API is invoked.
HttpHeaders received on your server in same order.
The HTTP header.
The header name
The header value.
Encoded data containing device fingerprinting details, collected using the Amazon Cognito context data collection library.
dict
Response Syntax
{
'ChallengeName': 'SMS_MFA'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
'Session': 'string',
'ChallengeParameters': {
'string': 'string'
},
'AuthenticationResult': {
'AccessToken': 'string',
'ExpiresIn': 123,
'TokenType': 'string',
'RefreshToken': 'string',
'IdToken': 'string',
'NewDeviceMetadata': {
'DeviceKey': 'string',
'DeviceGroupKey': 'string'
}
}
}
Response Structure
(dict) --
Initiates the authentication response, as an administrator.
ChallengeName (string) --
The name of the challenge which you are responding to with this call. This is returned to you in the AdminInitiateAuth response if you need to pass another challenge.
Session (string) --
The session which should be passed both ways in challenge-response calls to the service. If AdminInitiateAuth or AdminRespondToAuthChallenge API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next AdminRespondToAuthChallenge API call.
ChallengeParameters (dict) --
The challenge parameters. These are returned to you in the AdminInitiateAuth response if you need to pass another challenge. The responses in this parameter should be used to compute inputs to the next call (AdminRespondToAuthChallenge ).
All challenges require USERNAME and SECRET_HASH (if applicable).
The value of the USER_ID_FOR_SRP attribute will be the user's actual username, not an alias (such as email address or phone number), even if you specified an alias in your call to AdminInitiateAuth . This is because, in the AdminRespondToAuthChallenge API ChallengeResponses , the USERNAME attribute cannot be an alias.
AuthenticationResult (dict) --
The result of the authentication response. This is only returned if the caller does not need to pass another challenge. If the caller does need to pass another challenge before it gets tokens, ChallengeName , ChallengeParameters , and Session are returned.
AccessToken (string) --
The access token.
ExpiresIn (integer) --
The expiration period of the authentication result in seconds.
TokenType (string) --
The token type.
RefreshToken (string) --
The refresh token.
IdToken (string) --
The ID token.
NewDeviceMetadata (dict) --
The new device metadata from an authentication result.
DeviceKey (string) --
The device key.
DeviceGroupKey (string) --
The device group key.
Links an existing user account in a user pool (DestinationUser ) to an identity from an external identity provider (SourceUser ) based on a specified attribute name and value from the external identity provider. This allows you to create a link from the existing user account to an external federated user identity that has not yet been used to sign in, so that the federated user identity can be used to sign in as the existing user account.
For example, if there is an existing user with a username and password, this API links that user to a federated user identity, so that when the federated user identity is used, the user signs in as the existing user account.
Warning
Because this API allows a user with an external federated identity to sign in as an existing user in the user pool, it is critical that it only be used with external identity providers and provider attributes that have been trusted by the application owner.
See also .
This action is enabled only for admin access and requires developer credentials.
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'
}
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
The existing user in the user pool to be linked to the external identity provider user account. Can be a native (Username + Password) Cognito User Pools user or a federated user (for example, a SAML or Facebook user). If the user doesn't exist, an exception is thrown. This is the user that is returned when the new user (with the linked identity provider 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.
The name of the provider, for example, Facebook, Google, or Login with Amazon.
The name of the provider attribute to link to, for example, NameID .
The value of the provider attribute to link to, for example, xxxxx_account .
[REQUIRED]
An external identity provider account for a user who does not currently 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 a federated social identity provider user (Facebook, Google, or Login with Amazon), you must set the ProviderAttributeName to Cognito_Subject . For social identity providers, the ProviderName will be Facebook , Google , or LoginWithAmazon , and 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 identity provider token.
For SAML, the ProviderAttributeName can be any value that matches a claim in the SAML assertion. If you wish to link SAML users based on the subject of the SAML assertion, you should map the subject to a claim through the SAML identity provider and submit that claim name as the ProviderAttributeName . If you set ProviderAttributeName to Cognito_Subject , Cognito will automatically parse the default unique identifier found in the subject from the SAML token.
The name of the provider, for example, Facebook, Google, or Login with Amazon.
The name of the provider attribute to link to, for example, NameID .
The value of the provider attribute to link to, for example, xxxxx_account .
dict
Response Syntax
{}
Response Structure
Lists devices, as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_list_devices(
UserPoolId='string',
Username='string',
Limit=123,
PaginationToken='string'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user name.
dict
Response Syntax
{
'Devices': [
{
'DeviceKey': 'string',
'DeviceAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'DeviceCreateDate': datetime(2015, 1, 1),
'DeviceLastModifiedDate': datetime(2015, 1, 1),
'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
},
],
'PaginationToken': 'string'
}
Response Structure
(dict) --
Lists the device's response, as an administrator.
Devices (list) --
The devices in the list of devices response.
(dict) --
The device type.
DeviceKey (string) --
The device key.
DeviceAttributes (list) --
The device attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
DeviceCreateDate (datetime) --
The creation date of the device.
DeviceLastModifiedDate (datetime) --
The last modified date of the device.
DeviceLastAuthenticatedDate (datetime) --
The date in which the device was last authenticated.
PaginationToken (string) --
The pagination token.
Lists the groups that the user belongs to.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_list_groups_for_user(
Username='string',
UserPoolId='string',
Limit=123,
NextToken='string'
)
[REQUIRED]
The username for the user.
[REQUIRED]
The user pool ID for the user pool.
dict
Response Syntax
{
'Groups': [
{
'GroupName': 'string',
'UserPoolId': 'string',
'Description': 'string',
'RoleArn': 'string',
'Precedence': 123,
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Groups (list) --
The groups that the user belongs to.
(dict) --
The group type.
GroupName (string) --
The name of the group.
UserPoolId (string) --
The user pool ID for the user pool.
Description (string) --
A string containing the description of the group.
RoleArn (string) --
The role ARN for the group.
Precedence (integer) --
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
LastModifiedDate (datetime) --
The date the group was last modified.
CreationDate (datetime) --
The date the group was created.
NextToken (string) --
An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Lists a history of user activity and any risks detected as part of Amazon Cognito advanced security.
See also: AWS API Documentation
Request Syntax
response = client.admin_list_user_auth_events(
UserPoolId='string',
Username='string',
MaxResults=123,
NextToken='string'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user pool username or an alias.
dict
Response Syntax
{
'AuthEvents': [
{
'EventId': 'string',
'EventType': 'SignIn'|'SignUp'|'ForgotPassword',
'CreationDate': datetime(2015, 1, 1),
'EventResponse': 'Success'|'Failure',
'EventRisk': {
'RiskDecision': 'NoRisk'|'AccountTakeover'|'Block',
'RiskLevel': 'Low'|'Medium'|'High'
},
'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) --
The authentication event type.
EventId (string) --
The event ID.
EventType (string) --
The event type.
CreationDate (datetime) --
The creation date
EventResponse (string) --
The event response.
EventRisk (dict) --
The event risk.
RiskDecision (string) --
The risk decision.
RiskLevel (string) --
The risk level.
ChallengeResponses (list) --
The challenge responses.
(dict) --
The challenge response type.
ChallengeName (string) --
The challenge name
ChallengeResponse (string) --
The challenge response.
EventContextData (dict) --
The user context data captured at the time of an event request. It provides additional information about the client from which event the request is received.
IpAddress (string) --
The user's IP address.
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) --
A flag specifying the user feedback captured at the time of an event request is good or bad.
FeedbackValue (string) --
The event feedback value.
Provider (string) --
The provider.
FeedbackDate (datetime) --
The event feedback date.
NextToken (string) --
A pagination token.
Removes the specified user from the specified group.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_remove_user_from_group(
UserPoolId='string',
Username='string',
GroupName='string'
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
The username for the user.
[REQUIRED]
The group name.
None
Resets the specified user's password in a user pool as an administrator. Works on any user.
When a developer calls this API, the current password is invalidated, so it must be changed. If a user tries to sign in after the API is called, the app will get a PasswordResetRequiredException exception back and should direct the user down the flow to reset the password, which is the same as the forgot password flow. In addition, if the user pool has phone verification selected and a verified phone number exists for the user, or if email verification is selected and a verified email exists for the user, calling this API will also result in sending a message to the end user with the code to change their password.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_reset_user_password(
UserPoolId='string',
Username='string'
)
[REQUIRED]
The user pool ID for the user pool where you want to reset the user's password.
[REQUIRED]
The user name of the user whose password you wish to reset.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server to reset a user password as an administrator.
Responds to an authentication challenge, as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_respond_to_auth_challenge(
UserPoolId='string',
ClientId='string',
ChallengeName='SMS_MFA'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
ChallengeResponses={
'string': 'string'
},
Session='string',
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
},
ContextData={
'IpAddress': 'string',
'ServerName': 'string',
'ServerPath': 'string',
'HttpHeaders': [
{
'headerName': 'string',
'headerValue': 'string'
},
],
'EncodedData': 'string'
}
)
[REQUIRED]
The ID of the Amazon Cognito user pool.
[REQUIRED]
The app client ID.
[REQUIRED]
The challenge name. For more information, see .
The challenge responses. These are inputs corresponding to the value of ChallengeName , for example:
The value of the USERNAME attribute must be the user's actual username, not an alias (such as email address or phone number). To make this easier, the AdminInitiateAuth response includes the actual username value in the USERNAMEUSER_ID_FOR_SRP attribute, even if you specified an alias in your call to AdminInitiateAuth .
The analytics metadata for collecting Amazon Pinpoint metrics for AdminRespondToAuthChallenge calls.
The endpoint ID.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Source IP address of your user.
Your server endpoint where this API is invoked.
Your server path where this API is invoked.
HttpHeaders received on your server in same order.
The HTTP header.
The header name
The header value.
Encoded data containing device fingerprinting details, collected using the Amazon Cognito context data collection library.
dict
Response Syntax
{
'ChallengeName': 'SMS_MFA'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
'Session': 'string',
'ChallengeParameters': {
'string': 'string'
},
'AuthenticationResult': {
'AccessToken': 'string',
'ExpiresIn': 123,
'TokenType': 'string',
'RefreshToken': 'string',
'IdToken': 'string',
'NewDeviceMetadata': {
'DeviceKey': 'string',
'DeviceGroupKey': 'string'
}
}
}
Response Structure
(dict) --
Responds to the authentication challenge, as an administrator.
ChallengeName (string) --
The name of the challenge. For more information, see .
Session (string) --
The session which should be passed both ways in challenge-response calls to the service. If the or API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.
ChallengeParameters (dict) --
The challenge parameters. For more information, see .
AuthenticationResult (dict) --
The result returned by the server in response to the authentication request.
AccessToken (string) --
The access token.
ExpiresIn (integer) --
The expiration period of the authentication result in seconds.
TokenType (string) --
The token type.
RefreshToken (string) --
The refresh token.
IdToken (string) --
The ID token.
NewDeviceMetadata (dict) --
The new device metadata from an authentication result.
DeviceKey (string) --
The device key.
DeviceGroupKey (string) --
The device group key.
Sets the user's multi-factor authentication (MFA) preference.
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
},
Username='string',
UserPoolId='string'
)
The SMS text message MFA settings.
Specifies whether SMS text message MFA is enabled.
The preferred MFA method.
The time-based one-time password software token MFA settings.
Specifies whether software token MFA is enabled.
The preferred MFA method.
[REQUIRED]
The user pool username or alias.
[REQUIRED]
The user pool ID.
dict
Response Syntax
{}
Response Structure
See also: AWS API Documentation
Request Syntax
response = client.admin_set_user_password(
UserPoolId='string',
Username='string',
Password='string',
Permanent=True|False
)
dict
Response Syntax
{}
Response Structure
Sets all the user settings for a specified user name. Works on any user.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_set_user_settings(
UserPoolId='string',
Username='string',
MFAOptions=[
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
]
)
[REQUIRED]
The user pool ID for the user pool where you want to set the user's settings, such as MFA options.
[REQUIRED]
The user name of the user for whom you wish to set user settings.
[REQUIRED]
Specifies the options for MFA (e.g., email or phone number).
Specifies the different settings for multi-factor authentication (MFA).
The delivery medium (email message or SMS message) to send the MFA code.
The attribute name of the MFA option type.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server to set user settings as an administrator.
Provides feedback for an authentication event as to whether it was from a valid user. This feedback is used for improving the risk evaluation decision for the user pool as part of Amazon Cognito advanced security.
See also: AWS API Documentation
Request Syntax
response = client.admin_update_auth_event_feedback(
UserPoolId='string',
Username='string',
EventId='string',
FeedbackValue='Valid'|'Invalid'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user pool username.
[REQUIRED]
The authentication event ID.
[REQUIRED]
The authentication event feedback value.
dict
Response Syntax
{}
Response Structure
Updates the device status as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_update_device_status(
UserPoolId='string',
Username='string',
DeviceKey='string',
DeviceRememberedStatus='remembered'|'not_remembered'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user name.
[REQUIRED]
The device key.
dict
Response Syntax
{}
Response Structure
(dict) --
The status response from the request to update the device, as an administrator.
Updates the specified user's attributes, including developer attributes, as an administrator. Works on any user.
For custom attributes, you must prepend the custom: prefix to the attribute name.
In addition to updating user attributes, this API can also be used to mark phone and email as verified.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_update_user_attributes(
UserPoolId='string',
Username='string',
UserAttributes=[
{
'Name': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The user pool ID for the user pool where you want to update user attributes.
[REQUIRED]
The user name of the user for whom you want to update user attributes.
[REQUIRED]
An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the custom: prefix to the attribute name.
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server for the request to update user attributes as an administrator.
Signs out users from all devices, as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.admin_user_global_sign_out(
UserPoolId='string',
Username='string'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user name.
dict
Response Syntax
{}
Response Structure
(dict) --
The global sign-out response, as an administrator.
Returns a unique generated shared secret key code for the user account. The request takes an access token or a session string, but not both.
See also: AWS API Documentation
Request Syntax
response = client.associate_software_token(
AccessToken='string',
Session='string'
)
dict
Response Syntax
{
'SecretCode': 'string',
'Session': 'string'
}
Response Structure
(dict) --
SecretCode (string) --
A unique generated shared secret code that is used in the TOTP algorithm to generate a one time code.
Session (string) --
The session which should be passed both ways in challenge-response calls to the service. This allows authentication of the user as part of the MFA setup process.
Check if an operation can be paginated.
Changes the password for a specified user in a user pool.
See also: AWS API Documentation
Request Syntax
response = client.change_password(
PreviousPassword='string',
ProposedPassword='string',
AccessToken='string'
)
[REQUIRED]
The old password.
[REQUIRED]
The new password.
[REQUIRED]
The access token.
dict
Response Syntax
{}
Response Structure
(dict) --
The response from the server to the change password request.
Confirms tracking of the device. This API call is the call that begins device tracking.
See also: AWS API Documentation
Request Syntax
response = client.confirm_device(
AccessToken='string',
DeviceKey='string',
DeviceSecretVerifierConfig={
'PasswordVerifier': 'string',
'Salt': 'string'
},
DeviceName='string'
)
[REQUIRED]
The access token.
[REQUIRED]
The device key.
The configuration of the device secret verifier.
The password verifier.
The salt.
dict
Response Syntax
{
'UserConfirmationNecessary': True|False
}
Response Structure
(dict) --
Confirms the device response.
UserConfirmationNecessary (boolean) --
Indicates whether the user confirmation is necessary to confirm the device response.
Allows a user to enter a confirmation code to reset a forgotten password.
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={
'EncodedData': 'string'
}
)
[REQUIRED]
The app client ID of the app associated with the user pool.
[REQUIRED]
The user name of the user for whom you want to enter a code to retrieve a forgotten password.
[REQUIRED]
The confirmation code sent by a user's request to retrieve a forgotten password. For more information, see
[REQUIRED]
The password sent by a user's request to retrieve a forgotten password.
The Amazon Pinpoint analytics metadata for collecting metrics for ConfirmForgotPassword calls.
The endpoint ID.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
dict
Response Syntax
{}
Response Structure
(dict) --
The response from the server that results from a user's request to retrieve a forgotten password.
Confirms registration of a user and handles the existing alias from a previous user.
See also: AWS API Documentation
Request Syntax
response = client.confirm_sign_up(
ClientId='string',
SecretHash='string',
Username='string',
ConfirmationCode='string',
ForceAliasCreation=True|False,
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
},
UserContextData={
'EncodedData': 'string'
}
)
[REQUIRED]
The ID of the app client associated with the user pool.
[REQUIRED]
The user name of the user whose registration you wish to confirm.
[REQUIRED]
The confirmation code sent by a user's request to confirm registration.
The Amazon Pinpoint analytics metadata for collecting metrics for ConfirmSignUp calls.
The endpoint ID.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server for the registration confirmation.
Creates a new group in the specified user pool.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.create_group(
GroupName='string',
UserPoolId='string',
Description='string',
RoleArn='string',
Precedence=123
)
[REQUIRED]
The name of the group. Must be unique.
[REQUIRED]
The user pool ID for the user pool.
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. Zero is the highest precedence value. Groups with lower Precedence values take precedence over groups with higher or null Precedence values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
dict
Response Syntax
{
'Group': {
'GroupName': 'string',
'UserPoolId': 'string',
'Description': 'string',
'RoleArn': 'string',
'Precedence': 123,
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Group (dict) --
The group object for the group.
GroupName (string) --
The name of the group.
UserPoolId (string) --
The user pool ID for the user pool.
Description (string) --
A string containing the description of the group.
RoleArn (string) --
The role ARN for the group.
Precedence (integer) --
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
LastModifiedDate (datetime) --
The date the group was last modified.
CreationDate (datetime) --
The date the group was created.
Creates an identity provider for a user pool.
See also: AWS API Documentation
Request Syntax
response = client.create_identity_provider(
UserPoolId='string',
ProviderName='string',
ProviderType='SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'OIDC',
ProviderDetails={
'string': 'string'
},
AttributeMapping={
'string': 'string'
},
IdpIdentifiers=[
'string',
]
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The identity provider name.
[REQUIRED]
The identity provider type.
[REQUIRED]
The identity provider details, such as MetadataURL and MetadataFile .
A mapping of identity provider attributes to standard and custom user pool attributes.
A list of identity provider identifiers.
dict
Response Syntax
{
'IdentityProvider': {
'UserPoolId': 'string',
'ProviderName': 'string',
'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'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 newly created identity provider object.
UserPoolId (string) --
The user pool ID.
ProviderName (string) --
The identity provider name.
ProviderType (string) --
The identity provider type.
ProviderDetails (dict) --
The identity provider details, such as MetadataURL and MetadataFile .
AttributeMapping (dict) --
A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers (list) --
A list of identity provider identifiers.
LastModifiedDate (datetime) --
The date the identity provider was last modified.
CreationDate (datetime) --
The date the identity provider was created.
Creates a new OAuth2.0 resource server and defines custom scopes in it.
See also: AWS API Documentation
Request Syntax
response = client.create_resource_server(
UserPoolId='string',
Identifier='string',
Name='string',
Scopes=[
{
'ScopeName': 'string',
'ScopeDescription': 'string'
},
]
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
A unique resource server identifier for the resource server. This could be an HTTPS endpoint where the resource server is located. For example, https://my-weather-api.example.com .
[REQUIRED]
A friendly name for the resource server.
A list of scopes. Each scope is map, where the keys are name and description .
A resource server scope.
The name of the scope.
A description of the scope.
dict
Response Syntax
{
'ResourceServer': {
'UserPoolId': 'string',
'Identifier': 'string',
'Name': 'string',
'Scopes': [
{
'ScopeName': 'string',
'ScopeDescription': 'string'
},
]
}
}
Response Structure
(dict) --
ResourceServer (dict) --
The newly created resource server.
UserPoolId (string) --
The user pool ID for the user pool that hosts the resource server.
Identifier (string) --
The identifier for the resource server.
Name (string) --
The name of the resource server.
Scopes (list) --
A list of scopes that are defined for the resource server.
(dict) --
A resource server scope.
ScopeName (string) --
The name of the scope.
ScopeDescription (string) --
A description of the scope.
Creates the user import job.
See also: AWS API Documentation
Request Syntax
response = client.create_user_import_job(
JobName='string',
UserPoolId='string',
CloudWatchLogsRoleArn='string'
)
[REQUIRED]
The job name for the user import job.
[REQUIRED]
The user pool ID for the user pool that the users are being imported into.
[REQUIRED]
The role ARN for the Amazon CloudWatch Logging role for the user import job.
dict
Response Syntax
{
'UserImportJob': {
'JobName': 'string',
'JobId': 'string',
'UserPoolId': 'string',
'PreSignedUrl': 'string',
'CreationDate': datetime(2015, 1, 1),
'StartDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
'CloudWatchLogsRoleArn': 'string',
'ImportedUsers': 123,
'SkippedUsers': 123,
'FailedUsers': 123,
'CompletionMessage': 'string'
}
}
Response Structure
(dict) --
Represents the response from the server to the request to create the user import job.
UserImportJob (dict) --
The job object that represents the user import job.
JobName (string) --
The job name for the user import job.
JobId (string) --
The job ID for the user import job.
UserPoolId (string) --
The user pool ID for the user pool that the users are being imported into.
PreSignedUrl (string) --
The pre-signed URL to be used to upload the .csv file.
CreationDate (datetime) --
The date the user import job was created.
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:
CloudWatchLogsRoleArn (string) --
The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.
ImportedUsers (integer) --
The number of users that were successfully imported.
SkippedUsers (integer) --
The number of users that were skipped.
FailedUsers (integer) --
The number of users that could not be imported.
CompletionMessage (string) --
The message returned when the user import job is completed.
Creates a new Amazon Cognito user pool and sets the password policy for the pool.
See also: AWS API Documentation
Request Syntax
response = client.create_user_pool(
PoolName='string',
Policies={
'PasswordPolicy': {
'MinimumLength': 123,
'RequireUppercase': True|False,
'RequireLowercase': True|False,
'RequireNumbers': True|False,
'RequireSymbols': True|False,
'TemporaryPasswordValidityDays': 123
}
},
LambdaConfig={
'PreSignUp': 'string',
'CustomMessage': 'string',
'PostConfirmation': 'string',
'PreAuthentication': 'string',
'PostAuthentication': 'string',
'DefineAuthChallenge': 'string',
'CreateAuthChallenge': 'string',
'VerifyAuthChallengeResponse': 'string',
'PreTokenGeneration': 'string',
'UserMigration': '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',
DeviceConfiguration={
'ChallengeRequiredOnNewDevice': True|False,
'DeviceOnlyRememberedOnUserPrompt': True|False
},
EmailConfiguration={
'SourceArn': 'string',
'ReplyToEmailAddress': 'string',
'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER'
},
SmsConfiguration={
'SnsCallerArn': 'string',
'ExternalId': 'string'
},
UserPoolTags={
'string': 'string'
},
AdminCreateUserConfig={
'AllowAdminCreateUserOnly': True|False,
'UnusedAccountValidityDays': 123,
'InviteMessageTemplate': {
'SMSMessage': 'string',
'EmailMessage': 'string',
'EmailSubject': 'string'
}
},
Schema=[
{
'Name': 'string',
'AttributeDataType': 'String'|'Number'|'DateTime'|'Boolean',
'DeveloperOnlyAttribute': True|False,
'Mutable': True|False,
'Required': True|False,
'NumberAttributeConstraints': {
'MinValue': 'string',
'MaxValue': 'string'
},
'StringAttributeConstraints': {
'MinLength': 'string',
'MaxLength': 'string'
}
},
],
UserPoolAddOns={
'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED'
}
)
[REQUIRED]
A string used to name the user pool.
The policies associated with the new user pool.
The password policy.
The minimum length of the password policy that you have set. Cannot be less than 6.
In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.
In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.
In the password policy that you have set, refers to whether you have required users to use at least one number in their password.
In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.
The Lambda trigger configuration information for the new user pool.
Note
In a push model, event sources (such as Amazon S3 and custom applications) need permission to invoke a function. So you will need to make an extra call to add permission for these event sources to invoke your Lambda function.
For more information on using the Lambda API to add permission, see AddPermission .
For adding permission using the AWS CLI, see add-permission .
A pre-registration AWS Lambda trigger.
A custom Message AWS Lambda trigger.
A post-confirmation AWS Lambda trigger.
A pre-authentication AWS Lambda trigger.
A post-authentication AWS Lambda trigger.
Defines the authentication challenge.
Creates an authentication challenge.
Verifies the authentication challenge response.
A Lambda trigger that is invoked before token generation.
The user migration Lambda config type.
The attributes to be auto-verified. Possible values: email , phone_number .
Attributes supported as an alias for this user pool. Possible values: phone_number , email , or preferred_username .
Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.
The template for the verification message that the user sees when the app requests permission to access the user's information.
The SMS message template.
The email message template.
The subject line for the email message template.
The email message template for sending a confirmation link to the user.
The subject line for the email message template for sending a confirmation link to the user.
The default email option.
The device configuration.
Indicates whether a challenge is required on a new device. Only applicable to a new device.
If true, a device is only remembered on user prompt.
The email configuration.
The Amazon Resource Name (ARN) of a verified email address in Amazon SES. This email address is used in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:
The destination to which the receiver of the email should reply to.
Specifies whether Amazon Cognito emails your users by using its built-in email functionality or your Amazon SES 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 below 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 Amazon Cognito in the Amazon Cognito Developer Guide .
The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the 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 AWS account.
If you use this option, you must 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 IAM role, in your AWS account. This role contains the permissions that allow Amazon Cognito to access Amazon SES and send email messages with your 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 .
The SMS configuration.
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
The external ID.
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.
The configuration for AdminCreateUser requests.
Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.
The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this parameter is 7.
Note
If you set a value for TemporaryPasswordValidityDays in PasswordPolicy , that value will be used and UnusedAccountValidityDays will be deprecated for that user pool.
The message template to be used for the welcome message to new users.
See also Customizing User Invitation Messages .
The message template for SMS messages.
The message template for email messages.
The subject line for email messages.
An array of schema attributes for the new user pool. These attributes can be standard or custom attributes.
Contains information about the schema attribute.
A schema attribute of the name type.
The attribute data type.
Specifies whether the attribute type is developer only.
Specifies whether the value of the attribute can be changed.
For any user pool attribute that's mapped to an identity provider attribute, you must set this parameter to true . Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. 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 .
Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.
Specifies the constraints for an attribute of the number type.
The minimum value of an attribute that is of the number data type.
The maximum value of an attribute that is of the number data type.
Specifies the constraints for an attribute of the string type.
The minimum length.
The maximum length.
Used to enable advanced security risk detection. Set the key AdvancedSecurityMode to the value "AUDIT".
The advanced security mode.
dict
Response Syntax
{
'UserPool': {
'Id': 'string',
'Name': 'string',
'Policies': {
'PasswordPolicy': {
'MinimumLength': 123,
'RequireUppercase': True|False,
'RequireLowercase': True|False,
'RequireNumbers': True|False,
'RequireSymbols': True|False,
'TemporaryPasswordValidityDays': 123
}
},
'LambdaConfig': {
'PreSignUp': 'string',
'CustomMessage': 'string',
'PostConfirmation': 'string',
'PreAuthentication': 'string',
'PostAuthentication': 'string',
'DefineAuthChallenge': 'string',
'CreateAuthChallenge': 'string',
'VerifyAuthChallengeResponse': 'string',
'PreTokenGeneration': 'string',
'UserMigration': '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',
'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
'DeviceConfiguration': {
'ChallengeRequiredOnNewDevice': True|False,
'DeviceOnlyRememberedOnUserPrompt': True|False
},
'EstimatedNumberOfUsers': 123,
'EmailConfiguration': {
'SourceArn': 'string',
'ReplyToEmailAddress': 'string',
'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER'
},
'SmsConfiguration': {
'SnsCallerArn': 'string',
'ExternalId': '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'
},
'Arn': 'string'
}
}
Response Structure
(dict) --
Represents the response from the server for the request to create a user pool.
UserPool (dict) --
A container for the user pool details.
Id (string) --
The ID of the user pool.
Name (string) --
The name of the user pool.
Policies (dict) --
The policies associated with the user pool.
PasswordPolicy (dict) --
The password policy.
MinimumLength (integer) --
The minimum length of the password policy that you have set. Cannot be less than 6.
RequireUppercase (boolean) --
In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.
RequireLowercase (boolean) --
In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.
RequireNumbers (boolean) --
In the password policy that you have set, refers to whether you have required users to use at least one number in their password.
RequireSymbols (boolean) --
In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.
TemporaryPasswordValidityDays (integer) --
LambdaConfig (dict) --
The AWS Lambda triggers associated with the user pool.
PreSignUp (string) --
A pre-registration AWS Lambda trigger.
CustomMessage (string) --
A custom Message AWS Lambda trigger.
PostConfirmation (string) --
A post-confirmation AWS Lambda trigger.
PreAuthentication (string) --
A pre-authentication AWS Lambda trigger.
PostAuthentication (string) --
A post-authentication AWS Lambda trigger.
DefineAuthChallenge (string) --
Defines the authentication challenge.
CreateAuthChallenge (string) --
Creates an authentication challenge.
VerifyAuthChallengeResponse (string) --
Verifies the authentication challenge response.
PreTokenGeneration (string) --
A Lambda trigger that is invoked before token generation.
UserMigration (string) --
The user migration Lambda config type.
Status (string) --
The status of a user pool.
LastModifiedDate (datetime) --
The date the user pool was last modified.
CreationDate (datetime) --
The date the user pool was created.
SchemaAttributes (list) --
A container with the schema attributes of a user pool.
(dict) --
Contains information about the schema attribute.
Name (string) --
A schema attribute of the name type.
AttributeDataType (string) --
The attribute data type.
DeveloperOnlyAttribute (boolean) --
Specifies whether the attribute type is developer only.
Mutable (boolean) --
Specifies whether the value of the attribute can be changed.
For any user pool attribute that's mapped to an identity provider attribute, you must set this parameter to true . Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. 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 does not provide a value, registration or sign-in will fail.
NumberAttributeConstraints (dict) --
Specifies the constraints for an attribute of the number type.
MinValue (string) --
The minimum value of an attribute that is of the number data type.
MaxValue (string) --
The maximum value of an attribute that is of the number data type.
StringAttributeConstraints (dict) --
Specifies the constraints for an attribute of the string type.
MinLength (string) --
The minimum length.
MaxLength (string) --
The maximum length.
AutoVerifiedAttributes (list) --
Specifies the attributes that are auto-verified in a user pool.
AliasAttributes (list) --
Specifies the attributes that are aliased in a user pool.
UsernameAttributes (list) --
Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.
SmsVerificationMessage (string) --
The contents of the SMS verification message.
EmailVerificationMessage (string) --
The contents of the email verification message.
EmailVerificationSubject (string) --
The subject of the email verification message.
VerificationMessageTemplate (dict) --
The template for verification messages.
SmsMessage (string) --
The SMS message template.
EmailMessage (string) --
The email message template.
EmailSubject (string) --
The subject line for the email message template.
EmailMessageByLink (string) --
The email message template for sending a confirmation link to the user.
EmailSubjectByLink (string) --
The subject line for the email message template for sending a confirmation link to the user.
DefaultEmailOption (string) --
The default email option.
SmsAuthenticationMessage (string) --
The contents of the SMS authentication message.
MfaConfiguration (string) --
Can be one of the following values:
DeviceConfiguration (dict) --
The device configuration.
ChallengeRequiredOnNewDevice (boolean) --
Indicates whether a challenge is required on a new device. Only applicable to a new device.
DeviceOnlyRememberedOnUserPrompt (boolean) --
If true, a device is only remembered on user prompt.
EstimatedNumberOfUsers (integer) --
A number estimating the size of the user pool.
EmailConfiguration (dict) --
The email configuration.
SourceArn (string) --
The Amazon Resource Name (ARN) of a verified email address in Amazon SES. This email address is used in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:
ReplyToEmailAddress (string) --
The destination to which the receiver of the email should reply to.
EmailSendingAccount (string) --
Specifies whether Amazon Cognito emails your users by using its built-in email functionality or your Amazon SES 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 below 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 Amazon Cognito in the Amazon Cognito Developer Guide .
The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the 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 AWS account.
If you use this option, you must 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 IAM role, in your AWS account. This role contains the permissions that allow Amazon Cognito to access Amazon SES and send email messages with your 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 .
SmsConfiguration (dict) --
The SMS configuration.
SnsCallerArn (string) --
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId (string) --
The external ID.
UserPoolTags (dict) --
The 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.
SmsConfigurationFailure (string) --
The reason why the SMS configuration cannot send the messages to your users.
EmailConfigurationFailure (string) --
The reason why the email configuration cannot send the messages to your users.
Domain (string) --
Holds 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. For example: 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) --
Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.
UnusedAccountValidityDays (integer) --
The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this parameter is 7.
Note
If you set a value for TemporaryPasswordValidityDays in PasswordPolicy , that value will be used and UnusedAccountValidityDays will be deprecated for that user pool.
InviteMessageTemplate (dict) --
The message template to be used for the welcome message to new users.
See also Customizing User Invitation Messages .
SMSMessage (string) --
The message template for SMS messages.
EmailMessage (string) --
The message template for email messages.
EmailSubject (string) --
The subject line for email messages.
UserPoolAddOns (dict) --
The user pool add-ons.
AdvancedSecurityMode (string) --
The advanced security mode.
Arn (string) --
The Amazon Resource Name (ARN) for the user pool.
Creates the user pool client.
See also: AWS API Documentation
Request Syntax
response = client.create_user_pool_client(
UserPoolId='string',
ClientName='string',
GenerateSecret=True|False,
RefreshTokenValidity=123,
ReadAttributes=[
'string',
],
WriteAttributes=[
'string',
],
ExplicitAuthFlows=[
'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH',
],
SupportedIdentityProviders=[
'string',
],
CallbackURLs=[
'string',
],
LogoutURLs=[
'string',
],
DefaultRedirectURI='string',
AllowedOAuthFlows=[
'code'|'implicit'|'client_credentials',
],
AllowedOAuthScopes=[
'string',
],
AllowedOAuthFlowsUserPoolClient=True|False,
AnalyticsConfiguration={
'ApplicationId': 'string',
'RoleArn': 'string',
'ExternalId': 'string',
'UserDataShared': True|False
}
)
[REQUIRED]
The user pool ID for the user pool where you want to create a user pool client.
[REQUIRED]
The client name for the user pool client you would like to create.
The read attributes.
The user pool attributes that the app client can write to.
If your app client allows users to sign in through an identity provider, this array must include all attributes that are mapped to identity provider attributes. Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. If your app client lacks write access to a mapped attribute, 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 .
The explicit authentication flows.
A list of provider names for the identity providers that are supported on this client. The following are supported: COGNITO , Facebook , Google and LoginWithAmazon .
A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
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.
A list of allowed logout URLs for the identity providers.
The default redirect URI. Must be in the CallbackURLs list.
A redirect URI must:
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.
Set to code to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.
Set to token to specify that the client should get the access token (and, optionally, ID token, based on scopes) directly.
A list of allowed OAuth scopes. Currently supported values are "phone" , "email" , "openid" , and "Cognito" .
The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
The application ID for an Amazon Pinpoint application.
The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
The external ID.
If UserDataShared is true , Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
dict
Response Syntax
{
'UserPoolClient': {
'UserPoolId': 'string',
'ClientName': 'string',
'ClientId': 'string',
'ClientSecret': 'string',
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1),
'RefreshTokenValidity': 123,
'ReadAttributes': [
'string',
],
'WriteAttributes': [
'string',
],
'ExplicitAuthFlows': [
'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH',
],
'SupportedIdentityProviders': [
'string',
],
'CallbackURLs': [
'string',
],
'LogoutURLs': [
'string',
],
'DefaultRedirectURI': 'string',
'AllowedOAuthFlows': [
'code'|'implicit'|'client_credentials',
],
'AllowedOAuthScopes': [
'string',
],
'AllowedOAuthFlowsUserPoolClient': True|False,
'AnalyticsConfiguration': {
'ApplicationId': 'string',
'RoleArn': 'string',
'ExternalId': 'string',
'UserDataShared': True|False
}
}
}
Response Structure
(dict) --
Represents the response from the server to create a user pool client.
UserPoolClient (dict) --
The user pool client that was just created.
UserPoolId (string) --
The user pool ID for the user pool client.
ClientName (string) --
The client name from the user pool request of the client type.
ClientId (string) --
The ID of the client associated with the user pool.
ClientSecret (string) --
The client secret from the user pool request of the client type.
LastModifiedDate (datetime) --
The date the user pool client was last modified.
CreationDate (datetime) --
The date the user pool client was created.
RefreshTokenValidity (integer) --
The time limit, in days, after which the refresh token is no longer valid and cannot be used.
ReadAttributes (list) --
The Read-only attributes.
WriteAttributes (list) --
The writeable attributes.
ExplicitAuthFlows (list) --
The explicit authentication flows.
SupportedIdentityProviders (list) --
A list of provider names for the identity providers that are supported on this client.
CallbackURLs (list) --
A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
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.
LogoutURLs (list) --
A list of allowed logout URLs for the identity providers.
DefaultRedirectURI (string) --
The default redirect URI. Must be in the CallbackURLs list.
A redirect URI must:
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) --
Set to code to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.
Set to token to specify that the client should get the access token (and, optionally, ID token, based on scopes) directly.
AllowedOAuthScopes (list) --
A list of allowed OAuth scopes. Currently supported values are "phone" , "email" , "openid" , and "Cognito" .
AllowedOAuthFlowsUserPoolClient (boolean) --
Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
AnalyticsConfiguration (dict) --
The Amazon Pinpoint analytics configuration for the user pool client.
ApplicationId (string) --
The application ID for an Amazon Pinpoint application.
RoleArn (string) --
The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId (string) --
The external ID.
UserDataShared (boolean) --
If UserDataShared is true , Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
Creates a new domain for a user pool.
See also: AWS API Documentation
Request Syntax
response = client.create_user_pool_domain(
Domain='string',
UserPoolId='string',
CustomDomainConfig={
'CertificateArn': 'string'
}
)
[REQUIRED]
The domain string.
[REQUIRED]
The user pool ID.
The configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.
Provide this parameter only if you want to use a custom domain for your user pool. Otherwise, you can exclude this parameter and use the Amazon Cognito hosted domain instead.
For more information about the hosted domain and custom domains, see Configuring a User Pool Domain .
The Amazon Resource Name (ARN) of an AWS Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.
dict
Response Syntax
{
'CloudFrontDomain': 'string'
}
Response Structure
(dict) --
CloudFrontDomain (string) --
The Amazon CloudFront endpoint that you use as the target of the alias that you set up with your Domain Name Service (DNS) provider.
Deletes a group. Currently only groups with no members can be deleted.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.delete_group(
GroupName='string',
UserPoolId='string'
)
[REQUIRED]
The name of the group.
[REQUIRED]
The user pool ID for the user pool.
None
Deletes an identity provider for a user pool.
See also: AWS API Documentation
Request Syntax
response = client.delete_identity_provider(
UserPoolId='string',
ProviderName='string'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The identity provider name.
None
Deletes a resource server.
See also: AWS API Documentation
Request Syntax
response = client.delete_resource_server(
UserPoolId='string',
Identifier='string'
)
[REQUIRED]
The user pool ID for the user pool that hosts the resource server.
[REQUIRED]
The identifier for the resource server.
None
Allows a user to delete himself or herself.
See also: AWS API Documentation
Request Syntax
response = client.delete_user(
AccessToken='string'
)
[REQUIRED]
The access token from a request to delete a user.
Deletes the attributes for a user.
See also: AWS API Documentation
Request Syntax
response = client.delete_user_attributes(
UserAttributeNames=[
'string',
],
AccessToken='string'
)
[REQUIRED]
An array of strings representing the user attribute names you wish to delete.
For custom attributes, you must prepend the custom: prefix to the attribute name.
[REQUIRED]
The access token used in the request to delete user attributes.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server to delete user attributes.
Deletes the specified Amazon Cognito user pool.
See also: AWS API Documentation
Request Syntax
response = client.delete_user_pool(
UserPoolId='string'
)
[REQUIRED]
The user pool ID for the user pool you want to delete.
Allows the developer to delete the user pool client.
See also: AWS API Documentation
Request Syntax
response = client.delete_user_pool_client(
UserPoolId='string',
ClientId='string'
)
[REQUIRED]
The user pool ID for the user pool where you want to delete the client.
[REQUIRED]
The app client ID of the app associated with the user pool.
None
Deletes a domain for a user pool.
See also: AWS API Documentation
Request Syntax
response = client.delete_user_pool_domain(
Domain='string',
UserPoolId='string'
)
[REQUIRED]
The domain string.
[REQUIRED]
The user pool ID.
dict
Response Syntax
{}
Response Structure
Gets information about a specific identity provider.
See also: AWS API Documentation
Request Syntax
response = client.describe_identity_provider(
UserPoolId='string',
ProviderName='string'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The identity provider name.
dict
Response Syntax
{
'IdentityProvider': {
'UserPoolId': 'string',
'ProviderName': 'string',
'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'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 that was deleted.
UserPoolId (string) --
The user pool ID.
ProviderName (string) --
The identity provider name.
ProviderType (string) --
The identity provider type.
ProviderDetails (dict) --
The identity provider details, such as MetadataURL and MetadataFile .
AttributeMapping (dict) --
A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers (list) --
A list of identity provider identifiers.
LastModifiedDate (datetime) --
The date the identity provider was last modified.
CreationDate (datetime) --
The date the identity provider was created.
Describes a resource server.
See also: AWS API Documentation
Request Syntax
response = client.describe_resource_server(
UserPoolId='string',
Identifier='string'
)
[REQUIRED]
The user pool ID for the user pool that hosts the resource server.
[REQUIRED]
The identifier for the resource server
dict
Response Syntax
{
'ResourceServer': {
'UserPoolId': 'string',
'Identifier': 'string',
'Name': 'string',
'Scopes': [
{
'ScopeName': 'string',
'ScopeDescription': 'string'
},
]
}
}
Response Structure
(dict) --
ResourceServer (dict) --
The resource server.
UserPoolId (string) --
The user pool ID for the user pool that hosts the resource server.
Identifier (string) --
The identifier for the resource server.
Name (string) --
The name of the resource server.
Scopes (list) --
A list of scopes that are defined for the resource server.
(dict) --
A resource server scope.
ScopeName (string) --
The name of the scope.
ScopeDescription (string) --
A description of the scope.
Describes the risk configuration.
See also: AWS API Documentation
Request Syntax
response = client.describe_risk_configuration(
UserPoolId='string',
ClientId='string'
)
[REQUIRED]
The user pool ID.
dict
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 risk configuration.
UserPoolId (string) --
The user pool ID.
ClientId (string) --
The app client ID.
CompromisedCredentialsRiskConfiguration (dict) --
The compromised credentials risk configuration object including the EventFilter and the EventAction
EventFilter (list) --
Perform the action for these events. The default is to perform all events if no event filter is specified.
Actions (dict) --
The compromised credentials risk configuration actions.
EventAction (string) --
The event action.
AccountTakeoverRiskConfiguration (dict) --
The account takeover risk configuration object including the NotifyConfiguration object and Actions to take in the case of an account takeover.
NotifyConfiguration (dict) --
The notify configuration used to construct email notifications.
From (string) --
The email address that is sending the email. It must be either individually verified with Amazon SES, or from a domain that has been verified with Amazon SES.
ReplyTo (string) --
The destination to which the receiver of an email should reply to.
SourceArn (string) --
The Amazon Resource Name (ARN) of the identity that is associated with the sending authorization policy. It permits Amazon Cognito to send for the email address specified in the From parameter.
BlockEmail (dict) --
Email template used when a detected risk event is blocked.
Subject (string) --
The subject.
HtmlBody (string) --
The HTML body.
TextBody (string) --
The text body.
NoActionEmail (dict) --
The email template used when a detected risk event is allowed.
Subject (string) --
The subject.
HtmlBody (string) --
The HTML body.
TextBody (string) --
The text body.
MfaEmail (dict) --
The MFA email template used when MFA is challenged as part of a detected risk.
Subject (string) --
The subject.
HtmlBody (string) --
The HTML body.
TextBody (string) --
The text body.
Actions (dict) --
Account takeover risk configuration actions
LowAction (dict) --
Action to take for a low risk.
Notify (boolean) --
Flag specifying whether to send a notification.
EventAction (string) --
The event action.
MediumAction (dict) --
Action to take for a medium risk.
Notify (boolean) --
Flag specifying whether to send a notification.
EventAction (string) --
The event action.
HighAction (dict) --
Action to take for a high risk.
Notify (boolean) --
Flag specifying whether to send a notification.
EventAction (string) --
The event action.
RiskExceptionConfiguration (dict) --
The configuration to override the risk decision.
BlockedIPRangeList (list) --
Overrides the risk decision to always block the pre-authentication requests. The IP range is in CIDR notation: a compact representation of an IP address and its associated routing prefix.
SkippedIPRangeList (list) --
Risk detection is not performed on the IP addresses in the range list. The IP range is in CIDR notation.
LastModifiedDate (datetime) --
The last modified date.
Describes the user import job.
See also: AWS API Documentation
Request Syntax
response = client.describe_user_import_job(
UserPoolId='string',
JobId='string'
)
[REQUIRED]
The user pool ID for the user pool that the users are being imported into.
[REQUIRED]
The job ID for the user import job.
dict
Response Syntax
{
'UserImportJob': {
'JobName': 'string',
'JobId': 'string',
'UserPoolId': 'string',
'PreSignedUrl': 'string',
'CreationDate': datetime(2015, 1, 1),
'StartDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
'CloudWatchLogsRoleArn': 'string',
'ImportedUsers': 123,
'SkippedUsers': 123,
'FailedUsers': 123,
'CompletionMessage': 'string'
}
}
Response Structure
(dict) --
Represents the response from the server to the request to describe the user import job.
UserImportJob (dict) --
The job object that represents the user import job.
JobName (string) --
The job name for the user import job.
JobId (string) --
The job ID for the user import job.
UserPoolId (string) --
The user pool ID for the user pool that the users are being imported into.
PreSignedUrl (string) --
The pre-signed URL to be used to upload the .csv file.
CreationDate (datetime) --
The date the user import job was created.
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:
CloudWatchLogsRoleArn (string) --
The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.
ImportedUsers (integer) --
The number of users that were successfully imported.
SkippedUsers (integer) --
The number of users that were skipped.
FailedUsers (integer) --
The number of users that could not be imported.
CompletionMessage (string) --
The message returned when the user import job is completed.
Returns the configuration information and metadata of the specified user pool.
See also: AWS API Documentation
Request Syntax
response = client.describe_user_pool(
UserPoolId='string'
)
[REQUIRED]
The user pool ID for the user pool you want to describe.
{
'UserPool': {
'Id': 'string',
'Name': 'string',
'Policies': {
'PasswordPolicy': {
'MinimumLength': 123,
'RequireUppercase': True|False,
'RequireLowercase': True|False,
'RequireNumbers': True|False,
'RequireSymbols': True|False,
'TemporaryPasswordValidityDays': 123
}
},
'LambdaConfig': {
'PreSignUp': 'string',
'CustomMessage': 'string',
'PostConfirmation': 'string',
'PreAuthentication': 'string',
'PostAuthentication': 'string',
'DefineAuthChallenge': 'string',
'CreateAuthChallenge': 'string',
'VerifyAuthChallengeResponse': 'string',
'PreTokenGeneration': 'string',
'UserMigration': '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',
'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL',
'DeviceConfiguration': {
'ChallengeRequiredOnNewDevice': True|False,
'DeviceOnlyRememberedOnUserPrompt': True|False
},
'EstimatedNumberOfUsers': 123,
'EmailConfiguration': {
'SourceArn': 'string',
'ReplyToEmailAddress': 'string',
'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER'
},
'SmsConfiguration': {
'SnsCallerArn': 'string',
'ExternalId': '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'
},
'Arn': 'string'
}
}
Response Structure
Represents the response to describe the user pool.
The container of metadata returned by the server to describe the pool.
The ID of the user pool.
The name of the user pool.
The policies associated with the user pool.
The password policy.
The minimum length of the password policy that you have set. Cannot be less than 6.
In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.
In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.
In the password policy that you have set, refers to whether you have required users to use at least one number in their password.
In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.
The AWS Lambda triggers associated with the user pool.
A pre-registration AWS Lambda trigger.
A custom Message AWS Lambda trigger.
A post-confirmation AWS Lambda trigger.
A pre-authentication AWS Lambda trigger.
A post-authentication AWS Lambda trigger.
Defines the authentication challenge.
Creates an authentication challenge.
Verifies the authentication challenge response.
A Lambda trigger that is invoked before token generation.
The user migration Lambda config type.
The status of a user pool.
The date the user pool was last modified.
The date the user pool was created.
A container with the schema attributes of a user pool.
Contains information about the schema attribute.
A schema attribute of the name type.
The attribute data type.
Specifies whether the attribute type is developer only.
Specifies whether the value of the attribute can be changed.
For any user pool attribute that's mapped to an identity provider attribute, you must set this parameter to true . Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. 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 .
Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.
Specifies the constraints for an attribute of the number type.
The minimum value of an attribute that is of the number data type.
The maximum value of an attribute that is of the number data type.
Specifies the constraints for an attribute of the string type.
The minimum length.
The maximum length.
Specifies the attributes that are auto-verified in a user pool.
Specifies the attributes that are aliased in a user pool.
Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.
The contents of the SMS verification message.
The contents of the email verification message.
The subject of the email verification message.
The template for verification messages.
The SMS message template.
The email message template.
The subject line for the email message template.
The email message template for sending a confirmation link to the user.
The subject line for the email message template for sending a confirmation link to the user.
The default email option.
The contents of the SMS authentication message.
Can be one of the following values:
The device configuration.
Indicates whether a challenge is required on a new device. Only applicable to a new device.
If true, a device is only remembered on user prompt.
A number estimating the size of the user pool.
The email configuration.
The Amazon Resource Name (ARN) of a verified email address in Amazon SES. This email address is used in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:
The destination to which the receiver of the email should reply to.
Specifies whether Amazon Cognito emails your users by using its built-in email functionality or your Amazon SES 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 below 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 Amazon Cognito in the Amazon Cognito Developer Guide .
The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the 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 AWS account.
If you use this option, you must 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 IAM role, in your AWS account. This role contains the permissions that allow Amazon Cognito to access Amazon SES and send email messages with your 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 .
The SMS configuration.
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
The external ID.
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.
The reason why the SMS configuration cannot send the messages to your users.
The reason why the email configuration cannot send the messages to your users.
Holds the domain prefix if the user pool has a domain associated with it.
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. For example: auth.example.com .
For more information about adding a custom domain to your user pool, see Using Your Own Domain for the Hosted UI .
The configuration for AdminCreateUser requests.
Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.
The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this parameter is 7.
Note
If you set a value for TemporaryPasswordValidityDays in PasswordPolicy , that value will be used and UnusedAccountValidityDays will be deprecated for that user pool.
The message template to be used for the welcome message to new users.
See also Customizing User Invitation Messages .
The message template for SMS messages.
The message template for email messages.
The subject line for email messages.
The user pool add-ons.
The advanced security mode.
The Amazon Resource Name (ARN) for the user pool.
Client method for returning the configuration information and metadata of the specified user pool app client.
See also: AWS API Documentation
Request Syntax
response = client.describe_user_pool_client(
UserPoolId='string',
ClientId='string'
)
[REQUIRED]
The user pool ID for the user pool you want to describe.
[REQUIRED]
The app client ID of the app associated with the user pool.
dict
Response Syntax
{
'UserPoolClient': {
'UserPoolId': 'string',
'ClientName': 'string',
'ClientId': 'string',
'ClientSecret': 'string',
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1),
'RefreshTokenValidity': 123,
'ReadAttributes': [
'string',
],
'WriteAttributes': [
'string',
],
'ExplicitAuthFlows': [
'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH',
],
'SupportedIdentityProviders': [
'string',
],
'CallbackURLs': [
'string',
],
'LogoutURLs': [
'string',
],
'DefaultRedirectURI': 'string',
'AllowedOAuthFlows': [
'code'|'implicit'|'client_credentials',
],
'AllowedOAuthScopes': [
'string',
],
'AllowedOAuthFlowsUserPoolClient': True|False,
'AnalyticsConfiguration': {
'ApplicationId': 'string',
'RoleArn': 'string',
'ExternalId': 'string',
'UserDataShared': True|False
}
}
}
Response Structure
(dict) --
Represents the response from the server from a request to describe the user pool client.
UserPoolClient (dict) --
The user pool client from a server response to describe the user pool client.
UserPoolId (string) --
The user pool ID for the user pool client.
ClientName (string) --
The client name from the user pool request of the client type.
ClientId (string) --
The ID of the client associated with the user pool.
ClientSecret (string) --
The client secret from the user pool request of the client type.
LastModifiedDate (datetime) --
The date the user pool client was last modified.
CreationDate (datetime) --
The date the user pool client was created.
RefreshTokenValidity (integer) --
The time limit, in days, after which the refresh token is no longer valid and cannot be used.
ReadAttributes (list) --
The Read-only attributes.
WriteAttributes (list) --
The writeable attributes.
ExplicitAuthFlows (list) --
The explicit authentication flows.
SupportedIdentityProviders (list) --
A list of provider names for the identity providers that are supported on this client.
CallbackURLs (list) --
A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
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.
LogoutURLs (list) --
A list of allowed logout URLs for the identity providers.
DefaultRedirectURI (string) --
The default redirect URI. Must be in the CallbackURLs list.
A redirect URI must:
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) --
Set to code to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.
Set to token to specify that the client should get the access token (and, optionally, ID token, based on scopes) directly.
AllowedOAuthScopes (list) --
A list of allowed OAuth scopes. Currently supported values are "phone" , "email" , "openid" , and "Cognito" .
AllowedOAuthFlowsUserPoolClient (boolean) --
Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
AnalyticsConfiguration (dict) --
The Amazon Pinpoint analytics configuration for the user pool client.
ApplicationId (string) --
The application ID for an Amazon Pinpoint application.
RoleArn (string) --
The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId (string) --
The external ID.
UserDataShared (boolean) --
If UserDataShared is true , Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
Gets information about a domain.
See also: AWS API Documentation
Request Syntax
response = client.describe_user_pool_domain(
Domain='string'
)
[REQUIRED]
The domain string.
{
'DomainDescription': {
'UserPoolId': 'string',
'AWSAccountId': 'string',
'Domain': 'string',
'S3Bucket': 'string',
'CloudFrontDistribution': 'string',
'Version': 'string',
'Status': 'CREATING'|'DELETING'|'UPDATING'|'ACTIVE'|'FAILED',
'CustomDomainConfig': {
'CertificateArn': 'string'
}
}
}
Response Structure
A domain description object containing information about the domain.
The user pool ID.
The AWS account ID for the user pool owner.
The domain string.
The S3 bucket where the static files for this domain are stored.
The ARN of the CloudFront distribution.
The app version.
The domain status.
The configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.
The Amazon Resource Name (ARN) of an AWS Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.
Forgets the specified device.
See also: AWS API Documentation
Request Syntax
response = client.forget_device(
AccessToken='string',
DeviceKey='string'
)
[REQUIRED]
The device key.
None
Calling this API causes a message to be sent to the end user with a confirmation code that is required to change the user's password. For the Username parameter, you can use the username or user alias. If a verified phone number exists for the user, the confirmation code is sent to the phone number. Otherwise, if a verified email exists, the confirmation code is sent to the email. If neither a verified phone number nor a verified email exists, InvalidParameterException is thrown. To use the confirmation code for resetting the password, call .
See also: AWS API Documentation
Request Syntax
response = client.forgot_password(
ClientId='string',
SecretHash='string',
UserContextData={
'EncodedData': 'string'
},
Username='string',
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
}
)
[REQUIRED]
The ID of the client associated with the user pool.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
[REQUIRED]
The user name of the user for whom you want to enter a code to reset a forgotten password.
The Amazon Pinpoint analytics metadata for collecting metrics for ForgotPassword calls.
The endpoint ID.
dict
Response Syntax
{
'CodeDeliveryDetails': {
'Destination': 'string',
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
}
}
Response Structure
(dict) --
Respresents the response from the server regarding the request to reset a password.
CodeDeliveryDetails (dict) --
The code delivery details returned by the server in response to the request to reset a password.
Destination (string) --
The destination for the code delivery details.
DeliveryMedium (string) --
The delivery medium (email message or phone number).
AttributeName (string) --
The attribute name.
Generate a presigned url given a client, its method, and arguments
The presigned url
Gets the header information for the .csv file to be used as input for the user import job.
See also: AWS API Documentation
Request Syntax
response = client.get_csv_header(
UserPoolId='string'
)
[REQUIRED]
The user pool ID for the user pool that the users are to be imported into.
{
'UserPoolId': 'string',
'CSVHeader': [
'string',
]
}
Response Structure
Represents the response from the server to the request to get the header information for the .csv file for the user import job.
The user pool ID for the user pool that the users are to be imported into.
The header information for the .csv file for the user import job.
Gets the device.
See also: AWS API Documentation
Request Syntax
response = client.get_device(
DeviceKey='string',
AccessToken='string'
)
[REQUIRED]
The device key.
dict
Response Syntax
{
'Device': {
'DeviceKey': 'string',
'DeviceAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'DeviceCreateDate': datetime(2015, 1, 1),
'DeviceLastModifiedDate': datetime(2015, 1, 1),
'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Gets the device response.
Device (dict) --
The device.
DeviceKey (string) --
The device key.
DeviceAttributes (list) --
The device attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
DeviceCreateDate (datetime) --
The creation date of the device.
DeviceLastModifiedDate (datetime) --
The last modified date of the device.
DeviceLastAuthenticatedDate (datetime) --
The date in which the device was last authenticated.
Gets a group.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.get_group(
GroupName='string',
UserPoolId='string'
)
[REQUIRED]
The name of the group.
[REQUIRED]
The user pool ID for the user pool.
dict
Response Syntax
{
'Group': {
'GroupName': 'string',
'UserPoolId': 'string',
'Description': 'string',
'RoleArn': 'string',
'Precedence': 123,
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Group (dict) --
The group object for the group.
GroupName (string) --
The name of the group.
UserPoolId (string) --
The user pool ID for the user pool.
Description (string) --
A string containing the description of the group.
RoleArn (string) --
The role ARN for the group.
Precedence (integer) --
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
LastModifiedDate (datetime) --
The date the group was last modified.
CreationDate (datetime) --
The date the group was created.
Gets the specified identity provider.
See also: AWS API Documentation
Request Syntax
response = client.get_identity_provider_by_identifier(
UserPoolId='string',
IdpIdentifier='string'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The identity provider ID.
dict
Response Syntax
{
'IdentityProvider': {
'UserPoolId': 'string',
'ProviderName': 'string',
'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'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 object.
UserPoolId (string) --
The user pool ID.
ProviderName (string) --
The identity provider name.
ProviderType (string) --
The identity provider type.
ProviderDetails (dict) --
The identity provider details, such as MetadataURL and MetadataFile .
AttributeMapping (dict) --
A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers (list) --
A list of identity provider identifiers.
LastModifiedDate (datetime) --
The date the identity provider was last modified.
CreationDate (datetime) --
The date the identity provider was created.
Create a paginator for an operation.
This method takes a user pool ID, and returns the signing certificate.
See also: AWS API Documentation
Request Syntax
response = client.get_signing_certificate(
UserPoolId='string'
)
[REQUIRED]
The user pool ID.
{
'Certificate': 'string'
}
Response Structure
Response from Cognito for a signing certificate request.
The signing certificate.
Gets the UI Customization information for a particular app client's app UI, if there is something set. If nothing is set for the particular client, but there is an existing pool level customization (app clientId will be ALL ), then that is returned. If nothing is present, then an empty shape is returned.
See also: AWS API Documentation
Request Syntax
response = client.get_ui_customization(
UserPoolId='string',
ClientId='string'
)
[REQUIRED]
The user pool ID for the user pool.
dict
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) --
The UI customization information.
UserPoolId (string) --
The user pool ID for the user pool.
ClientId (string) --
The client ID for the client app.
ImageUrl (string) --
The logo image for the UI customization.
CSS (string) --
The CSS values in the UI customization.
CSSVersion (string) --
The CSS version number.
LastModifiedDate (datetime) --
The last-modified date for the UI customization.
CreationDate (datetime) --
The creation date for the UI customization.
Gets the user attributes and metadata for a user.
See also: AWS API Documentation
Request Syntax
response = client.get_user(
AccessToken='string'
)
[REQUIRED]
The access token returned by the server response to get information about the user.
{
'Username': 'string',
'UserAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'MFAOptions': [
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
],
'PreferredMfaSetting': 'string',
'UserMFASettingList': [
'string',
]
}
Response Structure
Represents the response from the server from the request to get information about the user.
The user name of the user you wish to retrieve from the get user request.
An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the custom: prefix to the attribute name.
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
Specifies the options for MFA (e.g., email or phone number).
Specifies the different settings for multi-factor authentication (MFA).
The delivery medium (email message or SMS message) to send the MFA code.
The attribute name of the MFA option type.
The user's preferred MFA setting.
The list of the user's MFA settings.
Gets the user attribute verification code for the specified attribute name.
See also: AWS API Documentation
Request Syntax
response = client.get_user_attribute_verification_code(
AccessToken='string',
AttributeName='string'
)
[REQUIRED]
The access token returned by the server response to get the user attribute verification code.
[REQUIRED]
The attribute name returned by the server response to get the user attribute verification code.
dict
Response Syntax
{
'CodeDeliveryDetails': {
'Destination': 'string',
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
}
}
Response Structure
(dict) --
The verification code response returned by the server response to get the user attribute verification code.
CodeDeliveryDetails (dict) --
The code delivery details returned by the server in response to the request to get the user attribute verification code.
Destination (string) --
The destination for the code delivery details.
DeliveryMedium (string) --
The delivery medium (email message or phone number).
AttributeName (string) --
The attribute name.
Gets the user pool multi-factor authentication (MFA) configuration.
See also: AWS API Documentation
Request Syntax
response = client.get_user_pool_mfa_config(
UserPoolId='string'
)
[REQUIRED]
The user pool ID.
{
'SmsMfaConfiguration': {
'SmsAuthenticationMessage': 'string',
'SmsConfiguration': {
'SnsCallerArn': 'string',
'ExternalId': 'string'
}
},
'SoftwareTokenMfaConfiguration': {
'Enabled': True|False
},
'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL'
}
Response Structure
The SMS text message multi-factor (MFA) configuration.
The SMS authentication message.
The SMS configuration.
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
The external ID.
The software token multi-factor (MFA) configuration.
Specifies whether software token MFA is enabled.
The multi-factor (MFA) configuration.
Returns an object that can wait for some condition.
Signs out users from all devices.
See also: AWS API Documentation
Request Syntax
response = client.global_sign_out(
AccessToken='string'
)
[REQUIRED]
The access token.
{}
Response Structure
The response to the request to sign out all devices.
Initiates the authentication flow.
See also: AWS API Documentation
Request Syntax
response = client.initiate_auth(
AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'USER_PASSWORD_AUTH',
AuthParameters={
'string': 'string'
},
ClientMetadata={
'string': 'string'
},
ClientId='string',
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
},
UserContextData={
'EncodedData': 'string'
}
)
[REQUIRED]
The authentication flow for this call to execute. The API action will depend on this value. For example:
Valid values include:
ADMIN_NO_SRP_AUTH is not a valid value.
The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow :
This is a random key-value pair map which can contain any key and will be passed to your PreAuthentication Lambda trigger as-is. It can be used to implement additional validations around authentication.
[REQUIRED]
The app client ID.
The Amazon Pinpoint analytics metadata for collecting metrics for InitiateAuth calls.
The endpoint ID.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
dict
Response Syntax
{
'ChallengeName': 'SMS_MFA'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
'Session': 'string',
'ChallengeParameters': {
'string': 'string'
},
'AuthenticationResult': {
'AccessToken': 'string',
'ExpiresIn': 123,
'TokenType': 'string',
'RefreshToken': 'string',
'IdToken': 'string',
'NewDeviceMetadata': {
'DeviceKey': 'string',
'DeviceGroupKey': 'string'
}
}
}
Response Structure
(dict) --
Initiates the authentication response.
ChallengeName (string) --
The name of the challenge which you are responding to with this call. This is returned to you in the AdminInitiateAuth response if you need to pass another challenge.
Valid values include the following. Note that all of these challenges require USERNAME and SECRET_HASH (if applicable) in the parameters.
Session (string) --
The session which should be passed both ways in challenge-response calls to the service. If the or API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.
ChallengeParameters (dict) --
The challenge parameters. These are returned to you in the InitiateAuth response if you need to pass another challenge. The responses in this parameter should be used to compute inputs to the next call (RespondToAuthChallenge ).
All challenges require USERNAME and SECRET_HASH (if applicable).
AuthenticationResult (dict) --
The result of the authentication response. This is only returned if the caller does not need to pass another challenge. If the caller does need to pass another challenge before it gets tokens, ChallengeName , ChallengeParameters , and Session are returned.
AccessToken (string) --
The access token.
ExpiresIn (integer) --
The expiration period of the authentication result in seconds.
TokenType (string) --
The token type.
RefreshToken (string) --
The refresh token.
IdToken (string) --
The ID token.
NewDeviceMetadata (dict) --
The new device metadata from an authentication result.
DeviceKey (string) --
The device key.
DeviceGroupKey (string) --
The device group key.
Lists the devices.
See also: AWS API Documentation
Request Syntax
response = client.list_devices(
AccessToken='string',
Limit=123,
PaginationToken='string'
)
[REQUIRED]
The access tokens for the request to list devices.
dict
Response Syntax
{
'Devices': [
{
'DeviceKey': 'string',
'DeviceAttributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'DeviceCreateDate': datetime(2015, 1, 1),
'DeviceLastModifiedDate': datetime(2015, 1, 1),
'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
},
],
'PaginationToken': 'string'
}
Response Structure
(dict) --
Represents the response to list devices.
Devices (list) --
The devices returned in the list devices response.
(dict) --
The device type.
DeviceKey (string) --
The device key.
DeviceAttributes (list) --
The device attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
DeviceCreateDate (datetime) --
The creation date of the device.
DeviceLastModifiedDate (datetime) --
The last modified date of the device.
DeviceLastAuthenticatedDate (datetime) --
The date in which the device was last authenticated.
PaginationToken (string) --
The pagination token for the list device response.
Lists the groups associated with a user pool.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.list_groups(
UserPoolId='string',
Limit=123,
NextToken='string'
)
[REQUIRED]
The user pool ID for the user pool.
dict
Response Syntax
{
'Groups': [
{
'GroupName': 'string',
'UserPoolId': 'string',
'Description': 'string',
'RoleArn': 'string',
'Precedence': 123,
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Groups (list) --
The group objects for the groups.
(dict) --
The group type.
GroupName (string) --
The name of the group.
UserPoolId (string) --
The user pool ID for the user pool.
Description (string) --
A string containing the description of the group.
RoleArn (string) --
The role ARN for the group.
Precedence (integer) --
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
LastModifiedDate (datetime) --
The date the group was last modified.
CreationDate (datetime) --
The date the group was created.
NextToken (string) --
An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Lists information about all identity providers for a user pool.
See also: AWS API Documentation
Request Syntax
response = client.list_identity_providers(
UserPoolId='string',
MaxResults=123,
NextToken='string'
)
[REQUIRED]
The user pool ID.
dict
Response Syntax
{
'Providers': [
{
'ProviderName': 'string',
'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'OIDC',
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Providers (list) --
A list of identity provider objects.
(dict) --
A container for identity provider details.
ProviderName (string) --
The identity provider name.
ProviderType (string) --
The identity provider type.
LastModifiedDate (datetime) --
The date the provider was last modified.
CreationDate (datetime) --
The date the provider was added to the user pool.
NextToken (string) --
A pagination token.
Lists the resource servers for a user pool.
See also: AWS API Documentation
Request Syntax
response = client.list_resource_servers(
UserPoolId='string',
MaxResults=123,
NextToken='string'
)
[REQUIRED]
The user pool ID for the user pool.
dict
Response Syntax
{
'ResourceServers': [
{
'UserPoolId': 'string',
'Identifier': 'string',
'Name': 'string',
'Scopes': [
{
'ScopeName': 'string',
'ScopeDescription': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
ResourceServers (list) --
The resource servers.
(dict) --
A container for information about a resource server for a user pool.
UserPoolId (string) --
The user pool ID for the user pool that hosts the resource server.
Identifier (string) --
The identifier for the resource server.
Name (string) --
The name of the resource server.
Scopes (list) --
A list of scopes that are defined for the resource server.
(dict) --
A resource server scope.
ScopeName (string) --
The name of the scope.
ScopeDescription (string) --
A description of the scope.
NextToken (string) --
A pagination token.
Lists the tags that are assigned to an Amazon Cognito 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.
You can use this action up to 10 times per second, per account.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
ResourceArn='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the user pool that the tags are assigned to.
{
'Tags': {
'string': 'string'
}
}
Response Structure
The tags that are assigned to the user pool.
Lists the user import jobs.
See also: AWS API Documentation
Request Syntax
response = client.list_user_import_jobs(
UserPoolId='string',
MaxResults=123,
PaginationToken='string'
)
[REQUIRED]
The user pool ID for the user pool that the users are being imported into.
[REQUIRED]
The maximum number of import jobs you want the request to return.
dict
Response Syntax
{
'UserImportJobs': [
{
'JobName': 'string',
'JobId': 'string',
'UserPoolId': 'string',
'PreSignedUrl': 'string',
'CreationDate': datetime(2015, 1, 1),
'StartDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
'CloudWatchLogsRoleArn': 'string',
'ImportedUsers': 123,
'SkippedUsers': 123,
'FailedUsers': 123,
'CompletionMessage': 'string'
},
],
'PaginationToken': 'string'
}
Response Structure
(dict) --
Represents the response from the server to the request to list the user import jobs.
UserImportJobs (list) --
The user import jobs.
(dict) --
The user import job type.
JobName (string) --
The job name for the user import job.
JobId (string) --
The job ID for the user import job.
UserPoolId (string) --
The user pool ID for the user pool that the users are being imported into.
PreSignedUrl (string) --
The pre-signed URL to be used to upload the .csv file.
CreationDate (datetime) --
The date the user import job was created.
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:
CloudWatchLogsRoleArn (string) --
The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.
ImportedUsers (integer) --
The number of users that were successfully imported.
SkippedUsers (integer) --
The number of users that were skipped.
FailedUsers (integer) --
The number of users that could not be imported.
CompletionMessage (string) --
The message returned when the user import job is completed.
PaginationToken (string) --
An identifier that can be used to return the next set of user import jobs in the list.
Lists the clients that have been created for the specified user pool.
See also: AWS API Documentation
Request Syntax
response = client.list_user_pool_clients(
UserPoolId='string',
MaxResults=123,
NextToken='string'
)
[REQUIRED]
The user pool ID for the user pool where you want to list user pool clients.
dict
Response Syntax
{
'UserPoolClients': [
{
'ClientId': 'string',
'UserPoolId': 'string',
'ClientName': 'string'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents the response from the server that lists user pool clients.
UserPoolClients (list) --
The user pool clients in the response that lists user pool clients.
(dict) --
The description of the user pool client.
ClientId (string) --
The ID of the client associated with the user pool.
UserPoolId (string) --
The user pool ID for the user pool where you want to describe the user pool client.
ClientName (string) --
The client name from the user pool client description.
NextToken (string) --
An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Lists the user pools associated with an AWS account.
See also: AWS API Documentation
Request Syntax
response = client.list_user_pools(
NextToken='string',
MaxResults=123
)
[REQUIRED]
The maximum number of results you want the request to return when listing the user pools.
dict
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'
},
'Status': 'Enabled'|'Disabled',
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Represents the response to list user pools.
UserPools (list) --
The user pools from the response to list users.
(dict) --
A user pool description.
Id (string) --
The ID in a user pool description.
Name (string) --
The name in a user pool description.
LambdaConfig (dict) --
The AWS Lambda configuration information in a user pool description.
PreSignUp (string) --
A pre-registration AWS Lambda trigger.
CustomMessage (string) --
A custom Message AWS Lambda trigger.
PostConfirmation (string) --
A post-confirmation AWS Lambda trigger.
PreAuthentication (string) --
A pre-authentication AWS Lambda trigger.
PostAuthentication (string) --
A post-authentication AWS Lambda trigger.
DefineAuthChallenge (string) --
Defines the authentication challenge.
CreateAuthChallenge (string) --
Creates an authentication challenge.
VerifyAuthChallengeResponse (string) --
Verifies the authentication challenge response.
PreTokenGeneration (string) --
A Lambda trigger that is invoked before token generation.
UserMigration (string) --
The user migration Lambda config type.
Status (string) --
The user pool status in a user pool description.
LastModifiedDate (datetime) --
The date the user pool description was last modified.
CreationDate (datetime) --
The date the user pool description was created.
NextToken (string) --
An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Lists the users in the Amazon Cognito user pool.
See also: AWS API Documentation
Request Syntax
response = client.list_users(
UserPoolId='string',
AttributesToGet=[
'string',
],
Limit=123,
PaginationToken='string',
Filter='string'
)
[REQUIRED]
The user pool ID for the user pool on which the search should be performed.
An array of strings, where each string is the name of a user attribute to be returned for each user in the search results. If the array is null, all attributes are returned.
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"".
If the filter string is empty, ListUsers returns all users in the user pool.
You can only search for the following standard attributes:
Custom attributes are not searchable.
For more information, see Searching for Users Using the ListUsers API and Examples of Using the ListUsers API in the Amazon Cognito Developer Guide .
dict
Response Syntax
{
'Users': [
{
'Username': 'string',
'Attributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'UserCreateDate': datetime(2015, 1, 1),
'UserLastModifiedDate': datetime(2015, 1, 1),
'Enabled': True|False,
'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
'MFAOptions': [
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
]
},
],
'PaginationToken': 'string'
}
Response Structure
(dict) --
The response from the request to list users.
Users (list) --
The users returned in the request to list users.
(dict) --
The user type.
Username (string) --
The user name of the user you wish to describe.
Attributes (list) --
A container with information about the user type attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
UserCreateDate (datetime) --
The creation date of the user.
UserLastModifiedDate (datetime) --
The last modified date of the user.
Enabled (boolean) --
Specifies whether the user is enabled.
UserStatus (string) --
The user status. Can be one of the following:
MFAOptions (list) --
The MFA options for the user.
(dict) --
Specifies the different settings for multi-factor authentication (MFA).
DeliveryMedium (string) --
The delivery medium (email message or SMS message) to send the MFA code.
AttributeName (string) --
The attribute name of the MFA option type.
PaginationToken (string) --
An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Lists the users in the specified group.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.list_users_in_group(
UserPoolId='string',
GroupName='string',
Limit=123,
NextToken='string'
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
The name of the group.
dict
Response Syntax
{
'Users': [
{
'Username': 'string',
'Attributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'UserCreateDate': datetime(2015, 1, 1),
'UserLastModifiedDate': datetime(2015, 1, 1),
'Enabled': True|False,
'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
'MFAOptions': [
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
Users (list) --
The users returned in the request to list users.
(dict) --
The user type.
Username (string) --
The user name of the user you wish to describe.
Attributes (list) --
A container with information about the user type attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
UserCreateDate (datetime) --
The creation date of the user.
UserLastModifiedDate (datetime) --
The last modified date of the user.
Enabled (boolean) --
Specifies whether the user is enabled.
UserStatus (string) --
The user status. Can be one of the following:
MFAOptions (list) --
The MFA options for the user.
(dict) --
Specifies the different settings for multi-factor authentication (MFA).
DeliveryMedium (string) --
The delivery medium (email message or SMS message) to send the MFA code.
AttributeName (string) --
The attribute name of the MFA option type.
NextToken (string) --
An identifier that was returned from the previous call to this operation, which can be used to return the next set of items in the list.
Resends the confirmation (for confirmation of registration) to a specific user in the user pool.
See also: AWS API Documentation
Request Syntax
response = client.resend_confirmation_code(
ClientId='string',
SecretHash='string',
UserContextData={
'EncodedData': 'string'
},
Username='string',
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
}
)
[REQUIRED]
The ID of the client associated with the user pool.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
[REQUIRED]
The user name of the user to whom you wish to resend a confirmation code.
The Amazon Pinpoint analytics metadata for collecting metrics for ResendConfirmationCode calls.
The endpoint ID.
dict
Response Syntax
{
'CodeDeliveryDetails': {
'Destination': 'string',
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
}
}
Response Structure
(dict) --
The response from the server when the Amazon Cognito Your User Pools service makes the request to resend a confirmation code.
CodeDeliveryDetails (dict) --
The code delivery details returned by the server in response to the request to resend the confirmation code.
Destination (string) --
The destination for the code delivery details.
DeliveryMedium (string) --
The delivery medium (email message or phone number).
AttributeName (string) --
The attribute name.
Responds to the authentication challenge.
See also: AWS API Documentation
Request Syntax
response = client.respond_to_auth_challenge(
ClientId='string',
ChallengeName='SMS_MFA'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
Session='string',
ChallengeResponses={
'string': 'string'
},
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
},
UserContextData={
'EncodedData': 'string'
}
)
[REQUIRED]
The app client ID.
[REQUIRED]
The challenge name. For more information, see .
ADMIN_NO_SRP_AUTH is not a valid value.
The challenge responses. These are inputs corresponding to the value of ChallengeName , for example:
The Amazon Pinpoint analytics metadata for collecting metrics for RespondToAuthChallenge calls.
The endpoint ID.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
dict
Response Syntax
{
'ChallengeName': 'SMS_MFA'|'SOFTWARE_TOKEN_MFA'|'SELECT_MFA_TYPE'|'MFA_SETUP'|'PASSWORD_VERIFIER'|'CUSTOM_CHALLENGE'|'DEVICE_SRP_AUTH'|'DEVICE_PASSWORD_VERIFIER'|'ADMIN_NO_SRP_AUTH'|'NEW_PASSWORD_REQUIRED',
'Session': 'string',
'ChallengeParameters': {
'string': 'string'
},
'AuthenticationResult': {
'AccessToken': 'string',
'ExpiresIn': 123,
'TokenType': 'string',
'RefreshToken': 'string',
'IdToken': 'string',
'NewDeviceMetadata': {
'DeviceKey': 'string',
'DeviceGroupKey': 'string'
}
}
}
Response Structure
(dict) --
The response to respond to the authentication challenge.
ChallengeName (string) --
The challenge name. For more information, see .
Session (string) --
The session which should be passed both ways in challenge-response calls to the service. If the or API call determines that the caller needs to go through another challenge, they return a session with other challenge parameters. This session should be passed as it is to the next RespondToAuthChallenge API call.
ChallengeParameters (dict) --
The challenge parameters. For more information, see .
AuthenticationResult (dict) --
The result returned by the server in response to the request to respond to the authentication challenge.
AccessToken (string) --
The access token.
ExpiresIn (integer) --
The expiration period of the authentication result in seconds.
TokenType (string) --
The token type.
RefreshToken (string) --
The refresh token.
IdToken (string) --
The ID token.
NewDeviceMetadata (dict) --
The new device metadata from an authentication result.
DeviceKey (string) --
The device key.
DeviceGroupKey (string) --
The device group key.
Configures actions on detected risks. To delete the risk configuration for UserPoolId or ClientId , pass null values for all four configuration types.
To enable Amazon Cognito advanced security features, update the user pool to include the UserPoolAddOns key``AdvancedSecurityMode`` .
See .
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',
]
}
)
[REQUIRED]
The user pool ID.
The app client ID. 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.
Otherwise, ClientId is mapped to the client. When the client ID is not null, the user pool configuration is overridden and the risk configuration for the client is used instead.
The compromised credentials risk configuration.
Perform the action for these events. The default is to perform all events if no event filter is specified.
The compromised credentials risk configuration actions.
The event action.
The account takeover risk configuration.
The notify configuration used to construct email notifications.
The email address that is sending the email. It must be either individually verified with Amazon SES, or from a domain that has been verified with Amazon SES.
The destination to which the receiver of an email should reply to.
The Amazon Resource Name (ARN) of the identity that is associated with the sending authorization policy. It permits Amazon Cognito to send for the email address specified in the From parameter.
Email template used when a detected risk event is blocked.
The subject.
The HTML body.
The text body.
The email template used when a detected risk event is allowed.
The subject.
The HTML body.
The text body.
The MFA email template used when MFA is challenged as part of a detected risk.
The subject.
The HTML body.
The text body.
Account takeover risk configuration actions
Action to take for a low risk.
Flag specifying whether to send a notification.
The event action.
Action to take for a medium risk.
Flag specifying whether to send a notification.
The event action.
Action to take for a high risk.
Flag specifying whether to send a notification.
The event action.
The configuration to override the risk decision.
Overrides the risk decision to always block the pre-authentication requests. The IP range is in CIDR notation: a compact representation of an IP address and its associated routing prefix.
Risk detection is not performed on the IP addresses in the range list. The IP range is in CIDR notation.
dict
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 risk configuration.
UserPoolId (string) --
The user pool ID.
ClientId (string) --
The app client ID.
CompromisedCredentialsRiskConfiguration (dict) --
The compromised credentials risk configuration object including the EventFilter and the EventAction
EventFilter (list) --
Perform the action for these events. The default is to perform all events if no event filter is specified.
Actions (dict) --
The compromised credentials risk configuration actions.
EventAction (string) --
The event action.
AccountTakeoverRiskConfiguration (dict) --
The account takeover risk configuration object including the NotifyConfiguration object and Actions to take in the case of an account takeover.
NotifyConfiguration (dict) --
The notify configuration used to construct email notifications.
From (string) --
The email address that is sending the email. It must be either individually verified with Amazon SES, or from a domain that has been verified with Amazon SES.
ReplyTo (string) --
The destination to which the receiver of an email should reply to.
SourceArn (string) --
The Amazon Resource Name (ARN) of the identity that is associated with the sending authorization policy. It permits Amazon Cognito to send for the email address specified in the From parameter.
BlockEmail (dict) --
Email template used when a detected risk event is blocked.
Subject (string) --
The subject.
HtmlBody (string) --
The HTML body.
TextBody (string) --
The text body.
NoActionEmail (dict) --
The email template used when a detected risk event is allowed.
Subject (string) --
The subject.
HtmlBody (string) --
The HTML body.
TextBody (string) --
The text body.
MfaEmail (dict) --
The MFA email template used when MFA is challenged as part of a detected risk.
Subject (string) --
The subject.
HtmlBody (string) --
The HTML body.
TextBody (string) --
The text body.
Actions (dict) --
Account takeover risk configuration actions
LowAction (dict) --
Action to take for a low risk.
Notify (boolean) --
Flag specifying whether to send a notification.
EventAction (string) --
The event action.
MediumAction (dict) --
Action to take for a medium risk.
Notify (boolean) --
Flag specifying whether to send a notification.
EventAction (string) --
The event action.
HighAction (dict) --
Action to take for a high risk.
Notify (boolean) --
Flag specifying whether to send a notification.
EventAction (string) --
The event action.
RiskExceptionConfiguration (dict) --
The configuration to override the risk decision.
BlockedIPRangeList (list) --
Overrides the risk decision to always block the pre-authentication requests. The IP range is in CIDR notation: a compact representation of an IP address and its associated routing prefix.
SkippedIPRangeList (list) --
Risk detection is not performed on the IP addresses in the range list. The IP range is in CIDR notation.
LastModifiedDate (datetime) --
The last modified date.
Sets the UI customization information for a user pool's built-in app UI.
You can specify app UI customization settings for a single client (with a specific clientId ) or for all clients (by setting the clientId to ALL ). If you specify ALL , the default configuration will be used for every client that has no UI customization set previously. If you specify UI customization settings for a particular client, it will no longer fall back to the ALL configuration.
Note
To use this API, your user pool must have a domain associated with it. Otherwise, there is no place to host the app's pages, and the service will throw an error.
See also: AWS API Documentation
Request Syntax
response = client.set_ui_customization(
UserPoolId='string',
ClientId='string',
CSS='string',
ImageFile=b'bytes'
)
[REQUIRED]
The user pool ID for the user pool.
dict
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) --
The UI customization information.
UserPoolId (string) --
The user pool ID for the user pool.
ClientId (string) --
The client ID for the client app.
ImageUrl (string) --
The logo image for the UI customization.
CSS (string) --
The CSS values in the UI customization.
CSSVersion (string) --
The CSS version number.
LastModifiedDate (datetime) --
The last-modified date for the UI customization.
CreationDate (datetime) --
The creation date for the UI customization.
Set the user's multi-factor authentication (MFA) method preference.
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
},
AccessToken='string'
)
The SMS text message multi-factor authentication (MFA) settings.
Specifies whether SMS text message MFA is enabled.
The preferred MFA method.
The time-based one-time password software token MFA settings.
Specifies whether software token MFA is enabled.
The preferred MFA method.
[REQUIRED]
The access token.
dict
Response Syntax
{}
Response Structure
Set the user pool MFA configuration.
See also: AWS API Documentation
Request Syntax
response = client.set_user_pool_mfa_config(
UserPoolId='string',
SmsMfaConfiguration={
'SmsAuthenticationMessage': 'string',
'SmsConfiguration': {
'SnsCallerArn': 'string',
'ExternalId': 'string'
}
},
SoftwareTokenMfaConfiguration={
'Enabled': True|False
},
MfaConfiguration='OFF'|'ON'|'OPTIONAL'
)
[REQUIRED]
The user pool ID.
The SMS text message MFA configuration.
The SMS authentication message.
The SMS configuration.
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
The external ID.
The software token MFA configuration.
Specifies whether software token MFA is enabled.
dict
Response Syntax
{
'SmsMfaConfiguration': {
'SmsAuthenticationMessage': 'string',
'SmsConfiguration': {
'SnsCallerArn': 'string',
'ExternalId': 'string'
}
},
'SoftwareTokenMfaConfiguration': {
'Enabled': True|False
},
'MfaConfiguration': 'OFF'|'ON'|'OPTIONAL'
}
Response Structure
(dict) --
SmsMfaConfiguration (dict) --
The SMS text message MFA configuration.
SmsAuthenticationMessage (string) --
The SMS authentication message.
SmsConfiguration (dict) --
The SMS configuration.
SnsCallerArn (string) --
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId (string) --
The external ID.
SoftwareTokenMfaConfiguration (dict) --
The software token MFA configuration.
Enabled (boolean) --
Specifies whether software token MFA is enabled.
MfaConfiguration (string) --
The MFA configuration.
Sets the user settings like multi-factor authentication (MFA). If MFA is to be removed for a particular attribute pass the attribute with code delivery as null. If null list is passed, all MFA options are removed.
See also: AWS API Documentation
Request Syntax
response = client.set_user_settings(
AccessToken='string',
MFAOptions=[
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
]
)
[REQUIRED]
The access token for the set user settings request.
[REQUIRED]
Specifies the options for MFA (e.g., email or phone number).
Specifies the different settings for multi-factor authentication (MFA).
The delivery medium (email message or SMS message) to send the MFA code.
The attribute name of the MFA option type.
dict
Response Syntax
{}
Response Structure
(dict) --
The response from the server for a set user settings request.
Registers the user in the specified user pool and creates a user name, password, and user attributes.
See also: AWS API Documentation
Request Syntax
response = client.sign_up(
ClientId='string',
SecretHash='string',
Username='string',
Password='string',
UserAttributes=[
{
'Name': 'string',
'Value': 'string'
},
],
ValidationData=[
{
'Name': 'string',
'Value': 'string'
},
],
AnalyticsMetadata={
'AnalyticsEndpointId': 'string'
},
UserContextData={
'EncodedData': 'string'
}
)
[REQUIRED]
The ID of the client associated with the user pool.
[REQUIRED]
The user name of the user you wish to register.
[REQUIRED]
The password of the user you wish to register.
An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the custom: prefix to the attribute name.
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
The validation data in the request to register a user.
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
The Amazon Pinpoint analytics metadata for collecting metrics for SignUp calls.
The endpoint ID.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
Contextual data such as the user's device fingerprint, IP address, or location used for evaluating the risk of an unexpected event by Amazon Cognito advanced security.
dict
Response Syntax
{
'UserConfirmed': True|False,
'CodeDeliveryDetails': {
'Destination': 'string',
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
'UserSub': 'string'
}
Response Structure
(dict) --
The response from the server for a registration request.
UserConfirmed (boolean) --
A response from the server indicating that a user registration has been confirmed.
CodeDeliveryDetails (dict) --
The code delivery details returned by the server response to the user registration request.
Destination (string) --
The destination for the code delivery details.
DeliveryMedium (string) --
The delivery medium (email message or phone number).
AttributeName (string) --
The attribute name.
UserSub (string) --
The UUID of the authenticated user. This is not the same as username .
Starts the user import.
See also: AWS API Documentation
Request Syntax
response = client.start_user_import_job(
UserPoolId='string',
JobId='string'
)
[REQUIRED]
The user pool ID for the user pool that the users are being imported into.
[REQUIRED]
The job ID for the user import job.
dict
Response Syntax
{
'UserImportJob': {
'JobName': 'string',
'JobId': 'string',
'UserPoolId': 'string',
'PreSignedUrl': 'string',
'CreationDate': datetime(2015, 1, 1),
'StartDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
'CloudWatchLogsRoleArn': 'string',
'ImportedUsers': 123,
'SkippedUsers': 123,
'FailedUsers': 123,
'CompletionMessage': 'string'
}
}
Response Structure
(dict) --
Represents the response from the server to the request to start the user import job.
UserImportJob (dict) --
The job object that represents the user import job.
JobName (string) --
The job name for the user import job.
JobId (string) --
The job ID for the user import job.
UserPoolId (string) --
The user pool ID for the user pool that the users are being imported into.
PreSignedUrl (string) --
The pre-signed URL to be used to upload the .csv file.
CreationDate (datetime) --
The date the user import job was created.
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:
CloudWatchLogsRoleArn (string) --
The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.
ImportedUsers (integer) --
The number of users that were successfully imported.
SkippedUsers (integer) --
The number of users that were skipped.
FailedUsers (integer) --
The number of users that could not be imported.
CompletionMessage (string) --
The message returned when the user import job is completed.
Stops the user import job.
See also: AWS API Documentation
Request Syntax
response = client.stop_user_import_job(
UserPoolId='string',
JobId='string'
)
[REQUIRED]
The user pool ID for the user pool that the users are being imported into.
[REQUIRED]
The job ID for the user import job.
dict
Response Syntax
{
'UserImportJob': {
'JobName': 'string',
'JobId': 'string',
'UserPoolId': 'string',
'PreSignedUrl': 'string',
'CreationDate': datetime(2015, 1, 1),
'StartDate': datetime(2015, 1, 1),
'CompletionDate': datetime(2015, 1, 1),
'Status': 'Created'|'Pending'|'InProgress'|'Stopping'|'Expired'|'Stopped'|'Failed'|'Succeeded',
'CloudWatchLogsRoleArn': 'string',
'ImportedUsers': 123,
'SkippedUsers': 123,
'FailedUsers': 123,
'CompletionMessage': 'string'
}
}
Response Structure
(dict) --
Represents the response from the server to the request to stop the user import job.
UserImportJob (dict) --
The job object that represents the user import job.
JobName (string) --
The job name for the user import job.
JobId (string) --
The job ID for the user import job.
UserPoolId (string) --
The user pool ID for the user pool that the users are being imported into.
PreSignedUrl (string) --
The pre-signed URL to be used to upload the .csv file.
CreationDate (datetime) --
The date the user import job was created.
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:
CloudWatchLogsRoleArn (string) --
The role ARN for the Amazon CloudWatch Logging role for the user import job. For more information, see "Creating the CloudWatch Logs IAM Role" in the Amazon Cognito Developer Guide.
ImportedUsers (integer) --
The number of users that were successfully imported.
SkippedUsers (integer) --
The number of users that were skipped.
FailedUsers (integer) --
The number of users that could not be imported.
CompletionMessage (string) --
The message returned when the user import job is completed.
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 IAM 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'
}
)
[REQUIRED]
The Amazon Resource Name (ARN) of the user pool to assign the tags to.
The tags to assign to the user pool.
dict
Response Syntax
{}
Response Structure
Removes the specified tags from an Amazon Cognito user pool. You can use this action up to 5 times per second, per account
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
ResourceArn='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the user pool that the tags are assigned to.
The keys of the tags to remove from the user pool.
dict
Response Syntax
{}
Response Structure
Provides the feedback for an authentication event whether it was from a valid user or not. This feedback is used for improving the risk evaluation decision for the user pool as part of Amazon Cognito advanced security.
See also: AWS API Documentation
Request Syntax
response = client.update_auth_event_feedback(
UserPoolId='string',
Username='string',
EventId='string',
FeedbackToken='string',
FeedbackValue='Valid'|'Invalid'
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user pool username.
[REQUIRED]
The event ID.
[REQUIRED]
The feedback token.
[REQUIRED]
The authentication event feedback value.
dict
Response Syntax
{}
Response Structure
Updates the device status.
See also: AWS API Documentation
Request Syntax
response = client.update_device_status(
AccessToken='string',
DeviceKey='string',
DeviceRememberedStatus='remembered'|'not_remembered'
)
[REQUIRED]
The access token.
[REQUIRED]
The device key.
dict
Response Syntax
{}
Response Structure
(dict) --
The response to the request to update the device status.
Updates the specified group with the specified attributes.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
response = client.update_group(
GroupName='string',
UserPoolId='string',
Description='string',
RoleArn='string',
Precedence=123
)
[REQUIRED]
The name of the group.
[REQUIRED]
The user pool ID for the user pool.
dict
Response Syntax
{
'Group': {
'GroupName': 'string',
'UserPoolId': 'string',
'Description': 'string',
'RoleArn': 'string',
'Precedence': 123,
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
Group (dict) --
The group object for the group.
GroupName (string) --
The name of the group.
UserPoolId (string) --
The user pool ID for the user pool.
Description (string) --
A string containing the description of the group.
RoleArn (string) --
The role ARN for the group.
Precedence (integer) --
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
LastModifiedDate (datetime) --
The date the group was last modified.
CreationDate (datetime) --
The date the group was created.
Updates identity provider information for a user pool.
See also: AWS API Documentation
Request Syntax
response = client.update_identity_provider(
UserPoolId='string',
ProviderName='string',
ProviderDetails={
'string': 'string'
},
AttributeMapping={
'string': 'string'
},
IdpIdentifiers=[
'string',
]
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The identity provider name.
The identity provider details to be updated, such as MetadataURL and MetadataFile .
The identity provider attribute mapping to be changed.
A list of identity provider identifiers.
dict
Response Syntax
{
'IdentityProvider': {
'UserPoolId': 'string',
'ProviderName': 'string',
'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'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 object.
UserPoolId (string) --
The user pool ID.
ProviderName (string) --
The identity provider name.
ProviderType (string) --
The identity provider type.
ProviderDetails (dict) --
The identity provider details, such as MetadataURL and MetadataFile .
AttributeMapping (dict) --
A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers (list) --
A list of identity provider identifiers.
LastModifiedDate (datetime) --
The date the identity provider was last modified.
CreationDate (datetime) --
The date the identity provider was created.
Updates the name and scopes of resource server. All other fields are read-only.
See also: AWS API Documentation
Request Syntax
response = client.update_resource_server(
UserPoolId='string',
Identifier='string',
Name='string',
Scopes=[
{
'ScopeName': 'string',
'ScopeDescription': 'string'
},
]
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
The identifier for the resource server.
[REQUIRED]
The name of the resource server.
The scope values to be set for the resource server.
A resource server scope.
The name of the scope.
A description of the scope.
dict
Response Syntax
{
'ResourceServer': {
'UserPoolId': 'string',
'Identifier': 'string',
'Name': 'string',
'Scopes': [
{
'ScopeName': 'string',
'ScopeDescription': 'string'
},
]
}
}
Response Structure
(dict) --
ResourceServer (dict) --
The resource server.
UserPoolId (string) --
The user pool ID for the user pool that hosts the resource server.
Identifier (string) --
The identifier for the resource server.
Name (string) --
The name of the resource server.
Scopes (list) --
A list of scopes that are defined for the resource server.
(dict) --
A resource server scope.
ScopeName (string) --
The name of the scope.
ScopeDescription (string) --
A description of the scope.
Allows a user to update a specific attribute (one at a time).
See also: AWS API Documentation
Request Syntax
response = client.update_user_attributes(
UserAttributes=[
{
'Name': 'string',
'Value': 'string'
},
],
AccessToken='string'
)
[REQUIRED]
An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the custom: prefix to the attribute name.
Specifies whether the attribute is standard or custom.
The name of the attribute.
The value of the attribute.
[REQUIRED]
The access token for the request to update user attributes.
dict
Response Syntax
{
'CodeDeliveryDetailsList': [
{
'Destination': 'string',
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
]
}
Response Structure
(dict) --
Represents the response from the server for the request to update user attributes.
CodeDeliveryDetailsList (list) --
The code delivery details list from the server for the request to update user attributes.
(dict) --
The code delivery details being returned from the server.
Destination (string) --
The destination for the code delivery details.
DeliveryMedium (string) --
The delivery medium (email message or phone number).
AttributeName (string) --
The attribute name.
Updates the specified user pool with the specified attributes. If you don't provide a value for an attribute, it will be set to the default value. You can get a list of the current user pool settings with .
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,
'TemporaryPasswordValidityDays': 123
}
},
LambdaConfig={
'PreSignUp': 'string',
'CustomMessage': 'string',
'PostConfirmation': 'string',
'PreAuthentication': 'string',
'PostAuthentication': 'string',
'DefineAuthChallenge': 'string',
'CreateAuthChallenge': 'string',
'VerifyAuthChallengeResponse': 'string',
'PreTokenGeneration': 'string',
'UserMigration': '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',
MfaConfiguration='OFF'|'ON'|'OPTIONAL',
DeviceConfiguration={
'ChallengeRequiredOnNewDevice': True|False,
'DeviceOnlyRememberedOnUserPrompt': True|False
},
EmailConfiguration={
'SourceArn': 'string',
'ReplyToEmailAddress': 'string',
'EmailSendingAccount': 'COGNITO_DEFAULT'|'DEVELOPER'
},
SmsConfiguration={
'SnsCallerArn': 'string',
'ExternalId': 'string'
},
UserPoolTags={
'string': 'string'
},
AdminCreateUserConfig={
'AllowAdminCreateUserOnly': True|False,
'UnusedAccountValidityDays': 123,
'InviteMessageTemplate': {
'SMSMessage': 'string',
'EmailMessage': 'string',
'EmailSubject': 'string'
}
},
UserPoolAddOns={
'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED'
}
)
[REQUIRED]
The user pool ID for the user pool you want to update.
A container with the policies you wish to update in a user pool.
The password policy.
The minimum length of the password policy that you have set. Cannot be less than 6.
In the password policy that you have set, refers to whether you have required users to use at least one uppercase letter in their password.
In the password policy that you have set, refers to whether you have required users to use at least one lowercase letter in their password.
In the password policy that you have set, refers to whether you have required users to use at least one number in their password.
In the password policy that you have set, refers to whether you have required users to use at least one symbol in their password.
The AWS Lambda configuration information from the request to update the user pool.
A pre-registration AWS Lambda trigger.
A custom Message AWS Lambda trigger.
A post-confirmation AWS Lambda trigger.
A pre-authentication AWS Lambda trigger.
A post-authentication AWS Lambda trigger.
Defines the authentication challenge.
Creates an authentication challenge.
Verifies the authentication challenge response.
A Lambda trigger that is invoked before token generation.
The user migration Lambda config type.
The attributes that are automatically verified when the Amazon Cognito service makes a request to update user pools.
The template for verification messages.
The SMS message template.
The email message template.
The subject line for the email message template.
The email message template for sending a confirmation link to the user.
The subject line for the email message template for sending a confirmation link to the user.
The default email option.
Can be one of the following values:
Device configuration.
Indicates whether a challenge is required on a new device. Only applicable to a new device.
If true, a device is only remembered on user prompt.
Email configuration.
The Amazon Resource Name (ARN) of a verified email address in Amazon SES. This email address is used in one of the following ways, depending on the value that you specify for the EmailSendingAccount parameter:
The destination to which the receiver of the email should reply to.
Specifies whether Amazon Cognito emails your users by using its built-in email functionality or your Amazon SES 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 below 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 Amazon Cognito in the Amazon Cognito Developer Guide .
The default FROM address is no-reply@verificationemail.com. To customize the FROM address, provide the 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 AWS account.
If you use this option, you must 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 IAM role, in your AWS account. This role contains the permissions that allow Amazon Cognito to access Amazon SES and send email messages with your 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 .
SMS configuration.
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
The external ID.
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.
The configuration for AdminCreateUser requests.
Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.
The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this parameter is 7.
Note
If you set a value for TemporaryPasswordValidityDays in PasswordPolicy , that value will be used and UnusedAccountValidityDays will be deprecated for that user pool.
The message template to be used for the welcome message to new users.
See also Customizing User Invitation Messages .
The message template for SMS messages.
The message template for email messages.
The subject line for email messages.
Used to enable advanced security risk detection. Set the key AdvancedSecurityMode to the value "AUDIT".
The advanced security mode.
dict
Response Syntax
{}
Response Structure
(dict) --
Represents the response from the server when you make a request to update the user pool.
Updates the specified user pool app client with the specified attributes. If you don't provide a value for an attribute, it will be set to the default value. You can get a list of the current user pool app client settings with .
See also: AWS API Documentation
Request Syntax
response = client.update_user_pool_client(
UserPoolId='string',
ClientId='string',
ClientName='string',
RefreshTokenValidity=123,
ReadAttributes=[
'string',
],
WriteAttributes=[
'string',
],
ExplicitAuthFlows=[
'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH',
],
SupportedIdentityProviders=[
'string',
],
CallbackURLs=[
'string',
],
LogoutURLs=[
'string',
],
DefaultRedirectURI='string',
AllowedOAuthFlows=[
'code'|'implicit'|'client_credentials',
],
AllowedOAuthScopes=[
'string',
],
AllowedOAuthFlowsUserPoolClient=True|False,
AnalyticsConfiguration={
'ApplicationId': 'string',
'RoleArn': 'string',
'ExternalId': 'string',
'UserDataShared': True|False
}
)
[REQUIRED]
The user pool ID for the user pool where you want to update the user pool client.
[REQUIRED]
The ID of the client associated with the user pool.
The read-only attributes of the user pool.
The writeable attributes of the user pool.
Explicit authentication flows.
A list of provider names for the identity providers that are supported on this client.
A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
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.
A list of allowed logout URLs for the identity providers.
The default redirect URI. Must be in the CallbackURLs list.
A redirect URI must:
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.
Set to code to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.
A list of allowed OAuth scopes. Currently supported values are "phone" , "email" , "openid" , and "Cognito" .
The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
The application ID for an Amazon Pinpoint application.
The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
The external ID.
If UserDataShared is true , Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
dict
Response Syntax
{
'UserPoolClient': {
'UserPoolId': 'string',
'ClientName': 'string',
'ClientId': 'string',
'ClientSecret': 'string',
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1),
'RefreshTokenValidity': 123,
'ReadAttributes': [
'string',
],
'WriteAttributes': [
'string',
],
'ExplicitAuthFlows': [
'ADMIN_NO_SRP_AUTH'|'CUSTOM_AUTH_FLOW_ONLY'|'USER_PASSWORD_AUTH',
],
'SupportedIdentityProviders': [
'string',
],
'CallbackURLs': [
'string',
],
'LogoutURLs': [
'string',
],
'DefaultRedirectURI': 'string',
'AllowedOAuthFlows': [
'code'|'implicit'|'client_credentials',
],
'AllowedOAuthScopes': [
'string',
],
'AllowedOAuthFlowsUserPoolClient': True|False,
'AnalyticsConfiguration': {
'ApplicationId': 'string',
'RoleArn': 'string',
'ExternalId': 'string',
'UserDataShared': True|False
}
}
}
Response Structure
(dict) --
Represents the response from the server to the request to update the user pool client.
UserPoolClient (dict) --
The user pool client value from the response from the server when an update user pool client request is made.
UserPoolId (string) --
The user pool ID for the user pool client.
ClientName (string) --
The client name from the user pool request of the client type.
ClientId (string) --
The ID of the client associated with the user pool.
ClientSecret (string) --
The client secret from the user pool request of the client type.
LastModifiedDate (datetime) --
The date the user pool client was last modified.
CreationDate (datetime) --
The date the user pool client was created.
RefreshTokenValidity (integer) --
The time limit, in days, after which the refresh token is no longer valid and cannot be used.
ReadAttributes (list) --
The Read-only attributes.
WriteAttributes (list) --
The writeable attributes.
ExplicitAuthFlows (list) --
The explicit authentication flows.
SupportedIdentityProviders (list) --
A list of provider names for the identity providers that are supported on this client.
CallbackURLs (list) --
A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
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.
LogoutURLs (list) --
A list of allowed logout URLs for the identity providers.
DefaultRedirectURI (string) --
The default redirect URI. Must be in the CallbackURLs list.
A redirect URI must:
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) --
Set to code to initiate a code grant flow, which provides an authorization code as the response. This code can be exchanged for access tokens with the token endpoint.
Set to token to specify that the client should get the access token (and, optionally, ID token, based on scopes) directly.
AllowedOAuthScopes (list) --
A list of allowed OAuth scopes. Currently supported values are "phone" , "email" , "openid" , and "Cognito" .
AllowedOAuthFlowsUserPoolClient (boolean) --
Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
AnalyticsConfiguration (dict) --
The Amazon Pinpoint analytics configuration for the user pool client.
ApplicationId (string) --
The application ID for an Amazon Pinpoint application.
RoleArn (string) --
The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId (string) --
The external ID.
UserDataShared (boolean) --
If UserDataShared is true , Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
Updates the Secure Sockets Layer (SSL) certificate for the custom domain for your user pool.
You can use this operation to provide the Amazon Resource Name (ARN) of a new certificate to Amazon Cognito. You cannot use it to change the domain for a user pool.
A custom domain is used to host the Amazon Cognito hosted UI, which provides sign-up and sign-in pages for your application. When you set up a custom domain, you provide a certificate that you manage with AWS Certificate Manager (ACM). When necessary, you can use this operation to change the certificate that you applied to your custom domain.
Usually, this is unnecessary following routine certificate renewal with ACM. When you renew your existing certificate in ACM, the ARN for your certificate remains the same, and your custom domain uses the new certificate automatically.
However, if you replace your existing certificate with a new one, ACM gives the new certificate a new ARN. To apply the new certificate to your custom domain, you must provide this ARN to Amazon Cognito.
When you add your new certificate in ACM, you must choose US East (N. Virginia) as the AWS Region.
After you submit your request, Amazon Cognito requires up to 1 hour to distribute your new certificate to your custom domain.
For more information about adding a custom domain to your user pool, see Using Your Own Domain for the Hosted UI .
See also: AWS API Documentation
Request Syntax
response = client.update_user_pool_domain(
Domain='string',
UserPoolId='string',
CustomDomainConfig={
'CertificateArn': 'string'
}
)
[REQUIRED]
The domain name for the custom domain that hosts the sign-up and sign-in pages for your application. For example: auth.example.com .
This string can include only lowercase letters, numbers, and hyphens. Do not use a hyphen for the first or last character. Use periods to separate subdomain names.
[REQUIRED]
The ID of the user pool that is associated with the custom domain that you are updating the certificate for.
[REQUIRED]
The configuration for a custom domain that hosts the sign-up and sign-in pages for your application. Use this object to specify an SSL certificate that is managed by ACM.
The Amazon Resource Name (ARN) of an AWS Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.
dict
Response Syntax
{
'CloudFrontDomain': 'string'
}
Response Structure
(dict) --
The UpdateUserPoolDomain response output.
CloudFrontDomain (string) --
The Amazon CloudFront endpoint that Amazon Cognito set up when you added the custom domain to your user pool.
Use this API to register a user's entered TOTP code and mark the user's software token MFA status as "verified" if successful. The request takes an access token or a session string, but not both.
See also: AWS API Documentation
Request Syntax
response = client.verify_software_token(
AccessToken='string',
Session='string',
UserCode='string',
FriendlyDeviceName='string'
)
[REQUIRED]
The one time password computed using the secret code returned by
dict
Response Syntax
{
'Status': 'SUCCESS'|'ERROR',
'Session': 'string'
}
Response Structure
(dict) --
Status (string) --
The status of the verify software token.
Session (string) --
The session which should be passed both ways in challenge-response calls to the service.
Verifies the specified user attributes in the user pool.
See also: AWS API Documentation
Request Syntax
response = client.verify_user_attribute(
AccessToken='string',
AttributeName='string',
Code='string'
)
[REQUIRED]
Represents the access token of the request to verify user attributes.
[REQUIRED]
The attribute name in the request to verify user attributes.
[REQUIRED]
The verification code in the request to verify user attributes.
dict
Response Syntax
{}
Response Structure
(dict) --
A container representing the response from the server from the request to verify user attributes.
The available paginators are:
paginator = client.get_paginator('admin_list_groups_for_user')
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'
}
)
[REQUIRED]
The username for the user.
[REQUIRED]
The user pool ID for the user pool.
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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) --
The groups that the user belongs to.
(dict) --
The group type.
GroupName (string) --
The name of the group.
UserPoolId (string) --
The user pool ID for the user pool.
Description (string) --
A string containing the description of the group.
RoleArn (string) --
The role ARN for the group.
Precedence (integer) --
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
LastModifiedDate (datetime) --
The date the group was last modified.
CreationDate (datetime) --
The date the group was created.
paginator = client.get_paginator('admin_list_user_auth_events')
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'
}
)
[REQUIRED]
The user pool ID.
[REQUIRED]
The user pool username or an alias.
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'AuthEvents': [
{
'EventId': 'string',
'EventType': 'SignIn'|'SignUp'|'ForgotPassword',
'CreationDate': datetime(2015, 1, 1),
'EventResponse': 'Success'|'Failure',
'EventRisk': {
'RiskDecision': 'NoRisk'|'AccountTakeover'|'Block',
'RiskLevel': 'Low'|'Medium'|'High'
},
'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) --
The authentication event type.
EventId (string) --
The event ID.
EventType (string) --
The event type.
CreationDate (datetime) --
The creation date
EventResponse (string) --
The event response.
EventRisk (dict) --
The event risk.
RiskDecision (string) --
The risk decision.
RiskLevel (string) --
The risk level.
ChallengeResponses (list) --
The challenge responses.
(dict) --
The challenge response type.
ChallengeName (string) --
The challenge name
ChallengeResponse (string) --
The challenge response.
EventContextData (dict) --
The user context data captured at the time of an event request. It provides additional information about the client from which event the request is received.
IpAddress (string) --
The user's IP address.
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) --
A flag specifying the user feedback captured at the time of an event request is good or bad.
FeedbackValue (string) --
The event feedback value.
Provider (string) --
The provider.
FeedbackDate (datetime) --
The event feedback date.
paginator = client.get_paginator('list_groups')
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'
}
)
[REQUIRED]
The user pool ID for the user pool.
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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) --
The group objects for the groups.
(dict) --
The group type.
GroupName (string) --
The name of the group.
UserPoolId (string) --
The user pool ID for the user pool.
Description (string) --
A string containing the description of the group.
RoleArn (string) --
The role ARN for the group.
Precedence (integer) --
A nonnegative integer value that specifies the precedence of this group relative to the other groups that a user can belong to in the user pool. If a user belongs to two or more groups, it is the group with the highest precedence whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.
Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.
The default Precedence value is null.
LastModifiedDate (datetime) --
The date the group was last modified.
CreationDate (datetime) --
The date the group was created.
paginator = client.get_paginator('list_identity_providers')
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'
}
)
[REQUIRED]
The user pool ID.
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Providers': [
{
'ProviderName': 'string',
'ProviderType': 'SAML'|'Facebook'|'Google'|'LoginWithAmazon'|'OIDC',
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
},
],
}
Response Structure
(dict) --
Providers (list) --
A list of identity provider objects.
(dict) --
A container for identity provider details.
ProviderName (string) --
The identity provider name.
ProviderType (string) --
The identity provider type.
LastModifiedDate (datetime) --
The date the provider was last modified.
CreationDate (datetime) --
The date the provider was added to the user pool.
paginator = client.get_paginator('list_resource_servers')
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'
}
)
[REQUIRED]
The user pool ID for the user pool.
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'ResourceServers': [
{
'UserPoolId': 'string',
'Identifier': 'string',
'Name': 'string',
'Scopes': [
{
'ScopeName': 'string',
'ScopeDescription': 'string'
},
]
},
],
}
Response Structure
(dict) --
ResourceServers (list) --
The resource servers.
(dict) --
A container for information about a resource server for a user pool.
UserPoolId (string) --
The user pool ID for the user pool that hosts the resource server.
Identifier (string) --
The identifier for the resource server.
Name (string) --
The name of the resource server.
Scopes (list) --
A list of scopes that are defined for the resource server.
(dict) --
A resource server scope.
ScopeName (string) --
The name of the scope.
ScopeDescription (string) --
A description of the scope.
paginator = client.get_paginator('list_user_pool_clients')
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'
}
)
[REQUIRED]
The user pool ID for the user pool where you want to list user pool clients.
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
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) --
The user pool clients in the response that lists user pool clients.
(dict) --
The description of the user pool client.
ClientId (string) --
The ID of the client associated with the user pool.
UserPoolId (string) --
The user pool ID for the user pool where you want to describe the user pool client.
ClientName (string) --
The client name from the user pool client description.
paginator = client.get_paginator('list_user_pools')
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'
}
)
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
{
'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'
},
'Status': 'Enabled'|'Disabled',
'LastModifiedDate': datetime(2015, 1, 1),
'CreationDate': datetime(2015, 1, 1)
},
],
}
Response Structure
Represents the response to list user pools.
The user pools from the response to list users.
A user pool description.
The ID in a user pool description.
The name in a user pool description.
The AWS Lambda configuration information in a user pool description.
A pre-registration AWS Lambda trigger.
A custom Message AWS Lambda trigger.
A post-confirmation AWS Lambda trigger.
A pre-authentication AWS Lambda trigger.
A post-authentication AWS Lambda trigger.
Defines the authentication challenge.
Creates an authentication challenge.
Verifies the authentication challenge response.
A Lambda trigger that is invoked before token generation.
The user migration Lambda config type.
The user pool status in a user pool description.
The date the user pool description was last modified.
The date the user pool description was created.
paginator = client.get_paginator('list_users_in_group')
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'
}
)
[REQUIRED]
The user pool ID for the user pool.
[REQUIRED]
The name of the group.
A dictionary that provides parameters to control pagination.
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.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'Users': [
{
'Username': 'string',
'Attributes': [
{
'Name': 'string',
'Value': 'string'
},
],
'UserCreateDate': datetime(2015, 1, 1),
'UserLastModifiedDate': datetime(2015, 1, 1),
'Enabled': True|False,
'UserStatus': 'UNCONFIRMED'|'CONFIRMED'|'ARCHIVED'|'COMPROMISED'|'UNKNOWN'|'RESET_REQUIRED'|'FORCE_CHANGE_PASSWORD',
'MFAOptions': [
{
'DeliveryMedium': 'SMS'|'EMAIL',
'AttributeName': 'string'
},
]
},
],
}
Response Structure
(dict) --
Users (list) --
The users returned in the request to list users.
(dict) --
The user type.
Username (string) --
The user name of the user you wish to describe.
Attributes (list) --
A container with information about the user type attributes.
(dict) --
Specifies whether the attribute is standard or custom.
Name (string) --
The name of the attribute.
Value (string) --
The value of the attribute.
UserCreateDate (datetime) --
The creation date of the user.
UserLastModifiedDate (datetime) --
The last modified date of the user.
Enabled (boolean) --
Specifies whether the user is enabled.
UserStatus (string) --
The user status. Can be one of the following:
MFAOptions (list) --
The MFA options for the user.
(dict) --
Specifies the different settings for multi-factor authentication (MFA).
DeliveryMedium (string) --
The delivery medium (email message or SMS message) to send the MFA code.
AttributeName (string) --
The attribute name of the MFA option type.