Class: AWS.CognitoIdentityServiceProvider

Inherits:
AWS.Service
  • Object
show all
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.

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 collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

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

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

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

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 attribute can be changed once it has been created.

      • Required — (Boolean)

        Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

      • NumberAttributeConstraints — (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 of an attribute value of the string type.

        • MaxLength — (String)

          The maximum length of an attribute value of the string 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

adminCreateUser(params = {}, callback) ⇒ AWS.Request

Creates a new user in the specified user pool and sends a welcome message via email or phone (SMS). This message is based on a template that you configured in your call to CreateUserPool or UpdateUserPool. This template includes your custom sign-up instructions and placeholders for user name and temporary password.

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 CreateUserPool or in the Attributes tab of the console) must be supplied either by you (in your call to AdminCreateUser) or by the user (when he or she signs up in response to your welcome message).

      To send a message inviting the user to sign up, you must specify the user's email address or phone number. This can be done in your call to AdminCreateUser or in the Users tab of the Amazon Cognito console for managing your user pools.

      In your call to AdminCreateUser, you can set the email_verified attribute to True, and you can set the phone_number_verified attribute to True. (You cannot do this by calling other operations such as AdminUpdateUserAttributes.)

      • 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 to True, or if "EMAIL" is specified in the DesiredDeliveryMediums 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 to True, or if "SMS" is specified in the DesiredDeliveryMediums parameter.

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

      • Namerequired — (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 the MessageAction parameter.

    • ForceAliasCreation — (Boolean)

      This parameter is only used if the phone_number_verified or email_verified attribute is set to True. Otherwise, it is ignored.

      If this parameter is set to True and the phone number or email address specified in the UserAttributes parameter already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user. The previous user will no longer be able to log in using that alias.

      If this parameter is set to False, the API throws an AliasExistsException error if the alias already exists. The default value is False.

    • MessageAction — (String)

      Set to "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.

      Possible values include:
      • "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. The data object has the following properties:

      • User — (map)

        The user returned in the request to create a new 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.

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

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • Device — (map)

        The device.

        • DeviceKey — (String)

          The device key.

        • DeviceAttributes — (Array<map>)

          The device attributes.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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.

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

        Possible values include:
        • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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, /* required */
  ClientId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  AuthParameters: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  }
};
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 client app ID.

    • AuthFlow — (String)

      The authentication flow.

      Possible values include:
      • "USER_SRP_AUTH"
      • "REFRESH_TOKEN_AUTH"
      • "REFRESH_TOKEN"
      • "CUSTOM_AUTH"
      • "ADMIN_NO_SRP_AUTH"
    • AuthParameters — (map<String>)

      The authentication parameters.

    • ClientMetadata — (map<String>)

      The client app metadata.

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. The data object has the following properties:

      • ChallengeName — (String)

        The name of the challenge.

        Possible values include:
        • "SMS_MFA"
        • "PASSWORD_VERIFIER"
        • "CUSTOM_CHALLENGE"
        • "DEVICE_SRP_AUTH"
        • "DEVICE_PASSWORD_VERIFIER"
        • "ADMIN_NO_SRP_AUTH"
        • "NEW_PASSWORD_REQUIRED"
      • Session — (String)

        The session.

      • ChallengeParameters — (map<String>)

        The challenge parameters.

      • AuthenticationResult — (map)

        The result of the authentication response.

        • AccessToken — (String)

          The access token of the authentication result.

        • ExpiresIn — (Integer)

          The expiration period of the authentication result.

        • TokenType — (String)

          The token type of the authentication result.

        • RefreshToken — (String)

          The refresh token of the authentication result.

        • IdToken — (String)

          The ID token of the authentication result.

        • NewDeviceMetadata — (map)

          The new device metadata from an authentication result.

          • DeviceKey — (String)

            The device key.

          • DeviceGroupKey — (String)

            The device group key.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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. The data 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.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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. The data 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 and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

          Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

          The default Precedence value is null.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 | 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 */
  ChallengeResponses: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  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 client ID.

    • ChallengeName — (String)

      The name of the challenge.

      Possible values include:
      • "SMS_MFA"
      • "PASSWORD_VERIFIER"
      • "CUSTOM_CHALLENGE"
      • "DEVICE_SRP_AUTH"
      • "DEVICE_PASSWORD_VERIFIER"
      • "ADMIN_NO_SRP_AUTH"
      • "NEW_PASSWORD_REQUIRED"
    • ChallengeResponses — (map<String>)

      The challenge response.

    • Session — (String)

      The session.

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. The data object has the following properties:

      • ChallengeName — (String)

        The name of the challenge.

        Possible values include:
        • "SMS_MFA"
        • "PASSWORD_VERIFIER"
        • "CUSTOM_CHALLENGE"
        • "DEVICE_SRP_AUTH"
        • "DEVICE_PASSWORD_VERIFIER"
        • "ADMIN_NO_SRP_AUTH"
        • "NEW_PASSWORD_REQUIRED"
      • Session — (String)

        The session.

      • ChallengeParameters — (map<String>)

        The challenge parameters.

      • AuthenticationResult — (map)

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

        • AccessToken — (String)

          The access token of the authentication result.

        • ExpiresIn — (Integer)

          The expiration period of the authentication result.

        • TokenType — (String)

          The token type of the authentication result.

        • RefreshToken — (String)

          The refresh token of the authentication result.

        • IdToken — (String)

          The ID token of the authentication result.

        • NewDeviceMetadata — (map)

          The new device metadata from an authentication result.

          • DeviceKey — (String)

            The device key.

          • DeviceGroupKey — (String)

            The device group key.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

