Class: AWS.CognitoIdentityServiceProvider
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.CognitoIdentityServiceProvider
- Identifier:
- cognitoidentityserviceprovider
- API Version:
- 2016-04-18
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Using the Amazon Cognito User Pools API, you can create a user pool to manage directories and users. You can authenticate a user to obtain tokens related to user identity and access policies.
This API reference provides information about user pools in Amazon Cognito User Pools.
For more information, see the Amazon Cognito Documentation.
Sending a Request Using CognitoIdentityServiceProvider
var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.adminForgetDevice(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the CognitoIdentityServiceProvider object uses this specific API, you can
construct the object by passing the apiVersion
option to the constructor:
var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider({apiVersion: '2016-04-18'});
You can also set the API version globally in AWS.config.apiVersions
using
the cognitoidentityserviceprovider service identifier:
AWS.config.apiVersions = {
cognitoidentityserviceprovider: '2016-04-18',
// other service API versions
};
var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
Version:
-
2016-04-18
Constructor Summary
-
new AWS.CognitoIdentityServiceProvider(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary
-
addCustomAttributes(params = {}, callback) ⇒ AWS.Request
Adds additional user attributes to the user pool schema.
-
adminAddUserToGroup(params = {}, callback) ⇒ AWS.Request
Adds the specified user to the specified group.
-
adminConfirmSignUp(params = {}, callback) ⇒ AWS.Request
Confirms user registration as an admin without using a confirmation code.
-
adminCreateUser(params = {}, callback) ⇒ AWS.Request
Creates a new user in the specified user pool.
-
adminDeleteUser(params = {}, callback) ⇒ AWS.Request
Deletes a user as an administrator.
-
adminDeleteUserAttributes(params = {}, callback) ⇒ AWS.Request
Deletes the user attributes in a user pool as an administrator.
-
adminDisableProviderForUser(params = {}, callback) ⇒ AWS.Request
Disables the user from signing in with the specified external (SAML or social) identity provider.
-
adminDisableUser(params = {}, callback) ⇒ AWS.Request
Disables the specified user as an administrator.
-
adminEnableUser(params = {}, callback) ⇒ AWS.Request
Enables the specified user as an administrator.
-
adminForgetDevice(params = {}, callback) ⇒ AWS.Request
Forgets the device, as an administrator.
-
adminGetDevice(params = {}, callback) ⇒ AWS.Request
Gets the device, as an administrator.
-
adminGetUser(params = {}, callback) ⇒ AWS.Request
Gets the specified user by user name in a user pool as an administrator.
-
adminInitiateAuth(params = {}, callback) ⇒ AWS.Request
Initiates the authentication flow, as an administrator.
-
adminLinkProviderForUser(params = {}, callback) ⇒ AWS.Request
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.
-
adminListDevices(params = {}, callback) ⇒ AWS.Request
Lists devices, as an administrator.
-
adminListGroupsForUser(params = {}, callback) ⇒ AWS.Request
Lists the groups that the user belongs to.
-
adminListUserAuthEvents(params = {}, callback) ⇒ AWS.Request
Lists a history of user activity and any risks detected as part of Amazon Cognito advanced security.
-
adminRemoveUserFromGroup(params = {}, callback) ⇒ AWS.Request
Removes the specified user from the specified group.
-
adminResetUserPassword(params = {}, callback) ⇒ AWS.Request
Resets the specified user's password in a user pool as an administrator.
-
adminRespondToAuthChallenge(params = {}, callback) ⇒ AWS.Request
Responds to an authentication challenge, as an administrator.
-
adminSetUserMFAPreference(params = {}, callback) ⇒ AWS.Request
Sets the user's multi-factor authentication (MFA) preference.
-
adminSetUserSettings(params = {}, callback) ⇒ AWS.Request
Sets all the user settings for a specified user name.
-
adminUpdateAuthEventFeedback(params = {}, callback) ⇒ AWS.Request
Provides feedback for an authentication event as to whether it was from a valid user.
-
adminUpdateDeviceStatus(params = {}, callback) ⇒ AWS.Request
Updates the device status as an administrator.
-
adminUpdateUserAttributes(params = {}, callback) ⇒ AWS.Request
Updates the specified user's attributes, including developer attributes, as an administrator.
-
adminUserGlobalSignOut(params = {}, callback) ⇒ AWS.Request
Signs out users from all devices, as an administrator.
-
associateSoftwareToken(params = {}, callback) ⇒ AWS.Request
Returns a unique generated shared secret key code for the user account.
-
changePassword(params = {}, callback) ⇒ AWS.Request
Changes the password for a specified user in a user pool.
-
confirmDevice(params = {}, callback) ⇒ AWS.Request
Confirms tracking of the device.
-
confirmForgotPassword(params = {}, callback) ⇒ AWS.Request
Allows a user to enter a confirmation code to reset a forgotten password.
-
confirmSignUp(params = {}, callback) ⇒ AWS.Request
Confirms registration of a user and handles the existing alias from a previous user.
-
createGroup(params = {}, callback) ⇒ AWS.Request
Creates a new group in the specified user pool.
-
createIdentityProvider(params = {}, callback) ⇒ AWS.Request
Creates an identity provider for a user pool.
-
createResourceServer(params = {}, callback) ⇒ AWS.Request
Creates a new OAuth2.0 resource server and defines custom scopes in it.
-
createUserImportJob(params = {}, callback) ⇒ AWS.Request
Creates the user import job.
-
createUserPool(params = {}, callback) ⇒ AWS.Request
Creates a new Amazon Cognito user pool and sets the password policy for the pool.
-
createUserPoolClient(params = {}, callback) ⇒ AWS.Request
Creates the user pool client.
-
createUserPoolDomain(params = {}, callback) ⇒ AWS.Request
Creates a new domain for a user pool.
-
deleteGroup(params = {}, callback) ⇒ AWS.Request
Deletes a group.
-
deleteIdentityProvider(params = {}, callback) ⇒ AWS.Request
Deletes an identity provider for a user pool.
-
deleteResourceServer(params = {}, callback) ⇒ AWS.Request
Deletes a resource server.
-
deleteUser(params = {}, callback) ⇒ AWS.Request
Allows a user to delete himself or herself.
-
deleteUserAttributes(params = {}, callback) ⇒ AWS.Request
Deletes the attributes for a user.
-
deleteUserPool(params = {}, callback) ⇒ AWS.Request
Deletes the specified Amazon Cognito user pool.
-
deleteUserPoolClient(params = {}, callback) ⇒ AWS.Request
Allows the developer to delete the user pool client.
-
deleteUserPoolDomain(params = {}, callback) ⇒ AWS.Request
Deletes a domain for a user pool.
-
describeIdentityProvider(params = {}, callback) ⇒ AWS.Request
Gets information about a specific identity provider.
-
describeResourceServer(params = {}, callback) ⇒ AWS.Request
Describes a resource server.
-
describeRiskConfiguration(params = {}, callback) ⇒ AWS.Request
Describes the risk configuration.
-
describeUserImportJob(params = {}, callback) ⇒ AWS.Request
Describes the user import job.
-
describeUserPool(params = {}, callback) ⇒ AWS.Request
Returns the configuration information and metadata of the specified user pool.
-
describeUserPoolClient(params = {}, callback) ⇒ AWS.Request
Client method for returning the configuration information and metadata of the specified user pool app client.
-
describeUserPoolDomain(params = {}, callback) ⇒ AWS.Request
Gets information about a domain.
-
forgetDevice(params = {}, callback) ⇒ AWS.Request
Forgets the specified device.
-
forgotPassword(params = {}, callback) ⇒ AWS.Request
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.
-
getCSVHeader(params = {}, callback) ⇒ AWS.Request
Gets the header information for the .csv file to be used as input for the user import job.
-
getDevice(params = {}, callback) ⇒ AWS.Request
Gets the device.
-
getGroup(params = {}, callback) ⇒ AWS.Request
Gets a group.
-
getIdentityProviderByIdentifier(params = {}, callback) ⇒ AWS.Request
Gets the specified identity provider.
-
getSigningCertificate(params = {}, callback) ⇒ AWS.Request
This method takes a user pool ID, and returns the signing certificate.
-
getUICustomization(params = {}, callback) ⇒ AWS.Request
Gets the UI Customization information for a particular app client's app UI, if there is something set.
-
getUser(params = {}, callback) ⇒ AWS.Request
Gets the user attributes and metadata for a user.
-
getUserAttributeVerificationCode(params = {}, callback) ⇒ AWS.Request
Gets the user attribute verification code for the specified attribute name.
-
getUserPoolMfaConfig(params = {}, callback) ⇒ AWS.Request
Gets the user pool multi-factor authentication (MFA) configuration.
-
globalSignOut(params = {}, callback) ⇒ AWS.Request
Signs out users from all devices.
-
initiateAuth(params = {}, callback) ⇒ AWS.Request
Initiates the authentication flow.
-
listDevices(params = {}, callback) ⇒ AWS.Request
Lists the devices.
-
listGroups(params = {}, callback) ⇒ AWS.Request
Lists the groups associated with a user pool.
-
listIdentityProviders(params = {}, callback) ⇒ AWS.Request
Lists information about all identity providers for a user pool.
-
listResourceServers(params = {}, callback) ⇒ AWS.Request
Lists the resource servers for a user pool.
-
listTagsForResource(params = {}, callback) ⇒ AWS.Request
Lists the tags that are assigned to an Amazon Cognito user pool.
-
listUserImportJobs(params = {}, callback) ⇒ AWS.Request
Lists the user import jobs.
-
listUserPoolClients(params = {}, callback) ⇒ AWS.Request
Lists the clients that have been created for the specified user pool.
-
listUserPools(params = {}, callback) ⇒ AWS.Request
Lists the user pools associated with an AWS account.
-
listUsers(params = {}, callback) ⇒ AWS.Request
Lists the users in the Amazon Cognito user pool.
-
listUsersInGroup(params = {}, callback) ⇒ AWS.Request
Lists the users in the specified group.
-
resendConfirmationCode(params = {}, callback) ⇒ AWS.Request
Resends the confirmation (for confirmation of registration) to a specific user in the user pool.
-
respondToAuthChallenge(params = {}, callback) ⇒ AWS.Request
Responds to the authentication challenge.
-
setRiskConfiguration(params = {}, callback) ⇒ AWS.Request
Configures actions on detected risks.
-
setUICustomization(params = {}, callback) ⇒ AWS.Request
Sets the UI customization information for a user pool's built-in app UI.
-
setUserMFAPreference(params = {}, callback) ⇒ AWS.Request
Set the user's multi-factor authentication (MFA) method preference.
-
setUserPoolMfaConfig(params = {}, callback) ⇒ AWS.Request
Set the user pool MFA configuration.
-
setUserSettings(params = {}, callback) ⇒ AWS.Request
Sets the user settings like multi-factor authentication (MFA).
-
signUp(params = {}, callback) ⇒ AWS.Request
Registers the user in the specified user pool and creates a user name, password, and user attributes.
-
startUserImportJob(params = {}, callback) ⇒ AWS.Request
Starts the user import.
-
stopUserImportJob(params = {}, callback) ⇒ AWS.Request
Stops the user import job.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Assigns a set of tags to an Amazon Cognito user pool.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Removes the specified tags from an Amazon Cognito user pool.
-
updateAuthEventFeedback(params = {}, callback) ⇒ AWS.Request
Provides the feedback for an authentication event whether it was from a valid user or not.
-
updateDeviceStatus(params = {}, callback) ⇒ AWS.Request
Updates the device status.
-
updateGroup(params = {}, callback) ⇒ AWS.Request
Updates the specified group with the specified attributes.
-
updateIdentityProvider(params = {}, callback) ⇒ AWS.Request
Updates identity provider information for a user pool.
-
updateResourceServer(params = {}, callback) ⇒ AWS.Request
Updates the name and scopes of resource server.
-
updateUserAttributes(params = {}, callback) ⇒ AWS.Request
Allows a user to update a specific attribute (one at a time).
-
updateUserPool(params = {}, callback) ⇒ AWS.Request
Updates the specified user pool with the specified attributes.
-
updateUserPoolClient(params = {}, callback) ⇒ AWS.Request
Updates the specified user pool app client with the specified attributes.
-
updateUserPoolDomain(params = {}, callback) ⇒ AWS.Request
Updates the Secure Sockets Layer (SSL) certificate for the custom domain for your user pool.
-
verifySoftwareToken(params = {}, callback) ⇒ AWS.Request
Use this API to register a user's entered TOTP code and mark the user's software token MFA status as "verified" if successful.
-
verifyUserAttribute(params = {}, callback) ⇒ AWS.Request
Verifies the specified user attributes in the user pool.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
new AWS.CognitoIdentityServiceProvider(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Examples:
Constructing a CognitoIdentityServiceProvider object
var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider({apiVersion: '2016-04-18'});
Options Hash (options):
-
params
(map)
—
An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
-
endpoint
(String)
—
The endpoint URI to send requests to. The default endpoint is built from the configured
region
. The endpoint should be a string like'https://{service}.{region}.amazonaws.com'
. -
accessKeyId
(String)
—
your AWS access key ID.
-
secretAccessKey
(String)
—
your AWS secret access key.
-
sessionToken
(AWS.Credentials)
—
the optional AWS session token to sign requests with.
-
credentials
(AWS.Credentials)
—
the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.
-
credentialProvider
(AWS.CredentialProviderChain)
—
the provider chain used to resolve credentials if no static
credentials
property is set. -
region
(String)
—
the region to send service requests to. See AWS.CognitoIdentityServiceProvider.region for more information.
-
maxRetries
(Integer)
—
the maximum amount of retries to attempt with a request. See AWS.CognitoIdentityServiceProvider.maxRetries for more information.
-
maxRedirects
(Integer)
—
the maximum amount of redirects to follow with a request. See AWS.CognitoIdentityServiceProvider.maxRedirects for more information.
-
sslEnabled
(Boolean)
—
whether to enable SSL for requests.
-
paramValidation
(Boolean|map)
—
whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
true
. - max [Boolean] — Validates that a value meets the max constraint.
- pattern [Boolean] — Validates that a string value matches a regular expression.
- enum [Boolean] — Validates that a string value matches one of the allowable enum values.
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
-
computeChecksums
(Boolean)
—
whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)
-
convertResponseTypes
(Boolean)
—
whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to
true
. -
correctClockSkew
(Boolean)
—
whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to
false
. -
s3ForcePathStyle
(Boolean)
—
whether to force path style URLs for S3 objects.
-
s3BucketEndpoint
(Boolean)
—
whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an
endpoint
to be provided explicitly to the service constructor. -
s3DisableBodySigning
(Boolean)
—
whether S3 body signing should be disabled when using signature version
v4
. Body signing can only be disabled when using https. Defaults totrue
. -
retryDelayOptions
(map)
—
A set of options to configure the retry delay on retryable errors. Currently supported options are:
- base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
- customBackoff [function] — A custom function that accepts a retry count
and returns the amount of time to delay in milliseconds. The
base
option will be ignored if this option is supplied.
-
httpOptions
(map)
—
A set of options to pass to the low-level HTTP request. Currently supported options are:
- proxy [String] — the URL to proxy requests through
- agent [http.Agent, https.Agent] — the Agent object to perform
HTTP requests with. Used for connection pooling. Defaults to the global
agent (
http.globalAgent
) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment. - connectTimeout [Integer] — Sets the socket to timeout after
failing to establish a connection with the server after
connectTimeout
milliseconds. This timeout has no effect once a socket connection has been established. - timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
- xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
- xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
-
apiVersion
(String, Date)
—
a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by
apiVersions
). Specify 'latest' to use the latest possible version. -
apiVersions
(map<String, String|Date>)
—
a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
-
logger
(#write, #log)
—
an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests
-
systemClockOffset
(Number)
—
an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global
AWS.config
object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds. -
signatureVersion
(String)
—
the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.
-
signatureCache
(Boolean)
—
whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to
true
. -
dynamoDbCrc32
(Boolean)
—
whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default:
true
. -
useAccelerateEndpoint
(Boolean)
—
Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default:
false
. -
clientSideMonitoring
(Boolean)
—
whether to collect and publish this client's performance metrics of all its API requests.
-
endpointDiscoveryEnabled
(Boolean)
—
whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'
-
endpointCacheSize
(Number)
—
the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000
-
hostPrefixEnabled
(Boolean)
—
whether to marshal request parameters to the prefix of hostname. Defaults to
true
.
Property Details
Method Details
addCustomAttributes(params = {}, callback) ⇒ AWS.Request
Adds additional user attributes to the user pool schema.
Service Reference:
Examples:
Calling the addCustomAttributes operation
var params = {
CustomAttributes: [ /* required */
{
AttributeDataType: String | Number | DateTime | Boolean,
DeveloperOnlyAttribute: true || false,
Mutable: true || false,
Name: 'STRING_VALUE',
NumberAttributeConstraints: {
MaxValue: 'STRING_VALUE',
MinValue: 'STRING_VALUE'
},
Required: true || false,
StringAttributeConstraints: {
MaxLength: 'STRING_VALUE',
MinLength: 'STRING_VALUE'
}
},
/* more items */
],
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.addCustomAttributes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to add custom attributes.
CustomAttributes
— (Array<map>
)An array of custom attributes, such as Mutable and Name.
Name
— (String
)A schema attribute of the name type.
AttributeDataType
— (String
)The attribute data type.
Possible values include:"String"
"Number"
"DateTime"
"Boolean"
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
— (map
)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
— (map
)Specifies the constraints for an attribute of the string type.
MinLength
— (String
)The minimum length.
MaxLength
— (String
)The maximum length.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminAddUserToGroup(params = {}, callback) ⇒ AWS.Request
Adds the specified user to the specified group.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminAddUserToGroup operation
var params = {
GroupName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminAddUserToGroup(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
Username
— (String
)The username for the user.
GroupName
— (String
)The group name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminConfirmSignUp(params = {}, callback) ⇒ AWS.Request
Confirms user registration as an admin without using a confirmation code. Works on any user.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminConfirmSignUp operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminConfirmSignUp(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for which you want to confirm user registration.
Username
— (String
)The user name for which you want to confirm user registration.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminCreateUser(params = {}, callback) ⇒ AWS.Request
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).
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.
Service Reference:
Examples:
Calling the adminCreateUser operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
DesiredDeliveryMediums: [
SMS | EMAIL,
/* more items */
],
ForceAliasCreation: true || false,
MessageAction: RESEND | SUPPRESS,
TemporaryPassword: 'STRING_VALUE',
UserAttributes: [
{
Name: 'STRING_VALUE', /* required */
Value: 'STRING_VALUE'
},
/* more items */
],
ValidationData: [
{
Name: 'STRING_VALUE', /* required */
Value: 'STRING_VALUE'
},
/* more items */
]
};
cognitoidentityserviceprovider.adminCreateUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where the user will be created.
Username
— (String
)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.
UserAttributes
— (Array<map>
)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 toAdminCreateUser
) 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 theemail_verified
attribute toTrue
, and you can set thephone_number_verified
attribute toTrue
. (You can also do this by calling .)-
email: The email address of the user to whom the message that contains the code and username will be sent. Required if the
email_verified
attribute is set toTrue
, or if"EMAIL"
is specified in theDesiredDeliveryMediums
parameter. -
phone_number: The phone number of the user to whom the message that contains the code and username will be sent. Required if the
phone_number_verified
attribute is set toTrue
, or if"SMS"
is specified in theDesiredDeliveryMediums
parameter.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
-
ValidationData
— (Array<map>
)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.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
TemporaryPassword
— (String
)The user's temporary password. This password must conform to the password policy that you specified when you created the user pool.
The 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 theMessageAction
parameter.ForceAliasCreation
— (Boolean
)This parameter is only used if the
phone_number_verified
oremail_verified
attribute is set toTrue
. 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 anAliasExistsException
error if the alias already exists. The default value isFalse
.MessageAction
— (String
)Set to
Possible values include:"RESEND"
to resend the invitation message to a user that already exists and reset the expiration limit on the user's account. Set to"SUPPRESS"
to suppress sending the message. Only one value can be specified."RESEND"
"SUPPRESS"
DesiredDeliveryMediums
— (Array<String>
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:User
— (map
)The newly created user.
Username
— (String
)The user name of the user you wish to describe.
Attributes
— (Array<map>
)A container with information about the user type attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
UserCreateDate
— (Date
)The creation date of the user.
UserLastModifiedDate
— (Date
)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:
-
UNCONFIRMED - User has been created but not confirmed.
-
CONFIRMED - User has been confirmed.
-
ARCHIVED - User is no longer active.
-
COMPROMISED - User is disabled due to a potential security threat.
-
UNKNOWN - User status is not known.
-
RESET_REQUIRED - User is confirmed, but the user must request a code and reset his or her password before he or she can sign in.
-
FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change his or her password to a new value before doing anything else.
"UNCONFIRMED"
"CONFIRMED"
"ARCHIVED"
"COMPROMISED"
"UNKNOWN"
"RESET_REQUIRED"
"FORCE_CHANGE_PASSWORD"
-
MFAOptions
— (Array<map>
)The MFA options for the user.
DeliveryMedium
— (String
)The delivery medium (email message or SMS message) to send the MFA code.
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name of the MFA option type.
-
(AWS.Response)
—
Returns:
adminDeleteUser(params = {}, callback) ⇒ AWS.Request
Deletes a user as an administrator. Works on any user.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminDeleteUser operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminDeleteUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to delete the user.
Username
— (String
)The user name of the user you wish to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminDeleteUserAttributes(params = {}, callback) ⇒ AWS.Request
Deletes the user attributes in a user pool as an administrator. Works on any user.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminDeleteUserAttributes operation
var params = {
UserAttributeNames: [ /* required */
'STRING_VALUE',
/* more items */
],
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminDeleteUserAttributes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to delete user attributes.
Username
— (String
)The user name of the user from which you would like to delete attributes.
UserAttributeNames
— (Array<String>
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminDisableProviderForUser(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the adminDisableProviderForUser operation
var params = {
User: { /* required */
ProviderAttributeName: 'STRING_VALUE',
ProviderAttributeValue: 'STRING_VALUE',
ProviderName: 'STRING_VALUE'
},
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminDisableProviderForUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
User
— (map
)The user to be disabled.
ProviderName
— (String
)The name of the provider, for example, Facebook, Google, or Login with Amazon.
ProviderAttributeName
— (String
)The name of the provider attribute to link to, for example,
NameID
.ProviderAttributeValue
— (String
)The value of the provider attribute to link to, for example,
xxxxx_account
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminDisableUser(params = {}, callback) ⇒ AWS.Request
Disables the specified user as an administrator. Works on any user.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminDisableUser operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminDisableUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to disable the user.
Username
— (String
)The user name of the user you wish to disable.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminEnableUser(params = {}, callback) ⇒ AWS.Request
Enables the specified user as an administrator. Works on any user.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminEnableUser operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminEnableUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to enable the user.
Username
— (String
)The user name of the user you wish to enable.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminForgetDevice(params = {}, callback) ⇒ AWS.Request
Forgets the device, as an administrator.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminForgetDevice operation
var params = {
DeviceKey: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminForgetDevice(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user name.
DeviceKey
— (String
)The device key.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminGetDevice(params = {}, callback) ⇒ AWS.Request
Gets the device, as an administrator.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminGetDevice operation
var params = {
DeviceKey: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminGetDevice(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
DeviceKey
— (String
)The device key.
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Device
— (map
)The device.
DeviceKey
— (String
)The device key.
DeviceAttributes
— (Array<map>
)The device attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
DeviceCreateDate
— (Date
)The creation date of the device.
DeviceLastModifiedDate
— (Date
)The last modified date of the device.
DeviceLastAuthenticatedDate
— (Date
)The date in which the device was last authenticated.
-
(AWS.Response)
—
Returns:
adminGetUser(params = {}, callback) ⇒ AWS.Request
Gets the specified user by user name in a user pool as an administrator. Works on any user.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminGetUser operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminGetUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to get information about the user.
Username
— (String
)The user name of the user you wish to retrieve.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Username
— (String
)The user name of the user about whom you are receiving information.
UserAttributes
— (Array<map>
)An array of name-value pairs representing user attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
UserCreateDate
— (Date
)The date the user was created.
UserLastModifiedDate
— (Date
)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:
-
UNCONFIRMED - User has been created but not confirmed.
-
CONFIRMED - User has been confirmed.
-
ARCHIVED - User is no longer active.
-
COMPROMISED - User is disabled due to a potential security threat.
-
UNKNOWN - User status is not known.
-
RESET_REQUIRED - User is confirmed, but the user must request a code and reset his or her password before he or she can sign in.
-
FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change his or her password to a new value before doing anything else.
"UNCONFIRMED"
"CONFIRMED"
"ARCHIVED"
"COMPROMISED"
"UNKNOWN"
"RESET_REQUIRED"
"FORCE_CHANGE_PASSWORD"
-
MFAOptions
— (Array<map>
)Specifies the options for MFA (e.g., email or phone number).
DeliveryMedium
— (String
)The delivery medium (email message or SMS message) to send the MFA code.
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name of the MFA option type.
PreferredMfaSetting
— (String
)The user's preferred MFA setting.
UserMFASettingList
— (Array<String>
)The list of the user's MFA settings.
-
(AWS.Response)
—
Returns:
adminInitiateAuth(params = {}, callback) ⇒ AWS.Request
Initiates the authentication flow, as an administrator.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminInitiateAuth operation
var params = {
AuthFlow: USER_SRP_AUTH | REFRESH_TOKEN_AUTH | REFRESH_TOKEN | CUSTOM_AUTH | ADMIN_NO_SRP_AUTH | USER_PASSWORD_AUTH, /* required */
ClientId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
AuthParameters: {
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
},
ClientMetadata: {
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
},
ContextData: {
HttpHeaders: [ /* required */
{
headerName: 'STRING_VALUE',
headerValue: 'STRING_VALUE'
},
/* more items */
],
IpAddress: 'STRING_VALUE', /* required */
ServerName: 'STRING_VALUE', /* required */
ServerPath: 'STRING_VALUE', /* required */
EncodedData: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.adminInitiateAuth(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The ID of the Amazon Cognito user pool.
ClientId
— (String
)The app client ID.
AuthFlow
— (String
)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 inUSERNAME
andSRP_A
and return the SRP variables to be used for next challenge execution. -
USER_PASSWORD_AUTH
will take inUSERNAME
andPASSWORD
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.
"USER_SRP_AUTH"
"REFRESH_TOKEN_AUTH"
"REFRESH_TOKEN"
"CUSTOM_AUTH"
"ADMIN_NO_SRP_AUTH"
"USER_PASSWORD_AUTH"
-
AuthParameters
— (map<String>
)The authentication parameters. These are inputs corresponding to the
AuthFlow
that you are invoking. The required values depend on the value ofAuthFlow
:-
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
-
ClientMetadata
— (map<String>
)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.
AnalyticsMetadata
— (map
)The analytics metadata for collecting Amazon Pinpoint metrics for
AdminInitiateAuth
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
ContextData
— (map
)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
— required — (String
)Source IP address of your user.
ServerName
— required — (String
)Your server endpoint where this API is invoked.
ServerPath
— required — (String
)Your server path where this API is invoked.
HttpHeaders
— required — (Array<map>
)HttpHeaders received on your server in same order.
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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties: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.-
MFA_SETUP
: If MFA is required, users who do not have at least one of the MFA methods set up are presented with anMFA_SETUP
challenge. The user must set up at least one MFA type to continue to authenticate. -
SELECT_MFA_TYPE
: Selects the MFA type. Valid MFA options areSMS_MFA
for text SMS MFA, andSOFTWARE_TOKEN_MFA
for TOTP software token MFA. -
SMS_MFA
: Next challenge is to supply anSMS_MFA_CODE
, delivered via SMS. -
PASSWORD_VERIFIER
: Next challenge is to supplyPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 toPASSWORD_VERIFIER
, but for devices only. -
ADMIN_NO_SRP_AUTH
: This is returned if you need to authenticate withUSERNAME
andPASSWORD
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 withNEW_PASSWORD
and any other required attributes.
"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
)The session which should be passed both ways in challenge-response calls to the service. If
AdminInitiateAuth
orAdminRespondToAuthChallenge
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 nextAdminRespondToAuthChallenge
API call.ChallengeParameters
— (map<String>
)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
andSECRET_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 toAdminInitiateAuth
. This is because, in theAdminRespondToAuthChallenge
APIChallengeResponses
, theUSERNAME
attribute cannot be an alias.AuthenticationResult
— (map
)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
, andSession
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
— (map
)The new device metadata from an authentication result.
DeviceKey
— (String
)The device key.
DeviceGroupKey
— (String
)The device group key.
-
(AWS.Response)
—
Returns:
adminLinkProviderForUser(params = {}, callback) ⇒ AWS.Request
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.
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.
Service Reference:
Examples:
Calling the adminLinkProviderForUser operation
var params = {
DestinationUser: { /* required */
ProviderAttributeName: 'STRING_VALUE',
ProviderAttributeValue: 'STRING_VALUE',
ProviderName: 'STRING_VALUE'
},
SourceUser: { /* required */
ProviderAttributeName: 'STRING_VALUE',
ProviderAttributeValue: 'STRING_VALUE',
ProviderName: 'STRING_VALUE'
},
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminLinkProviderForUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
DestinationUser
— (map
)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 theDestinationUser
should be the username in the user pool. For a federated user, it should be the provider-specificuser_id
.The
ProviderAttributeName
of theDestinationUser
is ignored.The
ProviderName
should be set toCognito
for users in Cognito user pools.ProviderName
— (String
)The name of the provider, for example, Facebook, Google, or Login with Amazon.
ProviderAttributeName
— (String
)The name of the provider attribute to link to, for example,
NameID
.ProviderAttributeValue
— (String
)The value of the provider attribute to link to, for example,
xxxxx_account
.
SourceUser
— (map
)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 theProviderAttributeName
toCognito_Subject
. For social identity providers, theProviderName
will beFacebook
,Google
, orLoginWithAmazon
, and Cognito will automatically parse the Facebook, Google, and Login with Amazon tokens forid
,sub
, anduser_id
, respectively. TheProviderAttributeValue
for the user must be the same value as theid
,sub
, oruser_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 theProviderAttributeName
. If you setProviderAttributeName
toCognito_Subject
, Cognito will automatically parse the default unique identifier found in the subject from the SAML token.ProviderName
— (String
)The name of the provider, for example, Facebook, Google, or Login with Amazon.
ProviderAttributeName
— (String
)The name of the provider attribute to link to, for example,
NameID
.ProviderAttributeValue
— (String
)The value of the provider attribute to link to, for example,
xxxxx_account
.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminListDevices(params = {}, callback) ⇒ AWS.Request
Lists devices, as an administrator.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminListDevices operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
Limit: 'NUMBER_VALUE',
PaginationToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.adminListDevices(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user name.
Limit
— (Integer
)The limit of the devices request.
PaginationToken
— (String
)The pagination token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Devices
— (Array<map>
)The devices in the list of devices response.
DeviceKey
— (String
)The device key.
DeviceAttributes
— (Array<map>
)The device attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
DeviceCreateDate
— (Date
)The creation date of the device.
DeviceLastModifiedDate
— (Date
)The last modified date of the device.
DeviceLastAuthenticatedDate
— (Date
)The date in which the device was last authenticated.
PaginationToken
— (String
)The pagination token.
-
(AWS.Response)
—
Returns:
adminListGroupsForUser(params = {}, callback) ⇒ AWS.Request
Lists the groups that the user belongs to.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminListGroupsForUser operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
Limit: 'NUMBER_VALUE',
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.adminListGroupsForUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
Username
— (String
)The username for the user.
UserPoolId
— (String
)The user pool ID for the user pool.
Limit
— (Integer
)The limit of the request to list groups.
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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Groups
— (Array<map>
)The groups that the user belongs to.
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
andcognito:preferred_role
claims in the user's tokens. Groups with higherPrecedence
values take precedence over groups with lowerPrecedence
values or with nullPrecedence
values.Two groups can have the same
Precedence
value. If this happens, neither group takes precedence over the other. If two groups with the samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim is not set in users' tokens.The default
Precedence
value is null.LastModifiedDate
— (Date
)The date the group was last modified.
CreationDate
— (Date
)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.
-
(AWS.Response)
—
Returns:
adminListUserAuthEvents(params = {}, callback) ⇒ AWS.Request
Lists a history of user activity and any risks detected as part of Amazon Cognito advanced security.
Service Reference:
Examples:
Calling the adminListUserAuthEvents operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
MaxResults: 'NUMBER_VALUE',
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.adminListUserAuthEvents(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user pool username or an alias.
MaxResults
— (Integer
)The maximum number of authentication events to return.
NextToken
— (String
)A pagination token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:AuthEvents
— (Array<map>
)The response object. It includes the
EventID
,EventType
,CreationDate
,EventRisk
, andEventResponse
.EventId
— (String
)The event ID.
EventType
— (String
)The event type.
Possible values include:"SignIn"
"SignUp"
"ForgotPassword"
CreationDate
— (Date
)The creation date
EventResponse
— (String
)The event response.
Possible values include:"Success"
"Failure"
EventRisk
— (map
)The event risk.
RiskDecision
— (String
)The risk decision.
Possible values include:"NoRisk"
"AccountTakeover"
"Block"
RiskLevel
— (String
)The risk level.
Possible values include:"Low"
"Medium"
"High"
ChallengeResponses
— (Array<map>
)The challenge responses.
ChallengeName
— (String
)The challenge name
Possible values include:"Password"
"Mfa"
ChallengeResponse
— (String
)The challenge response.
Possible values include:"Success"
"Failure"
EventContextData
— (map
)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
— (map
)A flag specifying the user feedback captured at the time of an event request is good or bad.
FeedbackValue
— required — (String
)The event feedback value.
Possible values include:"Valid"
"Invalid"
Provider
— required — (String
)The provider.
FeedbackDate
— (Date
)The event feedback date.
NextToken
— (String
)A pagination token.
-
(AWS.Response)
—
Returns:
adminRemoveUserFromGroup(params = {}, callback) ⇒ AWS.Request
Removes the specified user from the specified group.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminRemoveUserFromGroup operation
var params = {
GroupName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminRemoveUserFromGroup(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
Username
— (String
)The username for the user.
GroupName
— (String
)The group name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminResetUserPassword(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the adminResetUserPassword operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminResetUserPassword(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to reset the user's password.
Username
— (String
)The user name of the user whose password you wish to reset.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminRespondToAuthChallenge(params = {}, callback) ⇒ AWS.Request
Responds to an authentication challenge, as an administrator.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminRespondToAuthChallenge operation
var params = {
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, /* required */
ClientId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
ChallengeResponses: {
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
},
ContextData: {
HttpHeaders: [ /* required */
{
headerName: 'STRING_VALUE',
headerValue: 'STRING_VALUE'
},
/* more items */
],
IpAddress: 'STRING_VALUE', /* required */
ServerName: 'STRING_VALUE', /* required */
ServerPath: 'STRING_VALUE', /* required */
EncodedData: 'STRING_VALUE'
},
Session: 'STRING_VALUE'
};
cognitoidentityserviceprovider.adminRespondToAuthChallenge(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The ID of the Amazon Cognito user pool.
ClientId
— (String
)The app client ID.
ChallengeName
— (String
)The challenge name. For more information, see .
Possible values include:"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
— (map<String>
)The challenge responses. These are inputs corresponding to the value of
ChallengeName
, for example:-
SMS_MFA
:SMS_MFA_CODE
,USERNAME
,SECRET_HASH
(if app client is configured with client secret). -
PASSWORD_VERIFIER
:PASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
,TIMESTAMP
,USERNAME
,SECRET_HASH
(if app client is configured with client secret). -
ADMIN_NO_SRP_AUTH
:PASSWORD
,USERNAME
,SECRET_HASH
(if app client is configured with client secret). -
NEW_PASSWORD_REQUIRED
:NEW_PASSWORD
, any other required attributes,USERNAME
,SECRET_HASH
(if app client is configured with client secret).
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, theAdminInitiateAuth
response includes the actual username value in theUSERNAMEUSER_ID_FOR_SRP
attribute, even if you specified an alias in your call toAdminInitiateAuth
.-
Session
— (String
)The session which should be passed both ways in challenge-response calls to the service. If
InitiateAuth
orRespondToAuthChallenge
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 nextRespondToAuthChallenge
API call.AnalyticsMetadata
— (map
)The analytics metadata for collecting Amazon Pinpoint metrics for
AdminRespondToAuthChallenge
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
ContextData
— (map
)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
— required — (String
)Source IP address of your user.
ServerName
— required — (String
)Your server endpoint where this API is invoked.
ServerPath
— required — (String
)Your server path where this API is invoked.
HttpHeaders
— required — (Array<map>
)HttpHeaders received on your server in same order.
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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ChallengeName
— (String
)The name of the challenge. For more information, see .
Possible values include:"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
)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
— (map<String>
)The challenge parameters. For more information, see .
AuthenticationResult
— (map
)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
— (map
)The new device metadata from an authentication result.
DeviceKey
— (String
)The device key.
DeviceGroupKey
— (String
)The device group key.
-
(AWS.Response)
—
Returns:
adminSetUserMFAPreference(params = {}, callback) ⇒ AWS.Request
Sets the user's multi-factor authentication (MFA) preference.
Service Reference:
Examples:
Calling the adminSetUserMFAPreference operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
SMSMfaSettings: {
Enabled: true || false,
PreferredMfa: true || false
},
SoftwareTokenMfaSettings: {
Enabled: true || false,
PreferredMfa: true || false
}
};
cognitoidentityserviceprovider.adminSetUserMFAPreference(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
SMSMfaSettings
— (map
)The SMS text message MFA settings.
Enabled
— (Boolean
)Specifies whether SMS text message MFA is enabled.
PreferredMfa
— (Boolean
)The preferred MFA method.
SoftwareTokenMfaSettings
— (map
)The time-based one-time password software token MFA settings.
Enabled
— (Boolean
)Specifies whether software token MFA is enabled.
PreferredMfa
— (Boolean
)The preferred MFA method.
Username
— (String
)The user pool username or alias.
UserPoolId
— (String
)The user pool ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminSetUserSettings(params = {}, callback) ⇒ AWS.Request
Sets all the user settings for a specified user name. Works on any user.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminSetUserSettings operation
var params = {
MFAOptions: [ /* required */
{
AttributeName: 'STRING_VALUE',
DeliveryMedium: SMS | EMAIL
},
/* more items */
],
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminSetUserSettings(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to set the user's settings, such as MFA options.
Username
— (String
)The user name of the user for whom you wish to set user settings.
MFAOptions
— (Array<map>
)Specifies the options for MFA (e.g., email or phone number).
DeliveryMedium
— (String
)The delivery medium (email message or SMS message) to send the MFA code.
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name of the MFA option type.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminUpdateAuthEventFeedback(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the adminUpdateAuthEventFeedback operation
var params = {
EventId: 'STRING_VALUE', /* required */
FeedbackValue: Valid | Invalid, /* required */
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminUpdateAuthEventFeedback(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user pool username.
EventId
— (String
)The authentication event ID.
FeedbackValue
— (String
)The authentication event feedback value.
Possible values include:"Valid"
"Invalid"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminUpdateDeviceStatus(params = {}, callback) ⇒ AWS.Request
Updates the device status as an administrator.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminUpdateDeviceStatus operation
var params = {
DeviceKey: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
DeviceRememberedStatus: remembered | not_remembered
};
cognitoidentityserviceprovider.adminUpdateDeviceStatus(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user name.
DeviceKey
— (String
)The device key.
DeviceRememberedStatus
— (String
)The status indicating whether a device has been remembered or not.
Possible values include:"remembered"
"not_remembered"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminUpdateUserAttributes(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the adminUpdateUserAttributes operation
var params = {
UserAttributes: [ /* required */
{
Name: 'STRING_VALUE', /* required */
Value: 'STRING_VALUE'
},
/* more items */
],
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminUpdateUserAttributes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to update user attributes.
Username
— (String
)The user name of the user for whom you want to update user attributes.
UserAttributes
— (Array<map>
)An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the
custom:
prefix to the attribute name.Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
adminUserGlobalSignOut(params = {}, callback) ⇒ AWS.Request
Signs out users from all devices, as an administrator.
Requires developer credentials.
Service Reference:
Examples:
Calling the adminUserGlobalSignOut operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.adminUserGlobalSignOut(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
associateSoftwareToken(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the associateSoftwareToken operation
var params = {
AccessToken: 'STRING_VALUE',
Session: 'STRING_VALUE'
};
cognitoidentityserviceprovider.associateSoftwareToken(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token.
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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties: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.
-
(AWS.Response)
—
Returns:
changePassword(params = {}, callback) ⇒ AWS.Request
Changes the password for a specified user in a user pool.
Service Reference:
Examples:
Calling the changePassword operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
PreviousPassword: 'STRING_VALUE', /* required */
ProposedPassword: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.changePassword(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
PreviousPassword
— (String
)The old password.
ProposedPassword
— (String
)The new password.
AccessToken
— (String
)The access token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
confirmDevice(params = {}, callback) ⇒ AWS.Request
Confirms tracking of the device. This API call is the call that begins device tracking.
Service Reference:
Examples:
Calling the confirmDevice operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
DeviceKey: 'STRING_VALUE', /* required */
DeviceName: 'STRING_VALUE',
DeviceSecretVerifierConfig: {
PasswordVerifier: 'STRING_VALUE',
Salt: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.confirmDevice(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token.
DeviceKey
— (String
)The device key.
DeviceSecretVerifierConfig
— (map
)The configuration of the device secret verifier.
PasswordVerifier
— (String
)The password verifier.
Salt
— (String
)The salt.
DeviceName
— (String
)The device name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserConfirmationNecessary
— (Boolean
)Indicates whether the user confirmation is necessary to confirm the device response.
-
(AWS.Response)
—
Returns:
confirmForgotPassword(params = {}, callback) ⇒ AWS.Request
Allows a user to enter a confirmation code to reset a forgotten password.
Service Reference:
Examples:
Calling the confirmForgotPassword operation
var params = {
ClientId: 'STRING_VALUE', /* required */
ConfirmationCode: 'STRING_VALUE', /* required */
Password: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
SecretHash: 'STRING_VALUE',
UserContextData: {
EncodedData: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.confirmForgotPassword(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ClientId
— (String
)The app client ID of the app associated with the user pool.
SecretHash
— (String
)A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
Username
— (String
)The user name of the user for whom you want to enter a code to retrieve a forgotten password.
ConfirmationCode
— (String
)The confirmation code sent by a user's request to retrieve a forgotten password. For more information, see
Password
— (String
)The password sent by a user's request to retrieve a forgotten password.
AnalyticsMetadata
— (map
)The Amazon Pinpoint analytics metadata for collecting metrics for
ConfirmForgotPassword
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
UserContextData
— (map
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
confirmSignUp(params = {}, callback) ⇒ AWS.Request
Confirms registration of a user and handles the existing alias from a previous user.
Service Reference:
Examples:
Calling the confirmSignUp operation
var params = {
ClientId: 'STRING_VALUE', /* required */
ConfirmationCode: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
ForceAliasCreation: true || false,
SecretHash: 'STRING_VALUE',
UserContextData: {
EncodedData: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.confirmSignUp(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ClientId
— (String
)The ID of the app client associated with the user pool.
SecretHash
— (String
)A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
Username
— (String
)The user name of the user whose registration you wish to confirm.
ConfirmationCode
— (String
)The confirmation code sent by a user's request to confirm registration.
ForceAliasCreation
— (Boolean
)Boolean to be specified to force user confirmation irrespective of existing alias. By default set to
False
. If this parameter is set toTrue
and the phone number/email used for sign up confirmation already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user being confirmed. If set toFalse
, the API will throw an AliasExistsException error.AnalyticsMetadata
— (map
)The Amazon Pinpoint analytics metadata for collecting metrics for
ConfirmSignUp
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
UserContextData
— (map
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
createGroup(params = {}, callback) ⇒ AWS.Request
Creates a new group in the specified user pool.
Requires developer credentials.
Service Reference:
Examples:
Calling the createGroup operation
var params = {
GroupName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Description: 'STRING_VALUE',
Precedence: 'NUMBER_VALUE',
RoleArn: 'STRING_VALUE'
};
cognitoidentityserviceprovider.createGroup(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
GroupName
— (String
)The name of the group. Must be unique.
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. Zero is the highest precedence value. Groups with lower
Precedence
values take precedence over groups with higher or nullPrecedence
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 thecognito:roles
andcognito: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 samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim is not set in users' tokens.The default
Precedence
value is null.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Group
— (map
)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
andcognito:preferred_role
claims in the user's tokens. Groups with higherPrecedence
values take precedence over groups with lowerPrecedence
values or with nullPrecedence
values.Two groups can have the same
Precedence
value. If this happens, neither group takes precedence over the other. If two groups with the samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim is not set in users' tokens.The default
Precedence
value is null.LastModifiedDate
— (Date
)The date the group was last modified.
CreationDate
— (Date
)The date the group was created.
-
(AWS.Response)
—
Returns:
createIdentityProvider(params = {}, callback) ⇒ AWS.Request
Creates an identity provider for a user pool.
Service Reference:
Examples:
Calling the createIdentityProvider operation
var params = {
ProviderDetails: { /* required */
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
},
ProviderName: 'STRING_VALUE', /* required */
ProviderType: SAML | Facebook | Google | LoginWithAmazon | OIDC, /* required */
UserPoolId: 'STRING_VALUE', /* required */
AttributeMapping: {
'<AttributeMappingKeyType>': 'STRING_VALUE',
/* '<AttributeMappingKeyType>': ... */
},
IdpIdentifiers: [
'STRING_VALUE',
/* more items */
]
};
cognitoidentityserviceprovider.createIdentityProvider(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
ProviderType
— (String
)The identity provider type.
Possible values include:"SAML"
"Facebook"
"Google"
"LoginWithAmazon"
"OIDC"
ProviderDetails
— (map<String>
)The identity provider details, such as
MetadataURL
andMetadataFile
.AttributeMapping
— (map<String>
)A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers
— (Array<String>
)A list of identity provider identifiers.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:IdentityProvider
— (map
)The newly created identity provider object.
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
ProviderType
— (String
)The identity provider type.
Possible values include:"SAML"
"Facebook"
"Google"
"LoginWithAmazon"
"OIDC"
ProviderDetails
— (map<String>
)The identity provider details, such as
MetadataURL
andMetadataFile
.AttributeMapping
— (map<String>
)A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers
— (Array<String>
)A list of identity provider identifiers.
LastModifiedDate
— (Date
)The date the identity provider was last modified.
CreationDate
— (Date
)The date the identity provider was created.
-
(AWS.Response)
—
Returns:
createResourceServer(params = {}, callback) ⇒ AWS.Request
Creates a new OAuth2.0 resource server and defines custom scopes in it.
Service Reference:
Examples:
Calling the createResourceServer operation
var params = {
Identifier: 'STRING_VALUE', /* required */
Name: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Scopes: [
{
ScopeDescription: 'STRING_VALUE', /* required */
ScopeName: 'STRING_VALUE' /* required */
},
/* more items */
]
};
cognitoidentityserviceprovider.createResourceServer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
Identifier
— (String
)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
.Name
— (String
)A friendly name for the resource server.
Scopes
— (Array<map>
)A list of scopes. Each scope is map, where the keys are
name
anddescription
.ScopeName
— required — (String
)The name of the scope.
ScopeDescription
— required — (String
)A description of the scope.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ResourceServer
— (map
)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
— (Array<map>
)A list of scopes that are defined for the resource server.
ScopeName
— required — (String
)The name of the scope.
ScopeDescription
— required — (String
)A description of the scope.
-
(AWS.Response)
—
Returns:
createUserImportJob(params = {}, callback) ⇒ AWS.Request
Creates the user import job.
Service Reference:
Examples:
Calling the createUserImportJob operation
var params = {
CloudWatchLogsRoleArn: 'STRING_VALUE', /* required */
JobName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.createUserImportJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
JobName
— (String
)The job name for the user import job.
UserPoolId
— (String
)The user pool ID for the user pool that the users are being imported into.
CloudWatchLogsRoleArn
— (String
)The role ARN for the Amazon CloudWatch Logging role for the user import job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserImportJob
— (map
)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
— (Date
)The date the user import job was created.
StartDate
— (Date
)The date when the user import job was started.
CompletionDate
— (Date
)The date when the user import job was completed.
Status
— (String
)The status of the user import job. One of the following:
-
Created
- The job was created but not started. -
Pending
- A transition state. You have started the job, but it has not begun importing users yet. -
InProgress
- The job has started, and users are being imported. -
Stopping
- You have stopped the job, but the job has not stopped importing users yet. -
Stopped
- You have stopped the job, and the job has stopped importing users. -
Succeeded
- The job has completed successfully. -
Failed
- The job has stopped due to an error. -
Expired
- You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
"Created"
"Pending"
"InProgress"
"Stopping"
"Expired"
"Stopped"
"Failed"
"Succeeded"
-
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.
-
(AWS.Response)
—
Returns:
createUserPool(params = {}, callback) ⇒ AWS.Request
Creates a new Amazon Cognito user pool and sets the password policy for the pool.
Service Reference:
Examples:
Calling the createUserPool operation
var params = {
PoolName: 'STRING_VALUE', /* required */
AdminCreateUserConfig: {
AllowAdminCreateUserOnly: true || false,
InviteMessageTemplate: {
EmailMessage: 'STRING_VALUE',
EmailSubject: 'STRING_VALUE',
SMSMessage: 'STRING_VALUE'
},
UnusedAccountValidityDays: 'NUMBER_VALUE'
},
AliasAttributes: [
phone_number | email | preferred_username,
/* more items */
],
AutoVerifiedAttributes: [
phone_number | email,
/* more items */
],
DeviceConfiguration: {
ChallengeRequiredOnNewDevice: true || false,
DeviceOnlyRememberedOnUserPrompt: true || false
},
EmailConfiguration: {
EmailSendingAccount: COGNITO_DEFAULT | DEVELOPER,
ReplyToEmailAddress: 'STRING_VALUE',
SourceArn: 'STRING_VALUE'
},
EmailVerificationMessage: 'STRING_VALUE',
EmailVerificationSubject: 'STRING_VALUE',
LambdaConfig: {
CreateAuthChallenge: 'STRING_VALUE',
CustomMessage: 'STRING_VALUE',
DefineAuthChallenge: 'STRING_VALUE',
PostAuthentication: 'STRING_VALUE',
PostConfirmation: 'STRING_VALUE',
PreAuthentication: 'STRING_VALUE',
PreSignUp: 'STRING_VALUE',
PreTokenGeneration: 'STRING_VALUE',
UserMigration: 'STRING_VALUE',
VerifyAuthChallengeResponse: 'STRING_VALUE'
},
MfaConfiguration: OFF | ON | OPTIONAL,
Policies: {
PasswordPolicy: {
MinimumLength: 'NUMBER_VALUE',
RequireLowercase: true || false,
RequireNumbers: true || false,
RequireSymbols: true || false,
RequireUppercase: true || false
}
},
Schema: [
{
AttributeDataType: String | Number | DateTime | Boolean,
DeveloperOnlyAttribute: true || false,
Mutable: true || false,
Name: 'STRING_VALUE',
NumberAttributeConstraints: {
MaxValue: 'STRING_VALUE',
MinValue: 'STRING_VALUE'
},
Required: true || false,
StringAttributeConstraints: {
MaxLength: 'STRING_VALUE',
MinLength: 'STRING_VALUE'
}
},
/* more items */
],
SmsAuthenticationMessage: 'STRING_VALUE',
SmsConfiguration: {
SnsCallerArn: 'STRING_VALUE', /* required */
ExternalId: 'STRING_VALUE'
},
SmsVerificationMessage: 'STRING_VALUE',
UserPoolAddOns: {
AdvancedSecurityMode: OFF | AUDIT | ENFORCED /* required */
},
UserPoolTags: {
'<TagKeysType>': 'STRING_VALUE',
/* '<TagKeysType>': ... */
},
UsernameAttributes: [
phone_number | email,
/* more items */
],
VerificationMessageTemplate: {
DefaultEmailOption: CONFIRM_WITH_LINK | CONFIRM_WITH_CODE,
EmailMessage: 'STRING_VALUE',
EmailMessageByLink: 'STRING_VALUE',
EmailSubject: 'STRING_VALUE',
EmailSubjectByLink: 'STRING_VALUE',
SmsMessage: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.createUserPool(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
PoolName
— (String
)A string used to name the user pool.
Policies
— (map
)The policies associated with the new user pool.
PasswordPolicy
— (map
)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
— (map
)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 .
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.
AutoVerifiedAttributes
— (Array<String>
)The attributes to be auto-verified. Possible values: email, phone_number.
AliasAttributes
— (Array<String>
)Attributes supported as an alias for this user pool. Possible values: phone_number, email, or preferred_username.
UsernameAttributes
— (Array<String>
)Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.
SmsVerificationMessage
— (String
)A string representing the SMS verification message.
EmailVerificationMessage
— (String
)A string representing the email verification message.
EmailVerificationSubject
— (String
)A string representing the email verification subject.
VerificationMessageTemplate
— (map
)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.
Possible values include:"CONFIRM_WITH_LINK"
"CONFIRM_WITH_CODE"
SmsAuthenticationMessage
— (String
)A string representing the SMS authentication message.
MfaConfiguration
— (String
)Specifies MFA configuration details.
Possible values include:"OFF"
"ON"
"OPTIONAL"
DeviceConfiguration
— (map
)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.
EmailConfiguration
— (map
)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:-
If you specify
COGNITO_DEFAULT
, Amazon Cognito uses this address as the custom FROM address when it emails your users by using its built-in email account. -
If you specify
DEVELOPER
, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.
-
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.
"COGNITO_DEFAULT"
"DEVELOPER"
SmsConfiguration
— (map
)The SMS configuration.
SnsCallerArn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId
— (String
)The external ID.
UserPoolTags
— (map<String>
)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.
AdminCreateUserConfig
— (map
)The configuration for
AdminCreateUser
requests.AllowAdminCreateUserOnly
— (Boolean
)Set to
True
if only the administrator is allowed to create user profiles. Set toFalse
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 theMessageAction
parameter. The default value for this parameter is 7.Note: If you set a value forTemporaryPasswordValidityDays
inPasswordPolicy
, that value will be used andUnusedAccountValidityDays
will be deprecated for that user pool.InviteMessageTemplate
— (map
)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.
Schema
— (Array<map>
)An array of schema attributes for the new user pool. These attributes can be standard or custom attributes.
Name
— (String
)A schema attribute of the name type.
AttributeDataType
— (String
)The attribute data type.
Possible values include:"String"
"Number"
"DateTime"
"Boolean"
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
— (map
)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
— (map
)Specifies the constraints for an attribute of the string type.
MinLength
— (String
)The minimum length.
MaxLength
— (String
)The maximum length.
UserPoolAddOns
— (map
)Used to enable advanced security risk detection. Set the key
AdvancedSecurityMode
to the value "AUDIT".AdvancedSecurityMode
— required — (String
)The advanced security mode.
Possible values include:"OFF"
"AUDIT"
"ENFORCED"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPool
— (map
)A container for the user pool details.
Id
— (String
)The ID of the user pool.
Name
— (String
)The name of the user pool.
Policies
— (map
)The policies associated with the user pool.
PasswordPolicy
— (map
)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
— (map
)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.
Possible values include:"Enabled"
"Disabled"
LastModifiedDate
— (Date
)The date the user pool was last modified.
CreationDate
— (Date
)The date the user pool was created.
SchemaAttributes
— (Array<map>
)A container with the schema attributes of a user pool.
Name
— (String
)A schema attribute of the name type.
AttributeDataType
— (String
)The attribute data type.
Possible values include:"String"
"Number"
"DateTime"
"Boolean"
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
— (map
)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
— (map
)Specifies the constraints for an attribute of the string type.
MinLength
— (String
)The minimum length.
MaxLength
— (String
)The maximum length.
AutoVerifiedAttributes
— (Array<String>
)Specifies the attributes that are auto-verified in a user pool.
AliasAttributes
— (Array<String>
)Specifies the attributes that are aliased in a user pool.
UsernameAttributes
— (Array<String>
)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
— (map
)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.
Possible values include:"CONFIRM_WITH_LINK"
"CONFIRM_WITH_CODE"
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.
"OFF"
"ON"
"OPTIONAL"
-
DeviceConfiguration
— (map
)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
— (map
)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:-
If you specify
COGNITO_DEFAULT
, Amazon Cognito uses this address as the custom FROM address when it emails your users by using its built-in email account. -
If you specify
DEVELOPER
, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.
-
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.
"COGNITO_DEFAULT"
"DEVELOPER"
SmsConfiguration
— (map
)The SMS configuration.
SnsCallerArn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId
— (String
)The external ID.
UserPoolTags
— (map<String>
)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
— (map
)The configuration for
AdminCreateUser
requests.AllowAdminCreateUserOnly
— (Boolean
)Set to
True
if only the administrator is allowed to create user profiles. Set toFalse
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 theMessageAction
parameter. The default value for this parameter is 7.Note: If you set a value forTemporaryPasswordValidityDays
inPasswordPolicy
, that value will be used andUnusedAccountValidityDays
will be deprecated for that user pool.InviteMessageTemplate
— (map
)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
— (map
)The user pool add-ons.
AdvancedSecurityMode
— required — (String
)The advanced security mode.
Possible values include:"OFF"
"AUDIT"
"ENFORCED"
Arn
— (String
)The Amazon Resource Name (ARN) for the user pool.
-
(AWS.Response)
—
Returns:
createUserPoolClient(params = {}, callback) ⇒ AWS.Request
Creates the user pool client.
Service Reference:
Examples:
Calling the createUserPoolClient operation
var params = {
ClientName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
AllowedOAuthFlows: [
code | implicit | client_credentials,
/* more items */
],
AllowedOAuthFlowsUserPoolClient: true || false,
AllowedOAuthScopes: [
'STRING_VALUE',
/* more items */
],
AnalyticsConfiguration: {
ApplicationId: 'STRING_VALUE', /* required */
ExternalId: 'STRING_VALUE', /* required */
RoleArn: 'STRING_VALUE', /* required */
UserDataShared: true || false
},
CallbackURLs: [
'STRING_VALUE',
/* more items */
],
DefaultRedirectURI: 'STRING_VALUE',
ExplicitAuthFlows: [
ADMIN_NO_SRP_AUTH | CUSTOM_AUTH_FLOW_ONLY | USER_PASSWORD_AUTH,
/* more items */
],
GenerateSecret: true || false,
LogoutURLs: [
'STRING_VALUE',
/* more items */
],
ReadAttributes: [
'STRING_VALUE',
/* more items */
],
RefreshTokenValidity: 'NUMBER_VALUE',
SupportedIdentityProviders: [
'STRING_VALUE',
/* more items */
],
WriteAttributes: [
'STRING_VALUE',
/* more items */
]
};
cognitoidentityserviceprovider.createUserPoolClient(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to create a user pool client.
ClientName
— (String
)The client name for the user pool client you would like to create.
GenerateSecret
— (Boolean
)Boolean to specify whether you want to generate a secret for the user pool client being created.
RefreshTokenValidity
— (Integer
)The time limit, in days, after which the refresh token is no longer valid and cannot be used.
ReadAttributes
— (Array<String>
)The read attributes.
WriteAttributes
— (Array<String>
)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.
ExplicitAuthFlows
— (Array<String>
)The explicit authentication flows.
SupportedIdentityProviders
— (Array<String>
)A list of provider names for the identity providers that are supported on this client. The following are supported:
COGNITO
,Facebook
,Google
andLoginWithAmazon
.CallbackURLs
— (Array<String>
)A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
LogoutURLs
— (Array<String>
)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:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
AllowedOAuthFlows
— (Array<String>
)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
— (Array<String>
)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
— (map
)The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
ApplicationId
— required — (String
)The application ID for an Amazon Pinpoint application.
RoleArn
— required — (String
)The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId
— required — (String
)The external ID.
UserDataShared
— (Boolean
)If
UserDataShared
istrue
, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPoolClient
— (map
)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
— (Date
)The date the user pool client was last modified.
CreationDate
— (Date
)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
— (Array<String>
)The Read-only attributes.
WriteAttributes
— (Array<String>
)The writeable attributes.
ExplicitAuthFlows
— (Array<String>
)The explicit authentication flows.
SupportedIdentityProviders
— (Array<String>
)A list of provider names for the identity providers that are supported on this client.
CallbackURLs
— (Array<String>
)A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
LogoutURLs
— (Array<String>
)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:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
AllowedOAuthFlows
— (Array<String>
)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
— (Array<String>
)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
— (map
)The Amazon Pinpoint analytics configuration for the user pool client.
ApplicationId
— required — (String
)The application ID for an Amazon Pinpoint application.
RoleArn
— required — (String
)The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId
— required — (String
)The external ID.
UserDataShared
— (Boolean
)If
UserDataShared
istrue
, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
-
(AWS.Response)
—
Returns:
createUserPoolDomain(params = {}, callback) ⇒ AWS.Request
Creates a new domain for a user pool.
Service Reference:
Examples:
Calling the createUserPoolDomain operation
var params = {
Domain: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
CustomDomainConfig: {
CertificateArn: 'STRING_VALUE' /* required */
}
};
cognitoidentityserviceprovider.createUserPoolDomain(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
Domain
— (String
)The domain string.
UserPoolId
— (String
)The user pool ID.
CustomDomainConfig
— (map
)The configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.
Provide this parameter only if you want to use a custom domain for your user pool. Otherwise, you can exclude this parameter and use the Amazon Cognito hosted domain instead.
For more information about the hosted domain and custom domains, see Configuring a User Pool Domain.
CertificateArn
— required — (String
)The Amazon Resource Name (ARN) of an AWS Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties: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.
-
(AWS.Response)
—
Returns:
deleteGroup(params = {}, callback) ⇒ AWS.Request
Deletes a group. Currently only groups with no members can be deleted.
Requires developer credentials.
Service Reference:
Examples:
Calling the deleteGroup operation
var params = {
GroupName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteGroup(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
GroupName
— (String
)The name of the group.
UserPoolId
— (String
)The user pool ID for the user pool.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteIdentityProvider(params = {}, callback) ⇒ AWS.Request
Deletes an identity provider for a user pool.
Service Reference:
Examples:
Calling the deleteIdentityProvider operation
var params = {
ProviderName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteIdentityProvider(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteResourceServer(params = {}, callback) ⇒ AWS.Request
Deletes a resource server.
Service Reference:
Examples:
Calling the deleteResourceServer operation
var params = {
Identifier: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteResourceServer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool that hosts the resource server.
Identifier
— (String
)The identifier for the resource server.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteUser(params = {}, callback) ⇒ AWS.Request
Allows a user to delete himself or herself.
Service Reference:
Examples:
Calling the deleteUser operation
var params = {
AccessToken: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token from a request to delete a user.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteUserAttributes(params = {}, callback) ⇒ AWS.Request
Deletes the attributes for a user.
Service Reference:
Examples:
Calling the deleteUserAttributes operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
UserAttributeNames: [ /* required */
'STRING_VALUE',
/* more items */
]
};
cognitoidentityserviceprovider.deleteUserAttributes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserAttributeNames
— (Array<String>
)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.AccessToken
— (String
)The access token used in the request to delete user attributes.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteUserPool(params = {}, callback) ⇒ AWS.Request
Deletes the specified Amazon Cognito user pool.
Service Reference:
Examples:
Calling the deleteUserPool operation
var params = {
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUserPool(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool you want to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteUserPoolClient(params = {}, callback) ⇒ AWS.Request
Allows the developer to delete the user pool client.
Service Reference:
Examples:
Calling the deleteUserPoolClient operation
var params = {
ClientId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUserPoolClient(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to delete the client.
ClientId
— (String
)The app client ID of the app associated with the user pool.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteUserPoolDomain(params = {}, callback) ⇒ AWS.Request
Deletes a domain for a user pool.
Service Reference:
Examples:
Calling the deleteUserPoolDomain operation
var params = {
Domain: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUserPoolDomain(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
Domain
— (String
)The domain string.
UserPoolId
— (String
)The user pool ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
describeIdentityProvider(params = {}, callback) ⇒ AWS.Request
Gets information about a specific identity provider.
Service Reference:
Examples:
Calling the describeIdentityProvider operation
var params = {
ProviderName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeIdentityProvider(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:IdentityProvider
— (map
)The identity provider that was deleted.
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
ProviderType
— (String
)The identity provider type.
Possible values include:"SAML"
"Facebook"
"Google"
"LoginWithAmazon"
"OIDC"
ProviderDetails
— (map<String>
)The identity provider details, such as
MetadataURL
andMetadataFile
.AttributeMapping
— (map<String>
)A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers
— (Array<String>
)A list of identity provider identifiers.
LastModifiedDate
— (Date
)The date the identity provider was last modified.
CreationDate
— (Date
)The date the identity provider was created.
-
(AWS.Response)
—
Returns:
describeResourceServer(params = {}, callback) ⇒ AWS.Request
Describes a resource server.
Service Reference:
Examples:
Calling the describeResourceServer operation
var params = {
Identifier: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeResourceServer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool that hosts the resource server.
Identifier
— (String
)The identifier for the resource server
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ResourceServer
— (map
)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
— (Array<map>
)A list of scopes that are defined for the resource server.
ScopeName
— required — (String
)The name of the scope.
ScopeDescription
— required — (String
)A description of the scope.
-
(AWS.Response)
—
Returns:
describeRiskConfiguration(params = {}, callback) ⇒ AWS.Request
Describes the risk configuration.
Service Reference:
Examples:
Calling the describeRiskConfiguration operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
ClientId: 'STRING_VALUE'
};
cognitoidentityserviceprovider.describeRiskConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
ClientId
— (String
)The app client ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:RiskConfiguration
— (map
)The risk configuration.
UserPoolId
— (String
)The user pool ID.
ClientId
— (String
)The app client ID.
CompromisedCredentialsRiskConfiguration
— (map
)The compromised credentials risk configuration object including the
EventFilter
and theEventAction
EventFilter
— (Array<String>
)Perform the action for these events. The default is to perform all events if no event filter is specified.
Actions
— required — (map
)The compromised credentials risk configuration actions.
EventAction
— required — (String
)The event action.
Possible values include:"BLOCK"
"NO_ACTION"
AccountTakeoverRiskConfiguration
— (map
)The account takeover risk configuration object including the
NotifyConfiguration
object andActions
to take in the case of an account takeover.NotifyConfiguration
— (map
)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
— required — (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
— (map
)Email template used when a detected risk event is blocked.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
NoActionEmail
— (map
)The email template used when a detected risk event is allowed.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
MfaEmail
— (map
)The MFA email template used when MFA is challenged as part of a detected risk.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
Actions
— required — (map
)Account takeover risk configuration actions
LowAction
— (map
)Action to take for a low risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
MediumAction
— (map
)Action to take for a medium risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
HighAction
— (map
)Action to take for a high risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
RiskExceptionConfiguration
— (map
)The configuration to override the risk decision.
BlockedIPRangeList
— (Array<String>
)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
— (Array<String>
)Risk detection is not performed on the IP addresses in the range list. The IP range is in CIDR notation.
LastModifiedDate
— (Date
)The last modified date.
-
(AWS.Response)
—
Returns:
describeUserImportJob(params = {}, callback) ⇒ AWS.Request
Describes the user import job.
Service Reference:
Examples:
Calling the describeUserImportJob operation
var params = {
JobId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeUserImportJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool that the users are being imported into.
JobId
— (String
)The job ID for the user import job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserImportJob
— (map
)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
— (Date
)The date the user import job was created.
StartDate
— (Date
)The date when the user import job was started.
CompletionDate
— (Date
)The date when the user import job was completed.
Status
— (String
)The status of the user import job. One of the following:
-
Created
- The job was created but not started. -
Pending
- A transition state. You have started the job, but it has not begun importing users yet. -
InProgress
- The job has started, and users are being imported. -
Stopping
- You have stopped the job, but the job has not stopped importing users yet. -
Stopped
- You have stopped the job, and the job has stopped importing users. -
Succeeded
- The job has completed successfully. -
Failed
- The job has stopped due to an error. -
Expired
- You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
"Created"
"Pending"
"InProgress"
"Stopping"
"Expired"
"Stopped"
"Failed"
"Succeeded"
-
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.
-
(AWS.Response)
—
Returns:
describeUserPool(params = {}, callback) ⇒ AWS.Request
Returns the configuration information and metadata of the specified user pool.
Service Reference:
Examples:
Calling the describeUserPool operation
var params = {
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeUserPool(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool you want to describe.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPool
— (map
)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
— (map
)The policies associated with the user pool.
PasswordPolicy
— (map
)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
— (map
)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.
Possible values include:"Enabled"
"Disabled"
LastModifiedDate
— (Date
)The date the user pool was last modified.
CreationDate
— (Date
)The date the user pool was created.
SchemaAttributes
— (Array<map>
)A container with the schema attributes of a user pool.
Name
— (String
)A schema attribute of the name type.
AttributeDataType
— (String
)The attribute data type.
Possible values include:"String"
"Number"
"DateTime"
"Boolean"
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
— (map
)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
— (map
)Specifies the constraints for an attribute of the string type.
MinLength
— (String
)The minimum length.
MaxLength
— (String
)The maximum length.
AutoVerifiedAttributes
— (Array<String>
)Specifies the attributes that are auto-verified in a user pool.
AliasAttributes
— (Array<String>
)Specifies the attributes that are aliased in a user pool.
UsernameAttributes
— (Array<String>
)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
— (map
)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.
Possible values include:"CONFIRM_WITH_LINK"
"CONFIRM_WITH_CODE"
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.
"OFF"
"ON"
"OPTIONAL"
-
DeviceConfiguration
— (map
)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
— (map
)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:-
If you specify
COGNITO_DEFAULT
, Amazon Cognito uses this address as the custom FROM address when it emails your users by using its built-in email account. -
If you specify
DEVELOPER
, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.
-
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.
"COGNITO_DEFAULT"
"DEVELOPER"
SmsConfiguration
— (map
)The SMS configuration.
SnsCallerArn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId
— (String
)The external ID.
UserPoolTags
— (map<String>
)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
— (map
)The configuration for
AdminCreateUser
requests.AllowAdminCreateUserOnly
— (Boolean
)Set to
True
if only the administrator is allowed to create user profiles. Set toFalse
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 theMessageAction
parameter. The default value for this parameter is 7.Note: If you set a value forTemporaryPasswordValidityDays
inPasswordPolicy
, that value will be used andUnusedAccountValidityDays
will be deprecated for that user pool.InviteMessageTemplate
— (map
)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
— (map
)The user pool add-ons.
AdvancedSecurityMode
— required — (String
)The advanced security mode.
Possible values include:"OFF"
"AUDIT"
"ENFORCED"
Arn
— (String
)The Amazon Resource Name (ARN) for the user pool.
-
(AWS.Response)
—
Returns:
describeUserPoolClient(params = {}, callback) ⇒ AWS.Request
Client method for returning the configuration information and metadata of the specified user pool app client.
Service Reference:
Examples:
Calling the describeUserPoolClient operation
var params = {
ClientId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeUserPoolClient(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool you want to describe.
ClientId
— (String
)The app client ID of the app associated with the user pool.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPoolClient
— (map
)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
— (Date
)The date the user pool client was last modified.
CreationDate
— (Date
)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
— (Array<String>
)The Read-only attributes.
WriteAttributes
— (Array<String>
)The writeable attributes.
ExplicitAuthFlows
— (Array<String>
)The explicit authentication flows.
SupportedIdentityProviders
— (Array<String>
)A list of provider names for the identity providers that are supported on this client.
CallbackURLs
— (Array<String>
)A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
LogoutURLs
— (Array<String>
)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:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
AllowedOAuthFlows
— (Array<String>
)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
— (Array<String>
)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
— (map
)The Amazon Pinpoint analytics configuration for the user pool client.
ApplicationId
— required — (String
)The application ID for an Amazon Pinpoint application.
RoleArn
— required — (String
)The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId
— required — (String
)The external ID.
UserDataShared
— (Boolean
)If
UserDataShared
istrue
, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
-
(AWS.Response)
—
Returns:
describeUserPoolDomain(params = {}, callback) ⇒ AWS.Request
Gets information about a domain.
Service Reference:
Examples:
Calling the describeUserPoolDomain operation
var params = {
Domain: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeUserPoolDomain(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
Domain
— (String
)The domain string.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:DomainDescription
— (map
)A domain description object containing information about the domain.
UserPoolId
— (String
)The user pool ID.
AWSAccountId
— (String
)The AWS account ID for the user pool owner.
Domain
— (String
)The domain string.
S3Bucket
— (String
)The S3 bucket where the static files for this domain are stored.
CloudFrontDistribution
— (String
)The ARN of the CloudFront distribution.
Version
— (String
)The app version.
Status
— (String
)The domain status.
Possible values include:"CREATING"
"DELETING"
"UPDATING"
"ACTIVE"
"FAILED"
CustomDomainConfig
— (map
)The configuration for a custom domain that hosts the sign-up and sign-in webpages for your application.
CertificateArn
— required — (String
)The Amazon Resource Name (ARN) of an AWS Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.
-
(AWS.Response)
—
Returns:
forgetDevice(params = {}, callback) ⇒ AWS.Request
Forgets the specified device.
Service Reference:
Examples:
Calling the forgetDevice operation
var params = {
DeviceKey: 'STRING_VALUE', /* required */
AccessToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.forgetDevice(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token for the forgotten device request.
DeviceKey
— (String
)The device key.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
forgotPassword(params = {}, callback) ⇒ AWS.Request
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 .
Service Reference:
Examples:
Calling the forgotPassword operation
var params = {
ClientId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
SecretHash: 'STRING_VALUE',
UserContextData: {
EncodedData: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.forgotPassword(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ClientId
— (String
)The ID of the client associated with the user pool.
SecretHash
— (String
)A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
UserContextData
— (map
)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.
Username
— (String
)The user name of the user for whom you want to enter a code to reset a forgotten password.
AnalyticsMetadata
— (map
)The Amazon Pinpoint analytics metadata for collecting metrics for
ForgotPassword
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeDeliveryDetails
— (map
)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).
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name.
-
(AWS.Response)
—
Returns:
getCSVHeader(params = {}, callback) ⇒ AWS.Request
Gets the header information for the .csv file to be used as input for the user import job.
Service Reference:
Examples:
Calling the getCSVHeader operation
var params = {
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getCSVHeader(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool that the users are to be imported into.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPoolId
— (String
)The user pool ID for the user pool that the users are to be imported into.
CSVHeader
— (Array<String>
)The header information for the .csv file for the user import job.
-
(AWS.Response)
—
Returns:
getDevice(params = {}, callback) ⇒ AWS.Request
Gets the device.
Service Reference:
Examples:
Calling the getDevice operation
var params = {
DeviceKey: 'STRING_VALUE', /* required */
AccessToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.getDevice(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
DeviceKey
— (String
)The device key.
AccessToken
— (String
)The access token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Device
— (map
)The device.
DeviceKey
— (String
)The device key.
DeviceAttributes
— (Array<map>
)The device attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
DeviceCreateDate
— (Date
)The creation date of the device.
DeviceLastModifiedDate
— (Date
)The last modified date of the device.
DeviceLastAuthenticatedDate
— (Date
)The date in which the device was last authenticated.
-
(AWS.Response)
—
Returns:
getGroup(params = {}, callback) ⇒ AWS.Request
Examples:
Calling the getGroup operation
var params = {
GroupName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getGroup(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
GroupName
— (String
)The name of the group.
UserPoolId
— (String
)The user pool ID for the user pool.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Group
— (map
)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
andcognito:preferred_role
claims in the user's tokens. Groups with higherPrecedence
values take precedence over groups with lowerPrecedence
values or with nullPrecedence
values.Two groups can have the same
Precedence
value. If this happens, neither group takes precedence over the other. If two groups with the samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim is not set in users' tokens.The default
Precedence
value is null.LastModifiedDate
— (Date
)The date the group was last modified.
CreationDate
— (Date
)The date the group was created.
-
(AWS.Response)
—
Returns:
getIdentityProviderByIdentifier(params = {}, callback) ⇒ AWS.Request
Gets the specified identity provider.
Service Reference:
Examples:
Calling the getIdentityProviderByIdentifier operation
var params = {
IdpIdentifier: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getIdentityProviderByIdentifier(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
IdpIdentifier
— (String
)The identity provider ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:IdentityProvider
— (map
)The identity provider object.
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
ProviderType
— (String
)The identity provider type.
Possible values include:"SAML"
"Facebook"
"Google"
"LoginWithAmazon"
"OIDC"
ProviderDetails
— (map<String>
)The identity provider details, such as
MetadataURL
andMetadataFile
.AttributeMapping
— (map<String>
)A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers
— (Array<String>
)A list of identity provider identifiers.
LastModifiedDate
— (Date
)The date the identity provider was last modified.
CreationDate
— (Date
)The date the identity provider was created.
-
(AWS.Response)
—
Returns:
getSigningCertificate(params = {}, callback) ⇒ AWS.Request
This method takes a user pool ID, and returns the signing certificate.
Service Reference:
Examples:
Calling the getSigningCertificate operation
var params = {
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getSigningCertificate(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Certificate
— (String
)The signing certificate.
-
(AWS.Response)
—
Returns:
getUICustomization(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the getUICustomization operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
ClientId: 'STRING_VALUE'
};
cognitoidentityserviceprovider.getUICustomization(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
ClientId
— (String
)The client ID for the client app.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UICustomization
— (map
)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
— (Date
)The last-modified date for the UI customization.
CreationDate
— (Date
)The creation date for the UI customization.
-
(AWS.Response)
—
Returns:
getUser(params = {}, callback) ⇒ AWS.Request
Gets the user attributes and metadata for a user.
Service Reference:
Examples:
Calling the getUser operation
var params = {
AccessToken: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getUser(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token returned by the server response to get information about the user.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Username
— (String
)The user name of the user you wish to retrieve from the get user request.
UserAttributes
— (Array<map>
)An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the
custom:
prefix to the attribute name.Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
MFAOptions
— (Array<map>
)Specifies the options for MFA (e.g., email or phone number).
DeliveryMedium
— (String
)The delivery medium (email message or SMS message) to send the MFA code.
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name of the MFA option type.
PreferredMfaSetting
— (String
)The user's preferred MFA setting.
UserMFASettingList
— (Array<String>
)The list of the user's MFA settings.
-
(AWS.Response)
—
Returns:
getUserAttributeVerificationCode(params = {}, callback) ⇒ AWS.Request
Gets the user attribute verification code for the specified attribute name.
Service Reference:
Examples:
Calling the getUserAttributeVerificationCode operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
AttributeName: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getUserAttributeVerificationCode(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token returned by the server response to get the user attribute verification code.
AttributeName
— (String
)The attribute name returned by the server response to get the user attribute verification code.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeDeliveryDetails
— (map
)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).
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name.
-
(AWS.Response)
—
Returns:
getUserPoolMfaConfig(params = {}, callback) ⇒ AWS.Request
Gets the user pool multi-factor authentication (MFA) configuration.
Service Reference:
Examples:
Calling the getUserPoolMfaConfig operation
var params = {
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getUserPoolMfaConfig(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:SmsMfaConfiguration
— (map
)The SMS text message multi-factor (MFA) configuration.
SmsAuthenticationMessage
— (String
)The SMS authentication message.
SmsConfiguration
— (map
)The SMS configuration.
SnsCallerArn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId
— (String
)The external ID.
SoftwareTokenMfaConfiguration
— (map
)The software token multi-factor (MFA) configuration.
Enabled
— (Boolean
)Specifies whether software token MFA is enabled.
MfaConfiguration
— (String
)The multi-factor (MFA) configuration.
Possible values include:"OFF"
"ON"
"OPTIONAL"
-
(AWS.Response)
—
Returns:
globalSignOut(params = {}, callback) ⇒ AWS.Request
Signs out users from all devices.
Service Reference:
Examples:
Calling the globalSignOut operation
var params = {
AccessToken: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.globalSignOut(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
initiateAuth(params = {}, callback) ⇒ AWS.Request
Initiates the authentication flow.
Service Reference:
Examples:
Calling the initiateAuth operation
var params = {
AuthFlow: USER_SRP_AUTH | REFRESH_TOKEN_AUTH | REFRESH_TOKEN | CUSTOM_AUTH | ADMIN_NO_SRP_AUTH | USER_PASSWORD_AUTH, /* required */
ClientId: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
AuthParameters: {
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
},
ClientMetadata: {
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
},
UserContextData: {
EncodedData: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.initiateAuth(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AuthFlow
— (String
)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 inUSERNAME
andSRP_A
and return the SRP variables to be used for next challenge execution. -
USER_PASSWORD_AUTH
will take inUSERNAME
andPASSWORD
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."USER_SRP_AUTH"
"REFRESH_TOKEN_AUTH"
"REFRESH_TOKEN"
"CUSTOM_AUTH"
"ADMIN_NO_SRP_AUTH"
"USER_PASSWORD_AUTH"
-
AuthParameters
— (map<String>
)The authentication parameters. These are inputs corresponding to the
AuthFlow
that you are invoking. The required values depend on the value ofAuthFlow
:-
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
-
ClientMetadata
— (map<String>
)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.
ClientId
— (String
)The app client ID.
AnalyticsMetadata
— (map
)The Amazon Pinpoint analytics metadata for collecting metrics for
InitiateAuth
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
UserContextData
— (map
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties: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
andSECRET_HASH
(if applicable) in the parameters.-
SMS_MFA
: Next challenge is to supply anSMS_MFA_CODE
, delivered via SMS. -
PASSWORD_VERIFIER
: Next challenge is to supplyPASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
, andTIMESTAMP
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 toPASSWORD_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 withNEW_PASSWORD
and any other required attributes.
"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
)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
— (map<String>
)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
andSECRET_HASH
(if applicable).AuthenticationResult
— (map
)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
, andSession
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
— (map
)The new device metadata from an authentication result.
DeviceKey
— (String
)The device key.
DeviceGroupKey
— (String
)The device group key.
-
(AWS.Response)
—
Returns:
listDevices(params = {}, callback) ⇒ AWS.Request
Lists the devices.
Service Reference:
Examples:
Calling the listDevices operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
Limit: 'NUMBER_VALUE',
PaginationToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listDevices(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access tokens for the request to list devices.
Limit
— (Integer
)The limit of the device request.
PaginationToken
— (String
)The pagination token for the list request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Devices
— (Array<map>
)The devices returned in the list devices response.
DeviceKey
— (String
)The device key.
DeviceAttributes
— (Array<map>
)The device attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
DeviceCreateDate
— (Date
)The creation date of the device.
DeviceLastModifiedDate
— (Date
)The last modified date of the device.
DeviceLastAuthenticatedDate
— (Date
)The date in which the device was last authenticated.
PaginationToken
— (String
)The pagination token for the list device response.
-
(AWS.Response)
—
Returns:
listGroups(params = {}, callback) ⇒ AWS.Request
Lists the groups associated with a user pool.
Requires developer credentials.
Service Reference:
Examples:
Calling the listGroups operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
Limit: 'NUMBER_VALUE',
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listGroups(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
Limit
— (Integer
)The limit of the request to list groups.
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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Groups
— (Array<map>
)The group objects for the groups.
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
andcognito:preferred_role
claims in the user's tokens. Groups with higherPrecedence
values take precedence over groups with lowerPrecedence
values or with nullPrecedence
values.Two groups can have the same
Precedence
value. If this happens, neither group takes precedence over the other. If two groups with the samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim is not set in users' tokens.The default
Precedence
value is null.LastModifiedDate
— (Date
)The date the group was last modified.
CreationDate
— (Date
)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.
-
(AWS.Response)
—
Returns:
listIdentityProviders(params = {}, callback) ⇒ AWS.Request
Lists information about all identity providers for a user pool.
Service Reference:
Examples:
Calling the listIdentityProviders operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
MaxResults: 'NUMBER_VALUE',
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listIdentityProviders(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
MaxResults
— (Integer
)The maximum number of identity providers to return.
NextToken
— (String
)A pagination token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Providers
— (Array<map>
)A list of identity provider objects.
ProviderName
— (String
)The identity provider name.
ProviderType
— (String
)The identity provider type.
Possible values include:"SAML"
"Facebook"
"Google"
"LoginWithAmazon"
"OIDC"
LastModifiedDate
— (Date
)The date the provider was last modified.
CreationDate
— (Date
)The date the provider was added to the user pool.
NextToken
— (String
)A pagination token.
-
(AWS.Response)
—
Returns:
listResourceServers(params = {}, callback) ⇒ AWS.Request
Lists the resource servers for a user pool.
Service Reference:
Examples:
Calling the listResourceServers operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
MaxResults: 'NUMBER_VALUE',
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listResourceServers(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
MaxResults
— (Integer
)The maximum number of resource servers to return.
NextToken
— (String
)A pagination token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ResourceServers
— (Array<map>
)The resource servers.
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
— (Array<map>
)A list of scopes that are defined for the resource server.
ScopeName
— required — (String
)The name of the scope.
ScopeDescription
— required — (String
)A description of the scope.
NextToken
— (String
)A pagination token.
-
(AWS.Response)
—
Returns:
listTagsForResource(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the listTagsForResource operation
var params = {
ResourceArn: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.listTagsForResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ResourceArn
— (String
)The Amazon Resource Name (ARN) of the user pool that the tags are assigned to.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Tags
— (map<String>
)The tags that are assigned to the user pool.
-
(AWS.Response)
—
Returns:
listUserImportJobs(params = {}, callback) ⇒ AWS.Request
Lists the user import jobs.
Service Reference:
Examples:
Calling the listUserImportJobs operation
var params = {
MaxResults: 'NUMBER_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
PaginationToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUserImportJobs(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool that the users are being imported into.
MaxResults
— (Integer
)The maximum number of import jobs you want the request to return.
PaginationToken
— (String
)An identifier that was returned from the previous call to
ListUserImportJobs
, which can be used to return the next set of import jobs in the list.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserImportJobs
— (Array<map>
)The user import jobs.
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
— (Date
)The date the user import job was created.
StartDate
— (Date
)The date when the user import job was started.
CompletionDate
— (Date
)The date when the user import job was completed.
Status
— (String
)The status of the user import job. One of the following:
-
Created
- The job was created but not started. -
Pending
- A transition state. You have started the job, but it has not begun importing users yet. -
InProgress
- The job has started, and users are being imported. -
Stopping
- You have stopped the job, but the job has not stopped importing users yet. -
Stopped
- You have stopped the job, and the job has stopped importing users. -
Succeeded
- The job has completed successfully. -
Failed
- The job has stopped due to an error. -
Expired
- You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
"Created"
"Pending"
"InProgress"
"Stopping"
"Expired"
"Stopped"
"Failed"
"Succeeded"
-
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.
-
(AWS.Response)
—
Returns:
listUserPoolClients(params = {}, callback) ⇒ AWS.Request
Lists the clients that have been created for the specified user pool.
Service Reference:
Examples:
Calling the listUserPoolClients operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
MaxResults: 'NUMBER_VALUE',
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUserPoolClients(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to list user pool clients.
MaxResults
— (Integer
)The maximum number of results you want the request to return when listing the user pool clients.
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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPoolClients
— (Array<map>
)The user pool clients in the response that lists user pool clients.
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.
-
(AWS.Response)
—
Returns:
listUserPools(params = {}, callback) ⇒ AWS.Request
Lists the user pools associated with an AWS account.
Service Reference:
Examples:
Calling the listUserPools operation
var params = {
MaxResults: 'NUMBER_VALUE', /* required */
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUserPools(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
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.
MaxResults
— (Integer
)The maximum number of results you want the request to return when listing the user pools.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPools
— (Array<map>
)The user pools from the response to list users.
Id
— (String
)The ID in a user pool description.
Name
— (String
)The name in a user pool description.
LambdaConfig
— (map
)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.
Possible values include:"Enabled"
"Disabled"
LastModifiedDate
— (Date
)The date the user pool description was last modified.
CreationDate
— (Date
)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.
-
(AWS.Response)
—
Returns:
listUsers(params = {}, callback) ⇒ AWS.Request
Lists the users in the Amazon Cognito user pool.
Service Reference:
Examples:
Calling the listUsers operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
AttributesToGet: [
'STRING_VALUE',
/* more items */
],
Filter: 'STRING_VALUE',
Limit: 'NUMBER_VALUE',
PaginationToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUsers(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool on which the search should be performed.
AttributesToGet
— (Array<String>
)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.
Limit
— (Integer
)Maximum number of users to be returned.
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.
Filter
— (String
)A filter string of the form "AttributeName Filter-Type "AttributeValue"". Quotation marks within the filter string must be escaped using the backslash () character. For example, "
family_name
= \"Reddy\"".-
AttributeName: The name of the attribute to search for. You can only search for one attribute at a time.
-
Filter-Type: For an exact match, use =, for example, "
given_name
= \"Jon\"". For a prefix ("starts with") match, use ^=, for example, "given_name
^= \"Jon\"". -
AttributeValue: The attribute value that must be matched for each user.
If the filter string is empty,
ListUsers
returns all users in the user pool.You can only search for the following standard attributes:
-
username
(case-sensitive) -
email
-
phone_number
-
name
-
given_name
-
family_name
-
preferred_username
-
cognito:user_status
(called Status in the Console) (case-insensitive) -
status (called Enabled in the Console) (case-sensitive)
-
sub
Custom attributes 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.
-
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Users
— (Array<map>
)The users returned in the request to list users.
Username
— (String
)The user name of the user you wish to describe.
Attributes
— (Array<map>
)A container with information about the user type attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
UserCreateDate
— (Date
)The creation date of the user.
UserLastModifiedDate
— (Date
)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:
-
UNCONFIRMED - User has been created but not confirmed.
-
CONFIRMED - User has been confirmed.
-
ARCHIVED - User is no longer active.
-
COMPROMISED - User is disabled due to a potential security threat.
-
UNKNOWN - User status is not known.
-
RESET_REQUIRED - User is confirmed, but the user must request a code and reset his or her password before he or she can sign in.
-
FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change his or her password to a new value before doing anything else.
"UNCONFIRMED"
"CONFIRMED"
"ARCHIVED"
"COMPROMISED"
"UNKNOWN"
"RESET_REQUIRED"
"FORCE_CHANGE_PASSWORD"
-
MFAOptions
— (Array<map>
)The MFA options for the user.
DeliveryMedium
— (String
)The delivery medium (email message or SMS message) to send the MFA code.
Possible values include:"SMS"
"EMAIL"
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.
-
(AWS.Response)
—
Returns:
listUsersInGroup(params = {}, callback) ⇒ AWS.Request
Lists the users in the specified group.
Requires developer credentials.
Service Reference:
Examples:
Calling the listUsersInGroup operation
var params = {
GroupName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Limit: 'NUMBER_VALUE',
NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUsersInGroup(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
GroupName
— (String
)The name of the group.
Limit
— (Integer
)The limit of the request to list users.
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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Users
— (Array<map>
)The users returned in the request to list users.
Username
— (String
)The user name of the user you wish to describe.
Attributes
— (Array<map>
)A container with information about the user type attributes.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
UserCreateDate
— (Date
)The creation date of the user.
UserLastModifiedDate
— (Date
)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:
-
UNCONFIRMED - User has been created but not confirmed.
-
CONFIRMED - User has been confirmed.
-
ARCHIVED - User is no longer active.
-
COMPROMISED - User is disabled due to a potential security threat.
-
UNKNOWN - User status is not known.
-
RESET_REQUIRED - User is confirmed, but the user must request a code and reset his or her password before he or she can sign in.
-
FORCE_CHANGE_PASSWORD - The user is confirmed and the user can sign in using a temporary password, but on first sign-in, the user must change his or her password to a new value before doing anything else.
"UNCONFIRMED"
"CONFIRMED"
"ARCHIVED"
"COMPROMISED"
"UNKNOWN"
"RESET_REQUIRED"
"FORCE_CHANGE_PASSWORD"
-
MFAOptions
— (Array<map>
)The MFA options for the user.
DeliveryMedium
— (String
)The delivery medium (email message or SMS message) to send the MFA code.
Possible values include:"SMS"
"EMAIL"
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.
-
(AWS.Response)
—
Returns:
resendConfirmationCode(params = {}, callback) ⇒ AWS.Request
Resends the confirmation (for confirmation of registration) to a specific user in the user pool.
Service Reference:
Examples:
Calling the resendConfirmationCode operation
var params = {
ClientId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
SecretHash: 'STRING_VALUE',
UserContextData: {
EncodedData: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.resendConfirmationCode(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ClientId
— (String
)The ID of the client associated with the user pool.
SecretHash
— (String
)A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
UserContextData
— (map
)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.
Username
— (String
)The user name of the user to whom you wish to resend a confirmation code.
AnalyticsMetadata
— (map
)The Amazon Pinpoint analytics metadata for collecting metrics for
ResendConfirmationCode
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeDeliveryDetails
— (map
)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).
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name.
-
(AWS.Response)
—
Returns:
respondToAuthChallenge(params = {}, callback) ⇒ AWS.Request
Responds to the authentication challenge.
Service Reference:
Examples:
Calling the respondToAuthChallenge operation
var params = {
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, /* required */
ClientId: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
ChallengeResponses: {
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
},
Session: 'STRING_VALUE',
UserContextData: {
EncodedData: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.respondToAuthChallenge(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ClientId
— (String
)The app client ID.
ChallengeName
— (String
)The challenge name. For more information, see .
ADMIN_NO_SRP_AUTH
is not a valid value."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
)The session which should be passed both ways in challenge-response calls to the service. If
InitiateAuth
orRespondToAuthChallenge
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 nextRespondToAuthChallenge
API call.ChallengeResponses
— (map<String>
)The challenge responses. These are inputs corresponding to the value of
ChallengeName
, for example:-
SMS_MFA
:SMS_MFA_CODE
,USERNAME
,SECRET_HASH
(if app client is configured with client secret). -
PASSWORD_VERIFIER
:PASSWORD_CLAIM_SIGNATURE
,PASSWORD_CLAIM_SECRET_BLOCK
,TIMESTAMP
,USERNAME
,SECRET_HASH
(if app client is configured with client secret). -
NEW_PASSWORD_REQUIRED
:NEW_PASSWORD
, any other required attributes,USERNAME
,SECRET_HASH
(if app client is configured with client secret).
-
AnalyticsMetadata
— (map
)The Amazon Pinpoint analytics metadata for collecting metrics for
RespondToAuthChallenge
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
UserContextData
— (map
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ChallengeName
— (String
)The challenge name. For more information, see .
Possible values include:"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
)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
— (map<String>
)The challenge parameters. For more information, see .
AuthenticationResult
— (map
)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
— (map
)The new device metadata from an authentication result.
DeviceKey
— (String
)The device key.
DeviceGroupKey
— (String
)The device group key.
-
(AWS.Response)
—
Returns:
setRiskConfiguration(params = {}, callback) ⇒ AWS.Request
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
keyAdvancedSecurityMode
.
See .
Service Reference:
Examples:
Calling the setRiskConfiguration operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
AccountTakeoverRiskConfiguration: {
Actions: { /* required */
HighAction: {
EventAction: BLOCK | MFA_IF_CONFIGURED | MFA_REQUIRED | NO_ACTION, /* required */
Notify: true || false /* required */
},
LowAction: {
EventAction: BLOCK | MFA_IF_CONFIGURED | MFA_REQUIRED | NO_ACTION, /* required */
Notify: true || false /* required */
},
MediumAction: {
EventAction: BLOCK | MFA_IF_CONFIGURED | MFA_REQUIRED | NO_ACTION, /* required */
Notify: true || false /* required */
}
},
NotifyConfiguration: {
SourceArn: 'STRING_VALUE', /* required */
BlockEmail: {
Subject: 'STRING_VALUE', /* required */
HtmlBody: 'STRING_VALUE',
TextBody: 'STRING_VALUE'
},
From: 'STRING_VALUE',
MfaEmail: {
Subject: 'STRING_VALUE', /* required */
HtmlBody: 'STRING_VALUE',
TextBody: 'STRING_VALUE'
},
NoActionEmail: {
Subject: 'STRING_VALUE', /* required */
HtmlBody: 'STRING_VALUE',
TextBody: 'STRING_VALUE'
},
ReplyTo: 'STRING_VALUE'
}
},
ClientId: 'STRING_VALUE',
CompromisedCredentialsRiskConfiguration: {
Actions: { /* required */
EventAction: BLOCK | NO_ACTION /* required */
},
EventFilter: [
SIGN_IN | PASSWORD_CHANGE | SIGN_UP,
/* more items */
]
},
RiskExceptionConfiguration: {
BlockedIPRangeList: [
'STRING_VALUE',
/* more items */
],
SkippedIPRangeList: [
'STRING_VALUE',
/* more items */
]
}
};
cognitoidentityserviceprovider.setRiskConfiguration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
ClientId
— (String
)The app client ID. If
ClientId
is null, then the risk configuration is mapped touserPoolId
. 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.CompromisedCredentialsRiskConfiguration
— (map
)The compromised credentials risk configuration.
EventFilter
— (Array<String>
)Perform the action for these events. The default is to perform all events if no event filter is specified.
Actions
— required — (map
)The compromised credentials risk configuration actions.
EventAction
— required — (String
)The event action.
Possible values include:"BLOCK"
"NO_ACTION"
AccountTakeoverRiskConfiguration
— (map
)The account takeover risk configuration.
NotifyConfiguration
— (map
)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
— required — (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
— (map
)Email template used when a detected risk event is blocked.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
NoActionEmail
— (map
)The email template used when a detected risk event is allowed.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
MfaEmail
— (map
)The MFA email template used when MFA is challenged as part of a detected risk.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
Actions
— required — (map
)Account takeover risk configuration actions
LowAction
— (map
)Action to take for a low risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
MediumAction
— (map
)Action to take for a medium risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
HighAction
— (map
)Action to take for a high risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
RiskExceptionConfiguration
— (map
)The configuration to override the risk decision.
BlockedIPRangeList
— (Array<String>
)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
— (Array<String>
)Risk detection is not performed on the IP addresses in the range list. The IP range is in CIDR notation.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:RiskConfiguration
— (map
)The risk configuration.
UserPoolId
— (String
)The user pool ID.
ClientId
— (String
)The app client ID.
CompromisedCredentialsRiskConfiguration
— (map
)The compromised credentials risk configuration object including the
EventFilter
and theEventAction
EventFilter
— (Array<String>
)Perform the action for these events. The default is to perform all events if no event filter is specified.
Actions
— required — (map
)The compromised credentials risk configuration actions.
EventAction
— required — (String
)The event action.
Possible values include:"BLOCK"
"NO_ACTION"
AccountTakeoverRiskConfiguration
— (map
)The account takeover risk configuration object including the
NotifyConfiguration
object andActions
to take in the case of an account takeover.NotifyConfiguration
— (map
)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
— required — (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
— (map
)Email template used when a detected risk event is blocked.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
NoActionEmail
— (map
)The email template used when a detected risk event is allowed.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
MfaEmail
— (map
)The MFA email template used when MFA is challenged as part of a detected risk.
Subject
— required — (String
)The subject.
HtmlBody
— (String
)The HTML body.
TextBody
— (String
)The text body.
Actions
— required — (map
)Account takeover risk configuration actions
LowAction
— (map
)Action to take for a low risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
MediumAction
— (map
)Action to take for a medium risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
HighAction
— (map
)Action to take for a high risk.
Notify
— required — (Boolean
)Flag specifying whether to send a notification.
EventAction
— required — (String
)The event action.
-
BLOCK
Choosing this action will block the request. -
MFA_IF_CONFIGURED
Throw MFA challenge if user has configured it, else allow the request. -
MFA_REQUIRED
Throw MFA challenge if user has configured it, else block the request. -
NO_ACTION
Allow the user sign-in.
"BLOCK"
"MFA_IF_CONFIGURED"
"MFA_REQUIRED"
"NO_ACTION"
-
RiskExceptionConfiguration
— (map
)The configuration to override the risk decision.
BlockedIPRangeList
— (Array<String>
)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
— (Array<String>
)Risk detection is not performed on the IP addresses in the range list. The IP range is in CIDR notation.
LastModifiedDate
— (Date
)The last modified date.
-
(AWS.Response)
—
Returns:
setUICustomization(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the setUICustomization operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
CSS: 'STRING_VALUE',
ClientId: 'STRING_VALUE',
ImageFile: new Buffer('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */
};
cognitoidentityserviceprovider.setUICustomization(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
ClientId
— (String
)The client ID for the client app.
CSS
— (String
)The CSS values in the UI customization.
ImageFile
— (Buffer, Typed Array, Blob, String
)The uploaded logo image for the UI customization.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UICustomization
— (map
)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
— (Date
)The last-modified date for the UI customization.
CreationDate
— (Date
)The creation date for the UI customization.
-
(AWS.Response)
—
Returns:
setUserMFAPreference(params = {}, callback) ⇒ AWS.Request
Set the user's multi-factor authentication (MFA) method preference.
Service Reference:
Examples:
Calling the setUserMFAPreference operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
SMSMfaSettings: {
Enabled: true || false,
PreferredMfa: true || false
},
SoftwareTokenMfaSettings: {
Enabled: true || false,
PreferredMfa: true || false
}
};
cognitoidentityserviceprovider.setUserMFAPreference(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
SMSMfaSettings
— (map
)The SMS text message multi-factor authentication (MFA) settings.
Enabled
— (Boolean
)Specifies whether SMS text message MFA is enabled.
PreferredMfa
— (Boolean
)The preferred MFA method.
SoftwareTokenMfaSettings
— (map
)The time-based one-time password software token MFA settings.
Enabled
— (Boolean
)Specifies whether software token MFA is enabled.
PreferredMfa
— (Boolean
)The preferred MFA method.
AccessToken
— (String
)The access token.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
setUserPoolMfaConfig(params = {}, callback) ⇒ AWS.Request
Set the user pool MFA configuration.
Service Reference:
Examples:
Calling the setUserPoolMfaConfig operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
MfaConfiguration: OFF | ON | OPTIONAL,
SmsMfaConfiguration: {
SmsAuthenticationMessage: 'STRING_VALUE',
SmsConfiguration: {
SnsCallerArn: 'STRING_VALUE', /* required */
ExternalId: 'STRING_VALUE'
}
},
SoftwareTokenMfaConfiguration: {
Enabled: true || false
}
};
cognitoidentityserviceprovider.setUserPoolMfaConfig(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
SmsMfaConfiguration
— (map
)The SMS text message MFA configuration.
SmsAuthenticationMessage
— (String
)The SMS authentication message.
SmsConfiguration
— (map
)The SMS configuration.
SnsCallerArn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId
— (String
)The external ID.
SoftwareTokenMfaConfiguration
— (map
)The software token MFA configuration.
Enabled
— (Boolean
)Specifies whether software token MFA is enabled.
MfaConfiguration
— (String
)The MFA configuration.
Possible values include:"OFF"
"ON"
"OPTIONAL"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:SmsMfaConfiguration
— (map
)The SMS text message MFA configuration.
SmsAuthenticationMessage
— (String
)The SMS authentication message.
SmsConfiguration
— (map
)The SMS configuration.
SnsCallerArn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId
— (String
)The external ID.
SoftwareTokenMfaConfiguration
— (map
)The software token MFA configuration.
Enabled
— (Boolean
)Specifies whether software token MFA is enabled.
MfaConfiguration
— (String
)The MFA configuration.
Possible values include:"OFF"
"ON"
"OPTIONAL"
-
(AWS.Response)
—
Returns:
setUserSettings(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the setUserSettings operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
MFAOptions: [ /* required */
{
AttributeName: 'STRING_VALUE',
DeliveryMedium: SMS | EMAIL
},
/* more items */
]
};
cognitoidentityserviceprovider.setUserSettings(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token for the set user settings request.
MFAOptions
— (Array<map>
)Specifies the options for MFA (e.g., email or phone number).
DeliveryMedium
— (String
)The delivery medium (email message or SMS message) to send the MFA code.
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name of the MFA option type.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
signUp(params = {}, callback) ⇒ AWS.Request
Registers the user in the specified user pool and creates a user name, password, and user attributes.
Service Reference:
Examples:
Calling the signUp operation
var params = {
ClientId: 'STRING_VALUE', /* required */
Password: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE', /* required */
AnalyticsMetadata: {
AnalyticsEndpointId: 'STRING_VALUE'
},
SecretHash: 'STRING_VALUE',
UserAttributes: [
{
Name: 'STRING_VALUE', /* required */
Value: 'STRING_VALUE'
},
/* more items */
],
UserContextData: {
EncodedData: 'STRING_VALUE'
},
ValidationData: [
{
Name: 'STRING_VALUE', /* required */
Value: 'STRING_VALUE'
},
/* more items */
]
};
cognitoidentityserviceprovider.signUp(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ClientId
— (String
)The ID of the client associated with the user pool.
SecretHash
— (String
)A keyed-hash message authentication code (HMAC) calculated using the secret key of a user pool client and username plus the client ID in the message.
Username
— (String
)The user name of the user you wish to register.
Password
— (String
)The password of the user you wish to register.
UserAttributes
— (Array<map>
)An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the
custom:
prefix to the attribute name.Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
ValidationData
— (Array<map>
)The validation data in the request to register a user.
Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
AnalyticsMetadata
— (map
)The Amazon Pinpoint analytics metadata for collecting metrics for
SignUp
calls.AnalyticsEndpointId
— (String
)The endpoint ID.
UserContextData
— (map
)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.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserConfirmed
— (Boolean
)A response from the server indicating that a user registration has been confirmed.
CodeDeliveryDetails
— (map
)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).
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name.
UserSub
— (String
)The UUID of the authenticated user. This is not the same as
username
.
-
(AWS.Response)
—
Returns:
startUserImportJob(params = {}, callback) ⇒ AWS.Request
Starts the user import.
Service Reference:
Examples:
Calling the startUserImportJob operation
var params = {
JobId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.startUserImportJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool that the users are being imported into.
JobId
— (String
)The job ID for the user import job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserImportJob
— (map
)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
— (Date
)The date the user import job was created.
StartDate
— (Date
)The date when the user import job was started.
CompletionDate
— (Date
)The date when the user import job was completed.
Status
— (String
)The status of the user import job. One of the following:
-
Created
- The job was created but not started. -
Pending
- A transition state. You have started the job, but it has not begun importing users yet. -
InProgress
- The job has started, and users are being imported. -
Stopping
- You have stopped the job, but the job has not stopped importing users yet. -
Stopped
- You have stopped the job, and the job has stopped importing users. -
Succeeded
- The job has completed successfully. -
Failed
- The job has stopped due to an error. -
Expired
- You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
"Created"
"Pending"
"InProgress"
"Stopping"
"Expired"
"Stopped"
"Failed"
"Succeeded"
-
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.
-
(AWS.Response)
—
Returns:
stopUserImportJob(params = {}, callback) ⇒ AWS.Request
Stops the user import job.
Service Reference:
Examples:
Calling the stopUserImportJob operation
var params = {
JobId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.stopUserImportJob(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool that the users are being imported into.
JobId
— (String
)The job ID for the user import job.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserImportJob
— (map
)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
— (Date
)The date the user import job was created.
StartDate
— (Date
)The date when the user import job was started.
CompletionDate
— (Date
)The date when the user import job was completed.
Status
— (String
)The status of the user import job. One of the following:
-
Created
- The job was created but not started. -
Pending
- A transition state. You have started the job, but it has not begun importing users yet. -
InProgress
- The job has started, and users are being imported. -
Stopping
- You have stopped the job, but the job has not stopped importing users yet. -
Stopped
- You have stopped the job, and the job has stopped importing users. -
Succeeded
- The job has completed successfully. -
Failed
- The job has stopped due to an error. -
Expired
- You created a job, but did not start the job within 24-48 hours. All data associated with the job was deleted, and the job cannot be started.
"Created"
"Pending"
"InProgress"
"Stopping"
"Expired"
"Stopped"
"Failed"
"Succeeded"
-
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.
-
(AWS.Response)
—
Returns:
tagResource(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the tagResource operation
var params = {
ResourceArn: 'STRING_VALUE', /* required */
Tags: {
'<TagKeysType>': 'STRING_VALUE',
/* '<TagKeysType>': ... */
}
};
cognitoidentityserviceprovider.tagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ResourceArn
— (String
)The Amazon Resource Name (ARN) of the user pool to assign the tags to.
Tags
— (map<String>
)The tags to assign to the user pool.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
untagResource(params = {}, callback) ⇒ AWS.Request
Removes the specified tags from an Amazon Cognito user pool. You can use this action up to 5 times per second, per account
Service Reference:
Examples:
Calling the untagResource operation
var params = {
ResourceArn: 'STRING_VALUE', /* required */
TagKeys: [
'STRING_VALUE',
/* more items */
]
};
cognitoidentityserviceprovider.untagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
ResourceArn
— (String
)The Amazon Resource Name (ARN) of the user pool that the tags are assigned to.
TagKeys
— (Array<String>
)The keys of the tags to remove from the user pool.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateAuthEventFeedback(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the updateAuthEventFeedback operation
var params = {
EventId: 'STRING_VALUE', /* required */
FeedbackToken: 'STRING_VALUE', /* required */
FeedbackValue: Valid | Invalid, /* required */
UserPoolId: 'STRING_VALUE', /* required */
Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.updateAuthEventFeedback(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
Username
— (String
)The user pool username.
EventId
— (String
)The event ID.
FeedbackToken
— (String
)The feedback token.
FeedbackValue
— (String
)The authentication event feedback value.
Possible values include:"Valid"
"Invalid"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateDeviceStatus(params = {}, callback) ⇒ AWS.Request
Updates the device status.
Service Reference:
Examples:
Calling the updateDeviceStatus operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
DeviceKey: 'STRING_VALUE', /* required */
DeviceRememberedStatus: remembered | not_remembered
};
cognitoidentityserviceprovider.updateDeviceStatus(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token.
DeviceKey
— (String
)The device key.
DeviceRememberedStatus
— (String
)The status of whether a device is remembered.
Possible values include:"remembered"
"not_remembered"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateGroup(params = {}, callback) ⇒ AWS.Request
Updates the specified group with the specified attributes.
Requires developer credentials.
Service Reference:
Examples:
Calling the updateGroup operation
var params = {
GroupName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Description: 'STRING_VALUE',
Precedence: 'NUMBER_VALUE',
RoleArn: 'STRING_VALUE'
};
cognitoidentityserviceprovider.updateGroup(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
GroupName
— (String
)The name of the group.
UserPoolId
— (String
)The user pool ID for the user pool.
Description
— (String
)A string containing the new description of the group.
RoleArn
— (String
)The new role ARN for the group. This is used for setting the
cognito:roles
andcognito:preferred_role
claims in the token.Precedence
— (Integer
)The new precedence value for the group. For more information about this parameter, see .
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Group
— (map
)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
andcognito:preferred_role
claims in the user's tokens. Groups with higherPrecedence
values take precedence over groups with lowerPrecedence
values or with nullPrecedence
values.Two groups can have the same
Precedence
value. If this happens, neither group takes precedence over the other. If two groups with the samePrecedence
have the same role ARN, that role is used in thecognito:preferred_role
claim in tokens for users in each group. If the two groups have different role ARNs, thecognito:preferred_role
claim is not set in users' tokens.The default
Precedence
value is null.LastModifiedDate
— (Date
)The date the group was last modified.
CreationDate
— (Date
)The date the group was created.
-
(AWS.Response)
—
Returns:
updateIdentityProvider(params = {}, callback) ⇒ AWS.Request
Updates identity provider information for a user pool.
Service Reference:
Examples:
Calling the updateIdentityProvider operation
var params = {
ProviderName: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
AttributeMapping: {
'<AttributeMappingKeyType>': 'STRING_VALUE',
/* '<AttributeMappingKeyType>': ... */
},
IdpIdentifiers: [
'STRING_VALUE',
/* more items */
],
ProviderDetails: {
'<StringType>': 'STRING_VALUE',
/* '<StringType>': ... */
}
};
cognitoidentityserviceprovider.updateIdentityProvider(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
ProviderDetails
— (map<String>
)The identity provider details to be updated, such as
MetadataURL
andMetadataFile
.AttributeMapping
— (map<String>
)The identity provider attribute mapping to be changed.
IdpIdentifiers
— (Array<String>
)A list of identity provider identifiers.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:IdentityProvider
— (map
)The identity provider object.
UserPoolId
— (String
)The user pool ID.
ProviderName
— (String
)The identity provider name.
ProviderType
— (String
)The identity provider type.
Possible values include:"SAML"
"Facebook"
"Google"
"LoginWithAmazon"
"OIDC"
ProviderDetails
— (map<String>
)The identity provider details, such as
MetadataURL
andMetadataFile
.AttributeMapping
— (map<String>
)A mapping of identity provider attributes to standard and custom user pool attributes.
IdpIdentifiers
— (Array<String>
)A list of identity provider identifiers.
LastModifiedDate
— (Date
)The date the identity provider was last modified.
CreationDate
— (Date
)The date the identity provider was created.
-
(AWS.Response)
—
Returns:
updateResourceServer(params = {}, callback) ⇒ AWS.Request
Updates the name and scopes of resource server. All other fields are read-only.
Service Reference:
Examples:
Calling the updateResourceServer operation
var params = {
Identifier: 'STRING_VALUE', /* required */
Name: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
Scopes: [
{
ScopeDescription: 'STRING_VALUE', /* required */
ScopeName: 'STRING_VALUE' /* required */
},
/* more items */
]
};
cognitoidentityserviceprovider.updateResourceServer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool.
Identifier
— (String
)The identifier for the resource server.
Name
— (String
)The name of the resource server.
Scopes
— (Array<map>
)The scope values to be set for the resource server.
ScopeName
— required — (String
)The name of the scope.
ScopeDescription
— required — (String
)A description of the scope.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:ResourceServer
— (map
)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
— (Array<map>
)A list of scopes that are defined for the resource server.
ScopeName
— required — (String
)The name of the scope.
ScopeDescription
— required — (String
)A description of the scope.
-
(AWS.Response)
—
Returns:
updateUserAttributes(params = {}, callback) ⇒ AWS.Request
Allows a user to update a specific attribute (one at a time).
Service Reference:
Examples:
Calling the updateUserAttributes operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
UserAttributes: [ /* required */
{
Name: 'STRING_VALUE', /* required */
Value: 'STRING_VALUE'
},
/* more items */
]
};
cognitoidentityserviceprovider.updateUserAttributes(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserAttributes
— (Array<map>
)An array of name-value pairs representing user attributes.
For custom attributes, you must prepend the
custom:
prefix to the attribute name.Name
— required — (String
)The name of the attribute.
Value
— (String
)The value of the attribute.
AccessToken
— (String
)The access token for the request to update user attributes.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CodeDeliveryDetailsList
— (Array<map>
)The code delivery details list from the server for the request to update user attributes.
Destination
— (String
)The destination for the code delivery details.
DeliveryMedium
— (String
)The delivery medium (email message or phone number).
Possible values include:"SMS"
"EMAIL"
AttributeName
— (String
)The attribute name.
-
(AWS.Response)
—
Returns:
updateUserPool(params = {}, callback) ⇒ AWS.Request
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 .
Service Reference:
Examples:
Calling the updateUserPool operation
var params = {
UserPoolId: 'STRING_VALUE', /* required */
AdminCreateUserConfig: {
AllowAdminCreateUserOnly: true || false,
InviteMessageTemplate: {
EmailMessage: 'STRING_VALUE',
EmailSubject: 'STRING_VALUE',
SMSMessage: 'STRING_VALUE'
},
UnusedAccountValidityDays: 'NUMBER_VALUE'
},
AutoVerifiedAttributes: [
phone_number | email,
/* more items */
],
DeviceConfiguration: {
ChallengeRequiredOnNewDevice: true || false,
DeviceOnlyRememberedOnUserPrompt: true || false
},
EmailConfiguration: {
EmailSendingAccount: COGNITO_DEFAULT | DEVELOPER,
ReplyToEmailAddress: 'STRING_VALUE',
SourceArn: 'STRING_VALUE'
},
EmailVerificationMessage: 'STRING_VALUE',
EmailVerificationSubject: 'STRING_VALUE',
LambdaConfig: {
CreateAuthChallenge: 'STRING_VALUE',
CustomMessage: 'STRING_VALUE',
DefineAuthChallenge: 'STRING_VALUE',
PostAuthentication: 'STRING_VALUE',
PostConfirmation: 'STRING_VALUE',
PreAuthentication: 'STRING_VALUE',
PreSignUp: 'STRING_VALUE',
PreTokenGeneration: 'STRING_VALUE',
UserMigration: 'STRING_VALUE',
VerifyAuthChallengeResponse: 'STRING_VALUE'
},
MfaConfiguration: OFF | ON | OPTIONAL,
Policies: {
PasswordPolicy: {
MinimumLength: 'NUMBER_VALUE',
RequireLowercase: true || false,
RequireNumbers: true || false,
RequireSymbols: true || false,
RequireUppercase: true || false
}
},
SmsAuthenticationMessage: 'STRING_VALUE',
SmsConfiguration: {
SnsCallerArn: 'STRING_VALUE', /* required */
ExternalId: 'STRING_VALUE'
},
SmsVerificationMessage: 'STRING_VALUE',
UserPoolAddOns: {
AdvancedSecurityMode: OFF | AUDIT | ENFORCED /* required */
},
UserPoolTags: {
'<TagKeysType>': 'STRING_VALUE',
/* '<TagKeysType>': ... */
},
VerificationMessageTemplate: {
DefaultEmailOption: CONFIRM_WITH_LINK | CONFIRM_WITH_CODE,
EmailMessage: 'STRING_VALUE',
EmailMessageByLink: 'STRING_VALUE',
EmailSubject: 'STRING_VALUE',
EmailSubjectByLink: 'STRING_VALUE',
SmsMessage: 'STRING_VALUE'
}
};
cognitoidentityserviceprovider.updateUserPool(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool you want to update.
Policies
— (map
)A container with the policies you wish to update in a user pool.
PasswordPolicy
— (map
)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
— (map
)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.
AutoVerifiedAttributes
— (Array<String>
)The attributes that are automatically verified when the Amazon Cognito service makes a request to update user pools.
SmsVerificationMessage
— (String
)A container with information about the SMS verification message.
EmailVerificationMessage
— (String
)The contents of the email verification message.
EmailVerificationSubject
— (String
)The subject of the email verification message.
VerificationMessageTemplate
— (map
)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.
Possible values include:"CONFIRM_WITH_LINK"
"CONFIRM_WITH_CODE"
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.
"OFF"
"ON"
"OPTIONAL"
-
DeviceConfiguration
— (map
)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.
EmailConfiguration
— (map
)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:-
If you specify
COGNITO_DEFAULT
, Amazon Cognito uses this address as the custom FROM address when it emails your users by using its built-in email account. -
If you specify
DEVELOPER
, Amazon Cognito emails your users with this address by calling Amazon SES on your behalf.
-
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.
"COGNITO_DEFAULT"
"DEVELOPER"
SmsConfiguration
— (map
)SMS configuration.
SnsCallerArn
— required — (String
)The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.
ExternalId
— (String
)The external ID.
UserPoolTags
— (map<String>
)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.
AdminCreateUserConfig
— (map
)The configuration for
AdminCreateUser
requests.AllowAdminCreateUserOnly
— (Boolean
)Set to
True
if only the administrator is allowed to create user profiles. Set toFalse
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 theMessageAction
parameter. The default value for this parameter is 7.Note: If you set a value forTemporaryPasswordValidityDays
inPasswordPolicy
, that value will be used andUnusedAccountValidityDays
will be deprecated for that user pool.InviteMessageTemplate
— (map
)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
— (map
)Used to enable advanced security risk detection. Set the key
AdvancedSecurityMode
to the value "AUDIT".AdvancedSecurityMode
— required — (String
)The advanced security mode.
Possible values include:"OFF"
"AUDIT"
"ENFORCED"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateUserPoolClient(params = {}, callback) ⇒ AWS.Request
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 .
Service Reference:
Examples:
Calling the updateUserPoolClient operation
var params = {
ClientId: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE', /* required */
AllowedOAuthFlows: [
code | implicit | client_credentials,
/* more items */
],
AllowedOAuthFlowsUserPoolClient: true || false,
AllowedOAuthScopes: [
'STRING_VALUE',
/* more items */
],
AnalyticsConfiguration: {
ApplicationId: 'STRING_VALUE', /* required */
ExternalId: 'STRING_VALUE', /* required */
RoleArn: 'STRING_VALUE', /* required */
UserDataShared: true || false
},
CallbackURLs: [
'STRING_VALUE',
/* more items */
],
ClientName: 'STRING_VALUE',
DefaultRedirectURI: 'STRING_VALUE',
ExplicitAuthFlows: [
ADMIN_NO_SRP_AUTH | CUSTOM_AUTH_FLOW_ONLY | USER_PASSWORD_AUTH,
/* more items */
],
LogoutURLs: [
'STRING_VALUE',
/* more items */
],
ReadAttributes: [
'STRING_VALUE',
/* more items */
],
RefreshTokenValidity: 'NUMBER_VALUE',
SupportedIdentityProviders: [
'STRING_VALUE',
/* more items */
],
WriteAttributes: [
'STRING_VALUE',
/* more items */
]
};
cognitoidentityserviceprovider.updateUserPoolClient(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
UserPoolId
— (String
)The user pool ID for the user pool where you want to update the user pool client.
ClientId
— (String
)The ID of the client associated with the user pool.
ClientName
— (String
)The client name from the update user pool client request.
RefreshTokenValidity
— (Integer
)The time limit, in days, after which the refresh token is no longer valid and cannot be used.
ReadAttributes
— (Array<String>
)The read-only attributes of the user pool.
WriteAttributes
— (Array<String>
)The writeable attributes of the user pool.
ExplicitAuthFlows
— (Array<String>
)Explicit authentication flows.
SupportedIdentityProviders
— (Array<String>
)A list of provider names for the identity providers that are supported on this client.
CallbackURLs
— (Array<String>
)A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
LogoutURLs
— (Array<String>
)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:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
AllowedOAuthFlows
— (Array<String>
)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.AllowedOAuthScopes
— (Array<String>
)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
— (map
)The Amazon Pinpoint analytics configuration for collecting metrics for this user pool.
ApplicationId
— required — (String
)The application ID for an Amazon Pinpoint application.
RoleArn
— required — (String
)The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId
— required — (String
)The external ID.
UserDataShared
— (Boolean
)If
UserDataShared
istrue
, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:UserPoolClient
— (map
)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
— (Date
)The date the user pool client was last modified.
CreationDate
— (Date
)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
— (Array<String>
)The Read-only attributes.
WriteAttributes
— (Array<String>
)The writeable attributes.
ExplicitAuthFlows
— (Array<String>
)The explicit authentication flows.
SupportedIdentityProviders
— (Array<String>
)A list of provider names for the identity providers that are supported on this client.
CallbackURLs
— (Array<String>
)A list of allowed redirect (callback) URLs for the identity providers.
A redirect URI must:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
LogoutURLs
— (Array<String>
)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:
-
Be an absolute URI.
-
Be registered with the authorization server.
-
Not include a fragment component.
See OAuth 2.0 - Redirection Endpoint.
Amazon Cognito requires HTTPS over HTTP except for http://localhost for testing purposes only.
App callback URLs such as myapp://example are also supported.
-
AllowedOAuthFlows
— (Array<String>
)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
— (Array<String>
)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
— (map
)The Amazon Pinpoint analytics configuration for the user pool client.
ApplicationId
— required — (String
)The application ID for an Amazon Pinpoint application.
RoleArn
— required — (String
)The ARN of an IAM role that authorizes Amazon Cognito to publish events to Amazon Pinpoint analytics.
ExternalId
— required — (String
)The external ID.
UserDataShared
— (Boolean
)If
UserDataShared
istrue
, Amazon Cognito will include user data in the events it publishes to Amazon Pinpoint analytics.
-
(AWS.Response)
—
Returns:
updateUserPoolDomain(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the updateUserPoolDomain operation
var params = {
CustomDomainConfig: { /* required */
CertificateArn: 'STRING_VALUE' /* required */
},
Domain: 'STRING_VALUE', /* required */
UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.updateUserPoolDomain(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
Domain
— (String
)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.
UserPoolId
— (String
)The ID of the user pool that is associated with the custom domain that you are updating the certificate for.
CustomDomainConfig
— (map
)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.
CertificateArn
— required — (String
)The Amazon Resource Name (ARN) of an AWS Certificate Manager SSL certificate. You use this certificate for the subdomain of your custom domain.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:CloudFrontDomain
— (String
)The Amazon CloudFront endpoint that Amazon Cognito set up when you added the custom domain to your user pool.
-
(AWS.Response)
—
Returns:
verifySoftwareToken(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the verifySoftwareToken operation
var params = {
UserCode: 'STRING_VALUE', /* required */
AccessToken: 'STRING_VALUE',
FriendlyDeviceName: 'STRING_VALUE',
Session: 'STRING_VALUE'
};
cognitoidentityserviceprovider.verifySoftwareToken(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)The access token.
Session
— (String
)The session which should be passed both ways in challenge-response calls to the service.
UserCode
— (String
)The one time password computed using the secret code returned by
FriendlyDeviceName
— (String
)The friendly device name.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:Status
— (String
)The status of the verify software token.
Possible values include:"SUCCESS"
"ERROR"
Session
— (String
)The session which should be passed both ways in challenge-response calls to the service.
-
(AWS.Response)
—
Returns:
verifyUserAttribute(params = {}, callback) ⇒ AWS.Request
Verifies the specified user attributes in the user pool.
Service Reference:
Examples:
Calling the verifyUserAttribute operation
var params = {
AccessToken: 'STRING_VALUE', /* required */
AttributeName: 'STRING_VALUE', /* required */
Code: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.verifyUserAttribute(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
AccessToken
— (String
)Represents the access token of the request to verify user attributes.
AttributeName
— (String
)The attribute name in the request to verify user attributes.
Code
— (String
)The verification code in the request to verify user attributes.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns: