2018/02/12 - Amazon Cognito Identity Provider - 1 new9 updated api methods
Changes Update cognito-idp client to latest version
This method takes a user pool ID, and returns the signing certificate.
See also: AWS API Documentation
Request Syntax
client.get_signing_certificate( UserPoolId='string' )
string
[REQUIRED]
The user pool ID.
dict
Response Syntax
{ 'Certificate': 'string' }
Response Structure
(dict) --
Response from Cognito for a signing certificate request.
Certificate (string) --
The signing certificate.
{'AuthFlow': {'USER_PASSWORD_AUTH'}}
Initiates the authentication flow, as an administrator.
Requires developer credentials.
See also: AWS API Documentation
Request Syntax
client.admin_initiate_auth( UserPoolId='string', ClientId='string', AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'USER_PASSWORD_AUTH', AuthParameters={ 'string': 'string' }, ClientMetadata={ 'string': 'string' }, AnalyticsMetadata={ 'AnalyticsEndpointId': 'string' }, ContextData={ 'IpAddress': 'string', 'ServerName': 'string', 'ServerPath': 'string', 'HttpHeaders': [ { 'headerName': 'string', 'headerValue': 'string' }, ], 'EncodedData': 'string' } )
string
[REQUIRED]
The ID of the Amazon Cognito user pool.
string
[REQUIRED]
The app client ID.
string
[REQUIRED]
The authentication flow for this call to execute. The API action will depend on this value. For example:
REFRESH_TOKEN_AUTH will take in a valid refresh token and return new tokens.
USER_SRP_AUTH will take in USERNAME and SRP_A and return the SRP variables to be used for next challenge execution.
USER_PASSWORD_AUTH will take in USERNAME and PASSWORD and return the next challenge or tokens.
Valid values include:
USER_SRP_AUTH: Authentication flow for the Secure Remote Password (SRP) protocol.
REFRESH_TOKEN_AUTH/ REFRESH_TOKEN: Authentication flow for refreshing the access token and ID token by supplying a valid refresh token.
CUSTOM_AUTH: Custom authentication flow.
ADMIN_NO_SRP_AUTH: Non-SRP authentication flow; you can pass in the USERNAME and PASSWORD directly if the flow is enabled for calling the app client.
USER_PASSWORD_AUTH: Non-SRP authentication flow; USERNAME and PASSWORD are passed directly. If a user migration Lambda trigger is set, this flow will invoke the user migration Lambda if the USERNAME is not found in the user pool.
dict
The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow:
For USER_SRP_AUTH: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY
For REFRESH_TOKEN_AUTH/REFRESH_TOKEN: REFRESH_TOKEN (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY
For ADMIN_NO_SRP_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), PASSWORD (required), DEVICE_KEY
For CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY
(string) --
(string) --
dict
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.
(string) --
(string) --
dict
The analytics metadata for collecting Amazon Pinpoint metrics for AdminInitiateAuth calls.
AnalyticsEndpointId (string) --
The endpoint ID.
dict
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.
IpAddress (string) -- [REQUIRED]
Source IP address of your user.
ServerName (string) -- [REQUIRED]
Your server endpoint where this API is invoked.
ServerPath (string) -- [REQUIRED]
Your server path where this API is invoked.
HttpHeaders (list) -- [REQUIRED]
HttpHeaders received on your server in same order.
(dict) --
The HTTP header.
headerName (string) --
The header name
headerValue (string) --
The header value.
EncodedData (string) --
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.
SMS_MFA: Next challenge is to supply an SMS_MFA_CODE, delivered via SMS.
PASSWORD_VERIFIER: Next challenge is to supply PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after the client-side SRP calculations.
CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued.
DEVICE_SRP_AUTH: If device tracking was enabled on your user pool and the previous challenges were passed, this challenge is returned so that Amazon Cognito can start tracking this device.
DEVICE_PASSWORD_VERIFIER: Similar to PASSWORD_VERIFIER, but for devices only.
ADMIN_NO_SRP_AUTH: This is returned if you need to authenticate with USERNAME and PASSWORD directly. An app client must be enabled to use this flow.
NEW_PASSWORD_REQUIRED: For users which are required to change their passwords after successful first login. This challenge should be passed with NEW_PASSWORD and any other required attributes.
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.
(string) --
(string) --
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.
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.
{'LambdaConfig': {'UserMigration': 'string'}}Response
{'UserPool': {'LambdaConfig': {'UserMigration': 'string'}}}
Creates a new Amazon Cognito user pool and sets the password policy for the pool.
See also: AWS API Documentation
Request Syntax
client.create_user_pool( PoolName='string', Policies={ 'PasswordPolicy': { 'MinimumLength': 123, 'RequireUppercase': True|False, 'RequireLowercase': True|False, 'RequireNumbers': True|False, 'RequireSymbols': True|False } }, LambdaConfig={ 'PreSignUp': 'string', 'CustomMessage': 'string', 'PostConfirmation': 'string', 'PreAuthentication': 'string', 'PostAuthentication': 'string', 'DefineAuthChallenge': 'string', 'CreateAuthChallenge': 'string', 'VerifyAuthChallengeResponse': 'string', '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' }, 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' } )
string
[REQUIRED]
A string used to name the user pool.
dict
The policies associated with the new 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.
dict
The Lambda trigger configuration information for the new user pool.
PreSignUp (string) --
A pre-registration AWS Lambda trigger.
CustomMessage (string) --
A custom Message AWS Lambda trigger.
PostConfirmation (string) --
A post-confirmation AWS Lambda trigger.
PreAuthentication (string) --
A pre-authentication AWS Lambda trigger.
PostAuthentication (string) --
A post-authentication AWS Lambda trigger.
DefineAuthChallenge (string) --
Defines the authentication challenge.
CreateAuthChallenge (string) --
Creates an authentication challenge.
VerifyAuthChallengeResponse (string) --
Verifies the authentication challenge response.
PreTokenGeneration (string) --
A Lambda trigger that is invoked before token generation.
UserMigration (string) --
The user migration Lambda config type.
list
The attributes to be auto-verified. Possible values: email, phone_number.
(string) --
list
Attributes supported as an alias for this user pool. Possible values: phone_number, email, or preferred_username.
(string) --
list
Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.
(string) --
string
A string representing the SMS verification message.
string
A string representing the email verification message.
string
A string representing the email verification subject.
dict
The template for the verification message that the user sees when the app requests permission to access the user's information.
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.
string
A string representing the SMS authentication message.
string
Specifies MFA configuration details.
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.
dict
The email configuration.
SourceArn (string) --
The Amazon Resource Name (ARN) of the email source.
ReplyToEmailAddress (string) --
The destination to which the receiver of the email should reply to.
dict
The SMS configuration.
SnsCallerArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId (string) --
The external ID.
dict
The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool
(string) --
(string) --
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.
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.
list
An array of schema attributes for the new user pool. These attributes can be standard or custom attributes.
(dict) --
Contains information about the schema attribute.
Name (string) --
A schema attribute of the name type.
AttributeDataType (string) --
The attribute data type.
DeveloperOnlyAttribute (boolean) --
Specifies whether the attribute type is developer only.
Mutable (boolean) --
Specifies whether the attribute can be changed once it has been created.
Required (boolean) --
Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.
NumberAttributeConstraints (dict) --
Specifies the constraints for an attribute of the number type.
MinValue (string) --
The minimum value of an attribute that is of the number data type.
MaxValue (string) --
The maximum value of an attribute that is of the number data type.
StringAttributeConstraints (dict) --
Specifies the constraints for an attribute of the string type.
MinLength (string) --
The minimum length.
MaxLength (string) --
The maximum length.
dict
Used to enable advanced security risk detection. Set the key AdvancedSecurityMode to the value "AUDIT".
AdvancedSecurityMode (string) -- [REQUIRED]
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 } }, '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' }, 'SmsConfiguration': { 'SnsCallerArn': 'string', 'ExternalId': 'string' }, 'UserPoolTags': { 'string': 'string' }, 'SmsConfigurationFailure': 'string', 'EmailConfigurationFailure': 'string', 'Domain': 'string', 'AdminCreateUserConfig': { 'AllowAdminCreateUserOnly': True|False, 'UnusedAccountValidityDays': 123, 'InviteMessageTemplate': { 'SMSMessage': 'string', 'EmailMessage': 'string', 'EmailSubject': 'string' } }, 'UserPoolAddOns': { 'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED' } } }
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.
LambdaConfig (dict) --
The AWS Lambda triggers associated with tue 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 attribute can be changed once it has been created.
Required (boolean) --
Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.
NumberAttributeConstraints (dict) --
Specifies the constraints for an attribute of the number type.
MinValue (string) --
The minimum value of an attribute that is of the number data type.
MaxValue (string) --
The maximum value of an attribute that is of the number data type.
StringAttributeConstraints (dict) --
Specifies the constraints for an attribute of the string type.
MinLength (string) --
The minimum length.
MaxLength (string) --
The maximum length.
AutoVerifiedAttributes (list) --
Specifies the attributes that are auto-verified in a user pool.
(string) --
AliasAttributes (list) --
Specifies the attributes that are aliased in a user pool.
(string) --
UsernameAttributes (list) --
Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.
(string) --
SmsVerificationMessage (string) --
The contents of the SMS verification message.
EmailVerificationMessage (string) --
The contents of the email verification message.
EmailVerificationSubject (string) --
The subject of the email verification message.
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:
OFF - MFA tokens are not required and cannot be specified during user registration.
ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.
OPTIONAL - Users have the option when registering to create an MFA token.
DeviceConfiguration (dict) --
The device configuration.
ChallengeRequiredOnNewDevice (boolean) --
Indicates whether a challenge is required on a new device. Only applicable to a new device.
DeviceOnlyRememberedOnUserPrompt (boolean) --
If true, a device is only remembered on user prompt.
EstimatedNumberOfUsers (integer) --
A number estimating the size of the user pool.
EmailConfiguration (dict) --
The email configuration.
SourceArn (string) --
The Amazon Resource Name (ARN) of the email source.
ReplyToEmailAddress (string) --
The destination to which the receiver of the email should reply to.
SmsConfiguration (dict) --
The SMS configuration.
SnsCallerArn (string) --
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId (string) --
The external ID.
UserPoolTags (dict) --
The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool
(string) --
(string) --
SmsConfigurationFailure (string) --
The reason why the SMS configuration cannot send the 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.
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.
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.
{'ExplicitAuthFlows': {'USER_PASSWORD_AUTH'}}Response
{'UserPoolClient': {'ExplicitAuthFlows': {'USER_PASSWORD_AUTH'}}}
Creates the user pool client.
See also: AWS API Documentation
Request Syntax
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 } )
string
[REQUIRED]
The user pool ID for the user pool where you want to create a user pool client.
string
[REQUIRED]
The client name for the user pool client you would like to create.
boolean
Boolean to specify whether you want to generate a secret for the user pool client being created.
integer
The time limit, in days, after which the refresh token is no longer valid and cannot be used.
list
The read attributes.
(string) --
list
The write attributes.
(string) --
list
The explicit authentication flows.
(string) --
list
A list of provider names for the identity providers that are supported on this client.
(string) --
list
A list of allowed callback URLs for the identity providers.
(string) --
list
A list of allowed logout URLs for the identity providers.
(string) --
string
The default redirect URI. Must be in the CallbackURLs list.
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.
(string) --
list
A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito".
(string) --
boolean
Set to True if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
dict
The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
ApplicationId (string) -- [REQUIRED]
The application ID for an Amazon Pinpoint application.
RoleArn (string) -- [REQUIRED]
The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId (string) -- [REQUIRED]
The external ID.
UserDataShared (boolean) --
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.
(string) --
WriteAttributes (list) --
The writeable attributes.
(string) --
ExplicitAuthFlows (list) --
The explicit authentication flows.
(string) --
SupportedIdentityProviders (list) --
A list of provider names for the identity providers that are supported on this client.
(string) --
CallbackURLs (list) --
A list of allowed callback URLs for the identity providers.
(string) --
LogoutURLs (list) --
A list of allowed logout URLs for the identity providers.
(string) --
DefaultRedirectURI (string) --
The default redirect URI. Must be in the CallbackURLs list.
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.
(string) --
AllowedOAuthScopes (list) --
A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito".
(string) --
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.
{'UserPool': {'LambdaConfig': {'UserMigration': 'string'}}}
Returns the configuration information and metadata of the specified user pool.
See also: AWS API Documentation
Request Syntax
client.describe_user_pool( UserPoolId='string' )
string
[REQUIRED]
The user pool ID for the user pool you want to describe.
dict
Response Syntax
{ 'UserPool': { 'Id': 'string', 'Name': 'string', 'Policies': { 'PasswordPolicy': { 'MinimumLength': 123, 'RequireUppercase': True|False, 'RequireLowercase': True|False, 'RequireNumbers': True|False, 'RequireSymbols': True|False } }, 'LambdaConfig': { 'PreSignUp': 'string', 'CustomMessage': 'string', 'PostConfirmation': 'string', 'PreAuthentication': 'string', 'PostAuthentication': 'string', 'DefineAuthChallenge': 'string', 'CreateAuthChallenge': 'string', 'VerifyAuthChallengeResponse': 'string', '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' }, 'SmsConfiguration': { 'SnsCallerArn': 'string', 'ExternalId': 'string' }, 'UserPoolTags': { 'string': 'string' }, 'SmsConfigurationFailure': 'string', 'EmailConfigurationFailure': 'string', 'Domain': 'string', 'AdminCreateUserConfig': { 'AllowAdminCreateUserOnly': True|False, 'UnusedAccountValidityDays': 123, 'InviteMessageTemplate': { 'SMSMessage': 'string', 'EmailMessage': 'string', 'EmailSubject': 'string' } }, 'UserPoolAddOns': { 'AdvancedSecurityMode': 'OFF'|'AUDIT'|'ENFORCED' } } }
Response Structure
(dict) --
Represents the response to describe the user pool.
UserPool (dict) --
The container of metadata returned by the server to describe the pool.
Id (string) --
The ID of the user pool.
Name (string) --
The name of the user pool.
Policies (dict) --
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.
LambdaConfig (dict) --
The AWS Lambda triggers associated with tue 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 attribute can be changed once it has been created.
Required (boolean) --
Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.
NumberAttributeConstraints (dict) --
Specifies the constraints for an attribute of the number type.
MinValue (string) --
The minimum value of an attribute that is of the number data type.
MaxValue (string) --
The maximum value of an attribute that is of the number data type.
StringAttributeConstraints (dict) --
Specifies the constraints for an attribute of the string type.
MinLength (string) --
The minimum length.
MaxLength (string) --
The maximum length.
AutoVerifiedAttributes (list) --
Specifies the attributes that are auto-verified in a user pool.
(string) --
AliasAttributes (list) --
Specifies the attributes that are aliased in a user pool.
(string) --
UsernameAttributes (list) --
Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.
(string) --
SmsVerificationMessage (string) --
The contents of the SMS verification message.
EmailVerificationMessage (string) --
The contents of the email verification message.
EmailVerificationSubject (string) --
The subject of the email verification message.
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:
OFF - MFA tokens are not required and cannot be specified during user registration.
ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.
OPTIONAL - Users have the option when registering to create an MFA token.
DeviceConfiguration (dict) --
The device configuration.
ChallengeRequiredOnNewDevice (boolean) --
Indicates whether a challenge is required on a new device. Only applicable to a new device.
DeviceOnlyRememberedOnUserPrompt (boolean) --
If true, a device is only remembered on user prompt.
EstimatedNumberOfUsers (integer) --
A number estimating the size of the user pool.
EmailConfiguration (dict) --
The email configuration.
SourceArn (string) --
The Amazon Resource Name (ARN) of the email source.
ReplyToEmailAddress (string) --
The destination to which the receiver of the email should reply to.
SmsConfiguration (dict) --
The SMS configuration.
SnsCallerArn (string) --
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId (string) --
The external ID.
UserPoolTags (dict) --
The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool
(string) --
(string) --
SmsConfigurationFailure (string) --
The reason why the SMS configuration cannot send the 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.
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.
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.
{'UserPoolClient': {'ExplicitAuthFlows': {'USER_PASSWORD_AUTH'}}}
Client method for returning the configuration information and metadata of the specified user pool client.
See also: AWS API Documentation
Request Syntax
client.describe_user_pool_client( UserPoolId='string', ClientId='string' )
string
[REQUIRED]
The user pool ID for the user pool you want to describe.
string
[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.
(string) --
WriteAttributes (list) --
The writeable attributes.
(string) --
ExplicitAuthFlows (list) --
The explicit authentication flows.
(string) --
SupportedIdentityProviders (list) --
A list of provider names for the identity providers that are supported on this client.
(string) --
CallbackURLs (list) --
A list of allowed callback URLs for the identity providers.
(string) --
LogoutURLs (list) --
A list of allowed logout URLs for the identity providers.
(string) --
DefaultRedirectURI (string) --
The default redirect URI. Must be in the CallbackURLs list.
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.
(string) --
AllowedOAuthScopes (list) --
A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito".
(string) --
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.
{'AuthFlow': {'USER_PASSWORD_AUTH'}}
Initiates the authentication flow.
See also: AWS API Documentation
Request Syntax
client.initiate_auth( AuthFlow='USER_SRP_AUTH'|'REFRESH_TOKEN_AUTH'|'REFRESH_TOKEN'|'CUSTOM_AUTH'|'ADMIN_NO_SRP_AUTH'|'USER_PASSWORD_AUTH', AuthParameters={ 'string': 'string' }, ClientMetadata={ 'string': 'string' }, ClientId='string', AnalyticsMetadata={ 'AnalyticsEndpointId': 'string' }, UserContextData={ 'EncodedData': 'string' } )
string
[REQUIRED]
The authentication flow for this call to execute. The API action will depend on this value. For example:
REFRESH_TOKEN_AUTH will take in a valid refresh token and return new tokens.
USER_SRP_AUTH will take in USERNAME and SRP_A and return the SRP variables to be used for next challenge execution.
USER_PASSWORD_AUTH will take in USERNAME and PASSWORD and return the next challenge or tokens.
Valid values include:
USER_SRP_AUTH: Authentication flow for the Secure Remote Password (SRP) protocol.
REFRESH_TOKEN_AUTH/ REFRESH_TOKEN: Authentication flow for refreshing the access token and ID token by supplying a valid refresh token.
CUSTOM_AUTH: Custom authentication flow.
USER_PASSWORD_AUTH: Non-SRP authentication flow; USERNAME and PASSWORD are passed directly. If a user migration Lambda trigger is set, this flow will invoke the user migration Lambda if the USERNAME is not found in the user pool.
ADMIN_NO_SRP_AUTH is not a valid value.
dict
The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow:
For USER_SRP_AUTH: USERNAME (required), SRP_A (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY
For REFRESH_TOKEN_AUTH/REFRESH_TOKEN: REFRESH_TOKEN (required), SECRET_HASH (required if the app client is configured with a client secret), DEVICE_KEY
For CUSTOM_AUTH: USERNAME (required), SECRET_HASH (if app client is configured with client secret), DEVICE_KEY
(string) --
(string) --
dict
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.
(string) --
(string) --
string
[REQUIRED]
The app client ID.
dict
The Amazon Pinpoint analytics metadata for collecting metrics for InitiateAuth calls.
AnalyticsEndpointId (string) --
The endpoint ID.
dict
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.
EncodedData (string) --
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.
SMS_MFA: Next challenge is to supply an SMS_MFA_CODE, delivered via SMS.
PASSWORD_VERIFIER: Next challenge is to supply PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, and TIMESTAMP after the client-side SRP calculations.
CUSTOM_CHALLENGE: This is returned if your custom authentication flow determines that the user should pass another challenge before tokens are issued.
DEVICE_SRP_AUTH: If device tracking was enabled on your user pool and the previous challenges were passed, this challenge is returned so that Amazon Cognito can start tracking this device.
DEVICE_PASSWORD_VERIFIER: Similar to PASSWORD_VERIFIER, but for devices only.
NEW_PASSWORD_REQUIRED: For users which are required to change their passwords after successful first login. This challenge should be passed with NEW_PASSWORD and any other required attributes.
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).
(string) --
(string) --
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.
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.
{'UserPools': {'LambdaConfig': {'UserMigration': 'string'}}}
Lists the user pools associated with an AWS account.
See also: AWS API Documentation
Request Syntax
client.list_user_pools( NextToken='string', MaxResults=123 )
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.
integer
[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.
{'LambdaConfig': {'UserMigration': 'string'}}
Updates the specified user pool with the specified attributes.
See also: AWS API Documentation
Request Syntax
client.update_user_pool( UserPoolId='string', Policies={ 'PasswordPolicy': { 'MinimumLength': 123, 'RequireUppercase': True|False, 'RequireLowercase': True|False, 'RequireNumbers': True|False, 'RequireSymbols': True|False } }, LambdaConfig={ 'PreSignUp': 'string', 'CustomMessage': 'string', 'PostConfirmation': 'string', 'PreAuthentication': 'string', 'PostAuthentication': 'string', 'DefineAuthChallenge': 'string', 'CreateAuthChallenge': 'string', 'VerifyAuthChallengeResponse': 'string', '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' }, 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' } )
string
[REQUIRED]
The user pool ID for the user pool you want to update.
dict
A container with the policies you wish to update in a 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.
dict
The AWS Lambda configuration information from the request to update the user pool.
PreSignUp (string) --
A pre-registration AWS Lambda trigger.
CustomMessage (string) --
A custom Message AWS Lambda trigger.
PostConfirmation (string) --
A post-confirmation AWS Lambda trigger.
PreAuthentication (string) --
A pre-authentication AWS Lambda trigger.
PostAuthentication (string) --
A post-authentication AWS Lambda trigger.
DefineAuthChallenge (string) --
Defines the authentication challenge.
CreateAuthChallenge (string) --
Creates an authentication challenge.
VerifyAuthChallengeResponse (string) --
Verifies the authentication challenge response.
PreTokenGeneration (string) --
A Lambda trigger that is invoked before token generation.
UserMigration (string) --
The user migration Lambda config type.
list
The attributes that are automatically verified when the Amazon Cognito service makes a request to update user pools.
(string) --
string
A container with information about the SMS verification message.
string
The contents of the email verification message.
string
The subject of the email verification message.
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.
string
The contents of the SMS authentication message.
string
Can be one of the following values:
OFF - MFA tokens are not required and cannot be specified during user registration.
ON - MFA tokens are required for all user registrations. You can only specify required when you are initially creating a user pool.
OPTIONAL - Users have the option when registering to create an MFA token.
dict
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.
dict
Email configuration.
SourceArn (string) --
The Amazon Resource Name (ARN) of the email source.
ReplyToEmailAddress (string) --
The destination to which the receiver of the email should reply to.
dict
SMS configuration.
SnsCallerArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId (string) --
The external ID.
dict
The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool
(string) --
(string) --
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.
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.
dict
Used to enable advanced security risk detection. Set the key AdvancedSecurityMode to the value "AUDIT".
AdvancedSecurityMode (string) -- [REQUIRED]
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.
{'ExplicitAuthFlows': {'USER_PASSWORD_AUTH'}}Response
{'UserPoolClient': {'ExplicitAuthFlows': {'USER_PASSWORD_AUTH'}}}
Allows the developer to update the specified user pool client and password policy.
See also: AWS API Documentation
Request Syntax
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 } )
string
[REQUIRED]
The user pool ID for the user pool where you want to update the user pool client.
string
[REQUIRED]
The ID of the client associated with the user pool.
string
The client name from the update user pool client request.
integer
The time limit, in days, after which the refresh token is no longer valid and cannot be used.
list
The read-only attributes of the user pool.
(string) --
list
The writeable attributes of the user pool.
(string) --
list
Explicit authentication flows.
(string) --
list
A list of provider names for the identity providers that are supported on this client.
(string) --
list
A list of allowed callback URLs for the identity providers.
(string) --
list
A list of allowed logout URLs for the identity providers.
(string) --
string
The default redirect URI. Must be in the CallbackURLs list.
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.
(string) --
list
A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito".
(string) --
boolean
Set to TRUE if the client is allowed to follow the OAuth protocol when interacting with Cognito user pools.
dict
The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
ApplicationId (string) -- [REQUIRED]
The application ID for an Amazon Pinpoint application.
RoleArn (string) -- [REQUIRED]
The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId (string) -- [REQUIRED]
The external ID.
UserDataShared (boolean) --
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.
(string) --
WriteAttributes (list) --
The writeable attributes.
(string) --
ExplicitAuthFlows (list) --
The explicit authentication flows.
(string) --
SupportedIdentityProviders (list) --
A list of provider names for the identity providers that are supported on this client.
(string) --
CallbackURLs (list) --
A list of allowed callback URLs for the identity providers.
(string) --
LogoutURLs (list) --
A list of allowed logout URLs for the identity providers.
(string) --
DefaultRedirectURI (string) --
The default redirect URI. Must be in the CallbackURLs list.
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.
(string) --
AllowedOAuthScopes (list) --
A list of allowed OAuth scopes. Currently supported values are "phone", "email", "openid", and "Cognito".
(string) --
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.