adminUpdateUserAttributes(params = {}, callback) ⇒ AWS.Request

Updates the specified user's attributes, including developer attributes, as an administrator. Works on any user.

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.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 = {
  PreviousPassword: 'STRING_VALUE', /* required */
  ProposedPassword: 'STRING_VALUE', /* required */
  AccessToken: 'STRING_VALUE'
};
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 in the change password request.

    • ProposedPassword — (String)

      The new password in the change password request.

    • AccessToken — (String)

      The access token in the change password 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

confirmDevice(params = {}, callback) ⇒ AWS.Request

Confirms tracking of the device. This API call is the call that beings 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. The data object has the following properties:

      • UserConfirmationNecessary — (Boolean)

        Indicates whether the user confirmation is necessary to confirm the device response.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

confirmForgotPassword(params = {}, callback) ⇒ AWS.Request

Allows a user to enter a code provided when they reset their password to update their 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 */
  SecretHash: '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 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 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.

    • Password — (String)

      The password sent by sent by a user's request to retrieve a forgotten password.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 */
  ForceAliasCreation: true || false,
  SecretHash: '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 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 to True and the phone number/email used for sign up confirmation already exists as an alias with a different user, the API call will migrate the alias from the previous user to the newly created user being confirmed. If set to False, the API will throw an AliasExistsException error.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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 null Precedence values. If a user belongs to two or more groups, it is the group with the lowest precedence value whose role ARN will be used in the cognito:roles and cognito:preferred_role claims in the user's tokens.

      Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

      The default Precedence value is null.

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. The data 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 and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

          Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

          The default Precedence value is null.

        • LastModifiedDate — (Date)

          The date the group was last modified.

        • CreationDate — (Date)

          The date the group was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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 when the user import job was created.

        • StartDate — (Date)

          The date when the user import job was started.

        • CompletionDate — (Date)

          The date when the user imoprt 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.

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0
  },
  AliasAttributes: [
    phone_number | email | preferred_username,
    /* more items */
  ],
  AutoVerifiedAttributes: [
    phone_number | email,
    /* more items */
  ],
  DeviceConfiguration: {
    ChallengeRequiredOnNewDevice: true || false,
    DeviceOnlyRememberedOnUserPrompt: true || false
  },
  EmailConfiguration: {
    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',
    VerifyAuthChallengeResponse: 'STRING_VALUE'
  },
  MfaConfiguration: OFF | ON | OPTIONAL,
  Policies: {
    PasswordPolicy: {
      MinimumLength: 0,
      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',
  UserPoolTags: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  }
};
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)

        A container with information about the user pool 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.

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

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

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

    • 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 the email source.

      • ReplyToEmailAddress — (String)

        The REPLY-TO email address.

    • SmsConfiguration — (map)

      The SMS configuration.

      • SnsCallerArnrequired — (String)

        The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

      • ExternalId — (String)

        The external ID.

    • UserPoolTags — (map<String>)

      The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

    • AdminCreateUserConfig — (map)

      The configuration for AdminCreateUser requests.

      • AllowAdminCreateUserOnly — (Boolean)

        Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

      • UnusedAccountValidityDays — (Integer)

        The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

      • InviteMessageTemplate — (map)

        The message template to be used for the welcome message to new users.

        • 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 attribute can be changed once it has been created.

      • Required — (Boolean)

        Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

      • NumberAttributeConstraints — (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 of an attribute value of the string type.

        • MaxLength — (String)

          The maximum length of an attribute value of the string 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. The data 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)

          A container describing the policies associated with a user pool.

          • PasswordPolicy — (map)

            A container with information about the user pool 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)

          A container describing the AWS Lambda triggers associated with a 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.

        • Status — (String)

          The status of a user pool.

          Possible values include:
          • "Enabled"
          • "Disabled"
        • LastModifiedDate — (Date)

          The last modified date of a user pool.

        • CreationDate — (Date)

          The creation date of a user pool.

        • 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 attribute can be changed once it has been created.

          • Required — (Boolean)

            Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

          • NumberAttributeConstraints — (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 of an attribute value of the string type.

            • MaxLength — (String)

              The maximum length of an attribute value of the string type.

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

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

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

          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.

        • EstimatedNumberOfUsers — (Integer)

          A number estimating the size of the user pool.

        • EmailConfiguration — (map)

          The email configuration.

          • SourceArn — (String)

            The Amazon Resource Name (ARN) of the email source.

          • ReplyToEmailAddress — (String)

            The REPLY-TO email address.

        • SmsConfiguration — (map)

          The SMS configuration.

          • SnsCallerArnrequired — (String)

            The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

          • ExternalId — (String)

            The external ID.

        • UserPoolTags — (map<String>)

          The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

        • SmsConfigurationFailure — (String)

          The reason why the SMS configuration cannot send the message(s) to your users.

        • EmailConfigurationFailure — (String)

          The reason why the email configuration cannot send the messages to your users.

        • AdminCreateUserConfig — (map)

          The configuration for AdminCreateUser requests.

          • AllowAdminCreateUserOnly — (Boolean)

            Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

          • UnusedAccountValidityDays — (Integer)

            The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

          • InviteMessageTemplate — (map)

            The message template to be used for the welcome message to new users.

            • SMSMessage — (String)

              The message template for SMS messages.

            • EmailMessage — (String)

              The message template for email messages.

            • EmailSubject — (String)

              The subject line for email messages.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 */
  ExplicitAuthFlows: [
    ADMIN_NO_SRP_AUTH | CUSTOM_AUTH_FLOW_ONLY,
    /* more items */
  ],
  GenerateSecret: true || false,
  ReadAttributes: [
    'STRING_VALUE',
    /* more items */
  ],
  RefreshTokenValidity: 0,
  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 validity of the refresh token, in days.

    • ReadAttributes — (Array<String>)

      The read attributes.

    • WriteAttributes — (Array<String>)

      The write attributes.

    • ExplicitAuthFlows — (Array<String>)

      The explicit authentication flows.

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. The data 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 last modified date from the user pool request of the client type.

        • CreationDate — (Date)

          The creation date from the user pool request of the client type.

        • RefreshTokenValidity — (Integer)

          The validity of the refresh token, in days.

        • ReadAttributes — (Array<String>)

          The Read-only attributes.

        • WriteAttributes — (Array<String>)

          The writeable attributes.

        • ExplicitAuthFlows — (Array<String>)

          The explicit authentication flows.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteUser(params = {}, callback) ⇒ AWS.Request

Allows a user to delete one's self.

Service Reference:

Examples:

Calling the deleteUser operation

var params = {
  AccessToken: 'STRING_VALUE'
};
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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteUserAttributes(params = {}, callback) ⇒ AWS.Request

Deletes the attributes for a user.

Service Reference:

Examples:

Calling the deleteUserAttributes operation

var params = {
  UserAttributeNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  AccessToken: 'STRING_VALUE'
};
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.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 ID of the client 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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 when the user import job was created.

        • StartDate — (Date)

          The date when the user import job was started.

        • CompletionDate — (Date)

          The date when the user imoprt 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.

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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)

          A container describing the policies associated with a user pool.

          • PasswordPolicy — (map)

            A container with information about the user pool 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)

          A container describing the AWS Lambda triggers associated with a 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.

        • Status — (String)

          The status of a user pool.

          Possible values include:
          • "Enabled"
          • "Disabled"
        • LastModifiedDate — (Date)

          The last modified date of a user pool.

        • CreationDate — (Date)

          The creation date of a user pool.

        • 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 attribute can be changed once it has been created.

          • Required — (Boolean)

            Specifies whether a user pool attribute is required. If the attribute is required and the user does not provide a value, registration or sign-in will fail.

          • NumberAttributeConstraints — (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 of an attribute value of the string type.

            • MaxLength — (String)

              The maximum length of an attribute value of the string type.

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

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

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

          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.

        • EstimatedNumberOfUsers — (Integer)

          A number estimating the size of the user pool.

        • EmailConfiguration — (map)

          The email configuration.

          • SourceArn — (String)

            The Amazon Resource Name (ARN) of the email source.

          • ReplyToEmailAddress — (String)

            The REPLY-TO email address.

        • SmsConfiguration — (map)

          The SMS configuration.

          • SnsCallerArnrequired — (String)

            The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

          • ExternalId — (String)

            The external ID.

        • UserPoolTags — (map<String>)

          The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

        • SmsConfigurationFailure — (String)

          The reason why the SMS configuration cannot send the message(s) to your users.

        • EmailConfigurationFailure — (String)

          The reason why the email configuration cannot send the messages to your users.

        • AdminCreateUserConfig — (map)

          The configuration for AdminCreateUser requests.

          • AllowAdminCreateUserOnly — (Boolean)

            Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

          • UnusedAccountValidityDays — (Integer)

            The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

          • InviteMessageTemplate — (map)

            The message template to be used for the welcome message to new users.

            • SMSMessage — (String)

              The message template for SMS messages.

            • EmailMessage — (String)

              The message template for email messages.

            • EmailSubject — (String)

              The subject line for email messages.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeUserPoolClient(params = {}, callback) ⇒ AWS.Request

Client method for returning the configuration information and metadata of the specified user pool 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 ID of the client 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. The data 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 last modified date from the user pool request of the client type.

        • CreationDate — (Date)

          The creation date from the user pool request of the client type.

        • RefreshTokenValidity — (Integer)

          The validity of the refresh token, in days.

        • ReadAttributes — (Array<String>)

          The Read-only attributes.

        • WriteAttributes — (Array<String>)

          The writeable attributes.

        • ExplicitAuthFlows — (Array<String>)

          The explicit authentication flows.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

forgotPassword(params = {}, callback) ⇒ AWS.Request

Retrieves the password for the specified client ID or username.

Service Reference:

Examples:

Calling the forgotPassword operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  Username: 'STRING_VALUE', /* required */
  SecretHash: '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.

    • Username — (String)

      The user name of the user for whom you want to enter a code to reset a forgotten password.

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. The data 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 name of the attribute in the code delivery details type.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • Device — (map)

        The device.

        • DeviceKey — (String)

          The device key.

        • DeviceAttributes — (Array<map>)

          The device attributes.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getGroup(params = {}, callback) ⇒ AWS.Request

Gets a group.

Requires developer credentials.

Service Reference:

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. The data 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 and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

          Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

          The default Precedence value is null.

        • LastModifiedDate — (Date)

          The date the group was last modified.

        • CreationDate — (Date)

          The date the group was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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'
};
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. The data 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.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getUserAttributeVerificationCode(params = {}, callback) ⇒ AWS.Request

Gets the user attribute verification code for the specified attribute name.

Examples:

Calling the getUserAttributeVerificationCode operation

var params = {
  AttributeName: 'STRING_VALUE', /* required */
  AccessToken: 'STRING_VALUE'
};
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. The data 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 name of the attribute in the code delivery details type.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

globalSignOut(params = {}, callback) ⇒ AWS.Request

Signs out users from all devices.

Service Reference:

Examples:

Calling the globalSignOut operation

var params = {
  AccessToken: 'STRING_VALUE'
};
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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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, /* required */
  ClientId: 'STRING_VALUE', /* required */
  AuthParameters: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  }
};
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.

      Possible values include:
      • "USER_SRP_AUTH"
      • "REFRESH_TOKEN_AUTH"
      • "REFRESH_TOKEN"
      • "CUSTOM_AUTH"
      • "ADMIN_NO_SRP_AUTH"
    • AuthParameters — (map<String>)

      The authentication parameters.

    • ClientMetadata — (map<String>)

      The client app's metadata.

    • ClientId — (String)

      The 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. The data object has the following properties:

      • ChallengeName — (String)

        The name of the challenge.

        Possible values include:
        • "SMS_MFA"
        • "PASSWORD_VERIFIER"
        • "CUSTOM_CHALLENGE"
        • "DEVICE_SRP_AUTH"
        • "DEVICE_PASSWORD_VERIFIER"
        • "ADMIN_NO_SRP_AUTH"
        • "NEW_PASSWORD_REQUIRED"
      • Session — (String)

        The session.

      • ChallengeParameters — (map<String>)

        The challenge parameters.

      • AuthenticationResult — (map)

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

        • AccessToken — (String)

          The access token of the authentication result.

        • ExpiresIn — (Integer)

          The expiration period of the authentication result.

        • TokenType — (String)

          The token type of the authentication result.

        • RefreshToken — (String)

          The refresh token of the authentication result.

        • IdToken — (String)

          The ID token of the authentication result.

        • NewDeviceMetadata — (map)

          The new device metadata from an authentication result.

          • DeviceKey — (String)

            The device key.

          • DeviceGroupKey — (String)

            The device group key.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listDevices(params = {}, callback) ⇒ AWS.Request

Lists the devices.

Service Reference:

Examples:

Calling the listDevices operation

var params = {
  AccessToken: 'STRING_VALUE', /* required */
  Limit: 0,
  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. The data 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.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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. The data 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 and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

          Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

          The default Precedence value is null.

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

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listUserImportJobs(params = {}, callback) ⇒ AWS.Request

Lists the user import jobs.

Service Reference:

Examples:

Calling the listUserImportJobs operation

var params = {
  MaxResults: 0, /* 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. The data 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 when the user import job was created.

        • StartDate — (Date)

          The date when the user import job was started.

        • CompletionDate — (Date)

          The date when the user imoprt 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.

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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. The data 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listUserPools(params = {}, callback) ⇒ AWS.Request

Lists the user pools associated with an AWS account.

Service Reference:

Examples:

Calling the listUserPools operation

var params = {
  MaxResults: 0, /* 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. The data 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.

        • Status — (String)

          The user pool status in a user pool description.

          Possible values include:
          • "Enabled"
          • "Disabled"
        • LastModifiedDate — (Date)

          The last modified date in a user pool description.

        • CreationDate — (Date)

          The creation date in a user pool 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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 which you want to list users.

    • AttributesToGet — (Array<String>)

      The attributes to get from the request to list users.

    • Limit — (Integer)

      The limit of the request to list users.

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

      The filter for the list users 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. The data 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.

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

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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. The data 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.

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

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 */
  SecretHash: '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.

    • Username — (String)

      The user name of the user to whom you wish to resend a confirmation 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. The data 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 name of the attribute in the code delivery details type.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

respondToAuthChallenge(params = {}, callback) ⇒ AWS.Request

Responds to the authentication challenge.

Service Reference:

Examples:

Calling the respondToAuthChallenge operation

var params = {
  ChallengeName: SMS_MFA | PASSWORD_VERIFIER | CUSTOM_CHALLENGE | DEVICE_SRP_AUTH | DEVICE_PASSWORD_VERIFIER | ADMIN_NO_SRP_AUTH | NEW_PASSWORD_REQUIRED, /* required */
  ClientId: 'STRING_VALUE', /* required */
  ChallengeResponses: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  Session: '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 client ID.

    • ChallengeName — (String)

      The name of the challenge.

      Possible values include:
      • "SMS_MFA"
      • "PASSWORD_VERIFIER"
      • "CUSTOM_CHALLENGE"
      • "DEVICE_SRP_AUTH"
      • "DEVICE_PASSWORD_VERIFIER"
      • "ADMIN_NO_SRP_AUTH"
      • "NEW_PASSWORD_REQUIRED"
    • Session — (String)

      The session.

    • ChallengeResponses — (map<String>)

      The responses to the authentication challenge.

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. The data object has the following properties:

      • ChallengeName — (String)

        The challenge name.

        Possible values include:
        • "SMS_MFA"
        • "PASSWORD_VERIFIER"
        • "CUSTOM_CHALLENGE"
        • "DEVICE_SRP_AUTH"
        • "DEVICE_PASSWORD_VERIFIER"
        • "ADMIN_NO_SRP_AUTH"
        • "NEW_PASSWORD_REQUIRED"
      • Session — (String)

        The session.

      • ChallengeParameters — (map<String>)

        The challenge parameters.

      • AuthenticationResult — (map)

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

        • AccessToken — (String)

          The access token of the authentication result.

        • ExpiresIn — (Integer)

          The expiration period of the authentication result.

        • TokenType — (String)

          The token type of the authentication result.

        • RefreshToken — (String)

          The refresh token of the authentication result.

        • IdToken — (String)

          The ID token of the authentication result.

        • NewDeviceMetadata — (map)

          The new device metadata from an authentication result.

          • DeviceKey — (String)

            The device key.

          • DeviceGroupKey — (String)

            The device group key.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 */
  SecretHash: 'STRING_VALUE',
  UserAttributes: [
    {
      Name: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  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.

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

      • Namerequired — (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. The data 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 name of the attribute in the code delivery details type.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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 when the user import job was created.

        • StartDate — (Date)

          The date when the user import job was started.

        • CompletionDate — (Date)

          The date when the user imoprt 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.

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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 when the user import job was created.

        • StartDate — (Date)

          The date when the user import job was started.

        • CompletionDate — (Date)

          The date when the user imoprt 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.

          Possible values include:
          • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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: 0,
  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 and cognito:preferred_role claims in the token.

    • Precedence — (Integer)

      The new precedence value for the group. For more information about this parameter, see CreateGroupRequest.

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. The data 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 and cognito:preferred_role claims in the user's tokens. Groups with higher Precedence values take precedence over groups with lower Precedence values or with null Precedence values.

          Two groups can have the same Precedence value. If this happens, neither group takes precedence over the other. If two groups with the same Precedence have the same role ARN, that role is used in the cognito:preferred_role claim in tokens for users in each group. If the two groups have different role ARNs, the cognito:preferred_role claim is not set in users' tokens.

          The default Precedence value is null.

        • LastModifiedDate — (Date)

          The date the group was last modified.

        • CreationDate — (Date)

          The date the group was created.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 = {
  UserAttributes: [ /* required */
    {
      Name: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  AccessToken: 'STRING_VALUE'
};
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.

      • Namerequired — (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. The data 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 name of the attribute in the code delivery details type.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateUserPool(params = {}, callback) ⇒ AWS.Request

Updates the specified user pool with the specified attributes.

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: 0
  },
  AutoVerifiedAttributes: [
    phone_number | email,
    /* more items */
  ],
  DeviceConfiguration: {
    ChallengeRequiredOnNewDevice: true || false,
    DeviceOnlyRememberedOnUserPrompt: true || false
  },
  EmailConfiguration: {
    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',
    VerifyAuthChallengeResponse: 'STRING_VALUE'
  },
  MfaConfiguration: OFF | ON | OPTIONAL,
  Policies: {
    PasswordPolicy: {
      MinimumLength: 0,
      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',
  UserPoolTags: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  }
};
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)

        A container with information about the user pool 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.

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

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

      Possible values include:
      • "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 the email source.

      • ReplyToEmailAddress — (String)

        The REPLY-TO email address.

    • SmsConfiguration — (map)

      SMS configuration.

      • SnsCallerArnrequired — (String)

        The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) caller.

      • ExternalId — (String)

        The external ID.

    • UserPoolTags — (map<String>)

      The cost allocation tags for the user pool. For more information, see Adding Cost Allocation Tags to Your User Pool

    • AdminCreateUserConfig — (map)

      The configuration for AdminCreateUser requests.

      • AllowAdminCreateUserOnly — (Boolean)

        Set to True if only the administrator is allowed to create user profiles. Set to False if users can sign themselves up via an app.

      • UnusedAccountValidityDays — (Integer)

        The user account expiration limit, in days, after which the account is no longer usable. To reset the account after that time limit, you must call AdminCreateUser again, specifying "RESEND" for the MessageAction parameter. The default value for this paameter is 7.

      • InviteMessageTemplate — (map)

        The message template to be used for the welcome message to new users.

        • SMSMessage — (String)

          The message template for SMS messages.

        • EmailMessage — (String)

          The message template for email messages.

        • EmailSubject — (String)

          The subject line for email messages.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateUserPoolClient(params = {}, callback) ⇒ AWS.Request

Allows the developer to update the specified user pool client and password policy.

Service Reference:

Examples:

Calling the updateUserPoolClient operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  ClientName: 'STRING_VALUE',
  ExplicitAuthFlows: [
    ADMIN_NO_SRP_AUTH | CUSTOM_AUTH_FLOW_ONLY,
    /* more items */
  ],
  ReadAttributes: [
    'STRING_VALUE',
    /* more items */
  ],
  RefreshTokenValidity: 0,
  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 validity of the refresh token, in days.

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

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. The data 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 last modified date from the user pool request of the client type.

        • CreationDate — (Date)

          The creation date from the user pool request of the client type.

        • RefreshTokenValidity — (Integer)

          The validity of the refresh token, in days.

        • ReadAttributes — (Array<String>)

          The Read-only attributes.

        • WriteAttributes — (Array<String>)

          The writeable attributes.

        • ExplicitAuthFlows — (Array<String>)

          The explicit authentication flows.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

verifyUserAttribute(params = {}, callback) ⇒ AWS.Request

Verifies the specified user attributes in the user pool.

Service Reference:

Examples:

Calling the verifyUserAttribute operation

var params = {
  AttributeName: 'STRING_VALUE', /* required */
  Code: 'STRING_VALUE', /* required */
  AccessToken: 'STRING_VALUE'
};
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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.