AWS.CognitoIdentityServiceProvider — AWS SDK for JavaScript (original) (raw)

Property Details

endpointAWS.Endpoint

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

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

Adds a user to a group. A user who is in a group can present a preferred-role claim to an identity pool, and populates a cognito:groups claim to their access and identity tokens.

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

This IAM-authenticated API operation confirms user sign-up as an administrator. Unlike ConfirmSignUp, your IAM credentials authorize user account confirmation. No confirmation code is required.

This request sets a user account active in a user pool that requires confirmation of new user accounts before they can sign in. You can configure your user pool to not send confirmation codes to new users and instead confirm them with this API operation on the back end.

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

Creates a new user in the specified user pool.

If MessageAction isn't set, the default is to send a welcome message via email or phone (SMS).

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

This message is based on a template that you configured in your call to create or update a user pool. This template includes your custom sign-up instructions and placeholders for user name and temporary password.

Alternatively, you can call AdminCreateUser with SUPPRESS for the MessageAction parameter, and Amazon Cognito won't send any email.

In either case, the user will be in the FORCE_CHANGE_PASSWORD state until they sign in and change their password.

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

Deletes a user as an administrator. Works on any user.

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

Deletes the user attributes in a user pool as an administrator. Works on any user.

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

Prevents the user from signing in with the specified external (SAML or social) identity provider (IdP). If the user that you want to deactivate is a Amazon Cognito user pools native username + password user, they can't use their password to sign in. If the user to deactivate is a linked external IdP user, any link between that user and an existing user is removed. When the external user signs in again, and the user is no longer attached to the previously linked DestinationUser, the user must create a new user account. See AdminLinkProviderForUser.

The ProviderName must match the value specified when creating an IdP for the pool.

To deactivate a native username + password user, the ProviderName value must be Cognito and the ProviderAttributeName must be Cognito_Subject. The ProviderAttributeValue must be the name that is used in the user pool for the user.

The ProviderAttributeName must always be Cognito_Subject for social IdPs. The ProviderAttributeValue must always be the exact subject that was used when the user was originally linked as a source user.

For de-linking a SAML identity, there are two scenarios. If the linked identity has not yet been used to sign in, the ProviderAttributeName and ProviderAttributeValue must be the same values that were used for the SourceUser when the identities were originally linked using AdminLinkProviderForUser call. (If the linking was done with ProviderAttributeName set to Cognito_Subject, the same applies here). However, if the user has already signed in, the ProviderAttributeName must be Cognito_Subject and ProviderAttributeValue must be the subject of the SAML assertion.

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

Deactivates a user and revokes all access tokens for the user. A deactivated user can't sign in, but still appears in the responses to GetUser and ListUsers API requests.

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

Enables the specified user as an administrator. Works on any user.

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

Forgets the device, as an administrator.

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

Gets the device, as an administrator.

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

Gets the specified user by user name in a user pool as an administrator. Works on any user.

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

Initiates the authentication flow, as an administrator.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

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

Links an existing user account in a user pool (DestinationUser) to an identity from an external IdP (SourceUser) based on a specified attribute name and value from the external IdP. This allows you to create a link from the existing user account to an external federated user identity that has not yet been used to sign in. You can then use the federated user identity to sign in as the existing user account.

For example, if there is an existing user with a username and password, this API links that user to a federated user identity. When the user signs in with a federated user identity, they sign in as the existing user account.

Note: The maximum number of federated identities linked to a user is five.

Because this API allows a user with an external federated identity to sign in as an existing user in the user pool, it is critical that it only be used with external IdPs and provider attributes that have been trusted by the application owner.

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

Lists devices, as an administrator.

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

Lists the groups that a user belongs to.

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

A history of user activity and any risks detected as part of Amazon Cognito advanced security.

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

Removes the specified user from the specified group.

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

Resets the specified user's password in a user pool as an administrator. Works on any user.

To use this API operation, your user pool must have self-service account recovery configured. Use AdminSetUserPassword if you manage passwords as an administrator.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Deactivates a user's password, requiring them to change it. If a user tries to sign in after the API is called, Amazon Cognito responds with a PasswordResetRequiredException error. Your app must then perform the actions that reset your user's password: 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.

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

Some API operations in a user pool generate a challenge, like a prompt for an MFA code, for device authentication that bypasses MFA, or for a custom authentication challenge. An AdminRespondToAuthChallenge API request provides the answer to that challenge, like a code or a secure remote password (SRP). The parameters of a response to an authentication challenge vary with the type of challenge.

For more information about custom authentication challenges, see Custom authentication challenge Lambda triggers.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

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

The user's multi-factor authentication (MFA) preference, including which MFA options are activated, and if any are preferred. Only one factor can be set as preferred. The preferred MFA factor will be used to authenticate a user if multiple factors are activated. If multiple options are activated and no preference is set, a challenge to choose an MFA option will be returned during sign-in.

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

Sets the specified user's password in a user pool as an administrator. Works on any user.

The password can be temporary or permanent. If it is temporary, the user status enters the FORCE_CHANGE_PASSWORD state. When the user next tries to sign in, the InitiateAuth/AdminInitiateAuth response will contain the NEW_PASSWORD_REQUIRED challenge. If the user doesn't sign in before it expires, the user won't be able to sign in, and an administrator must reset their password.

Once the user has set a new password, or the password is permanent, the user status is set to Confirmed.

AdminSetUserPassword can set a password for the user profile that Amazon Cognito creates for third-party federated users. When you set a password, the federated user's status changes from EXTERNAL_PROVIDER to CONFIRMED. A user in this state can sign in as a federated user, and initiate authentication flows in the API like a linked native user. They can also modify their password and attributes in token-authenticated API requests like ChangePassword and UpdateUserAttributes. As a best security practice and to keep users in sync with your external IdP, don't set passwords on federated user profiles. To set up a federated user for native sign-in with a linked native user, refer to Linking federated users to an existing user profile.

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

This action is no longer supported. You can use it to configure only SMS MFA. You can't use it to configure time-based one-time password (TOTP) software token MFA. To configure either type of MFA, use AdminSetUserMFAPreference instead.

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

Provides feedback for an authentication event indicating if it was from a valid user. This feedback is used for improving the risk evaluation decision for the user pool as part of Amazon Cognito advanced security.

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

Updates the device status as an administrator.

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

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Updates the specified user's attributes, including developer attributes, as an administrator. Works on any user. To delete an attribute from your user, submit the attribute in your API request with a blank value.

For custom attributes, you must prepend the custom: prefix to the attribute name.

In addition to updating user attributes, this API can also be used to mark phone and email as verified.

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

Invalidates the identity, access, and refresh tokens that Amazon Cognito issued to a user. Call this operation with your administrative credentials when your user signs out of your app. This results in the following behavior.

Other requests might be valid until your user's token expires.

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

Begins setup of time-based one-time password (TOTP) multi-factor authentication (MFA) for a user, with a unique private key that Amazon Cognito generates and returns in the API response. You can authorize an AssociateSoftwareToken request with either the user's access token, or a session string from a challenge response that you received from Amazon Cognito.

Note: Amazon Cognito disassociates an existing software token when you verify the new token in a VerifySoftwareToken API request. If you don't verify the software token and your user pool doesn't require MFA, the user can then authenticate with user name and password credentials alone. If your user pool requires TOTP MFA, Amazon Cognito generates an MFA_SETUP or SOFTWARE_TOKEN_SETUP challenge each time your user signs in. Complete setup with AssociateSoftwareToken and VerifySoftwareToken. After you set up software token MFA for your user, Amazon Cognito generates a SOFTWARE_TOKEN_MFA challenge when they authenticate. Respond to this challenge with your user's TOTP.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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

Changes the password for a specified user in a user pool.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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

Confirms tracking of the device. This API call is the call that begins device tracking. For more information about device authentication, see Working with user devices in your user pool.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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

Allows a user to enter a confirmation code to reset a forgotten password.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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

This public API operation provides a code that Amazon Cognito sent to your user when they signed up in your user pool via the SignUp API operation. After your user enters their code, they confirm ownership of the email address or phone number that they provided, and their user account becomes active. Depending on your user pool configuration, your users will receive their confirmation code in an email or SMS message.

Local users who signed up in your user pool are the only type of user who can confirm sign-up with a code. Users who federate through an external identity provider (IdP) have already been confirmed by their IdP. Administrator-created users, users created with the AdminCreateUser API operation, confirm their accounts when they respond to their invitation email message and choose a password. They do not receive a confirmation code. Instead, they receive a temporary password.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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

Creates a new group in the specified user pool.

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

Adds a configuration and trust relationship between a third-party identity provider (IdP) and a user pool.

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

Creates a new OAuth2.0 resource server and defines custom scopes within it.

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

Creates a user import job.

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

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Creates a new Amazon Cognito user pool and sets the password policy for the pool.

If you don't provide a value for an attribute, Amazon Cognito sets it to its default value.

```````` ``````` ### createUserPoolClient(params = {}, callback) ⇒ AWS.Request

Creates the user pool client.

When you create a new user pool client, token revocation is automatically activated. For more information about revoking tokens, see RevokeToken.

If you don't provide a value for an attribute, Amazon Cognito sets it to its default value.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Example user pool app client with email and username sign-in


/* The following example creates an app client with all configurable properties set to an example value. The resulting user pool client connects to an analytics client, allows sign-in with username and password, and has two external identity providers associated with it. */

 var params = {
  AccessTokenValidity: 6, 
  AllowedOAuthFlows: [
     "code"
  ], 
  AllowedOAuthFlowsUserPoolClient: true, 
  AllowedOAuthScopes: [
     "aws.cognito.signin.user.admin", 
     "openid"
  ], 
  AnalyticsConfiguration: {
   ApplicationId: "d70b2ba36a8c4dc5a04a0451a31a1e12", 
   ExternalId: "my-external-id", 
   RoleArn: "arn:aws:iam::123456789012:role/test-cognitouserpool-role", 
   UserDataShared: true
  }, 
  CallbackURLs: [
     "https://example.com", 
     "http://localhost", 
     "myapp://example"
  ], 
  ClientName: "my-test-app-client", 
  DefaultRedirectURI: "https://example.com", 
  ExplicitAuthFlows: [
     "ALLOW_ADMIN_USER_PASSWORD_AUTH", 
     "ALLOW_USER_PASSWORD_AUTH", 
     "ALLOW_REFRESH_TOKEN_AUTH"
  ], 
  GenerateSecret: true, 
  IdTokenValidity: 6, 
  LogoutURLs: [
     "https://example.com/logout"
  ], 
  PreventUserExistenceErrors: "ENABLED", 
  ReadAttributes: [
     "email", 
     "address", 
     "preferred_username"
  ], 
  RefreshTokenValidity: 6, 
  SupportedIdentityProviders: [
     "SignInWithApple", 
     "MySSO"
  ], 
  TokenValidityUnits: {
   AccessToken: "hours", 
   IdToken: "minutes", 
   RefreshToken: "days"
  }, 
  UserPoolId: "us-east-1_EXAMPLE", 
  WriteAttributes: [
     "family_name", 
     "email"
  ]
 };
 cognitoidentityserviceprovider.createUserPoolClient(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    UserPoolClient: {
     AccessTokenValidity: 6, 
     AllowedOAuthFlows: [
        "code"
     ], 
     AllowedOAuthFlowsUserPoolClient: true, 
     AllowedOAuthScopes: [
        "aws.cognito.signin.user.admin", 
        "openid"
     ], 
     AnalyticsConfiguration: {
      ApplicationId: "d70b2ba36a8c4dc5a04a0451a31a1e12", 
      ExternalId: "my-external-id", 
      RoleArn: "arn:aws:iam::123456789012:role/test-cognitouserpool-role", 
      UserDataShared: true
     }, 
     AuthSessionValidity: 3, 
     CallbackURLs: [
        "https://example.com", 
        "http://localhost", 
        "myapp://example"
     ], 
     ClientId: "26cb2c60kq7nbmas7rbme9b6pp", 
     ClientName: "my-test-app-client", 
     ClientSecret: "13ka4h7u28d9oo44tqpq9djqsfvhvu8rk4d2ighvpu0k8fj1c2r9", 
     CreationDate: <Date Representation>, 
     DefaultRedirectURI: "https://example.com", 
     EnablePropagateAdditionalUserContextData: false, 
     EnableTokenRevocation: true, 
     ExplicitAuthFlows: [
        "ALLOW_USER_PASSWORD_AUTH", 
        "ALLOW_ADMIN_USER_PASSWORD_AUTH", 
        "ALLOW_REFRESH_TOKEN_AUTH"
     ], 
     IdTokenValidity: 6, 
     LastModifiedDate: <Date Representation>, 
     LogoutURLs: [
        "https://example.com/logout"
     ], 
     PreventUserExistenceErrors: "ENABLED", 
     ReadAttributes: [
        "address", 
        "preferred_username", 
        "email"
     ], 
     RefreshTokenValidity: 6, 
     SupportedIdentityProviders: [
        "SignInWithApple", 
        "MySSO"
     ], 
     TokenValidityUnits: {
      AccessToken: "hours", 
      IdToken: "minutes", 
      RefreshToken: "days"
     }, 
     UserPoolId: "us-east-1_EXAMPLE", 
     WriteAttributes: [
        "family_name", 
        "email"
     ]
    }
   }
   */
 });

Calling the createUserPoolClient operation

var params = {
  ClientName: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  AccessTokenValidity: 'NUMBER_VALUE',
  AllowedOAuthFlows: [
    code | implicit | client_credentials,
    /* more items */
  ],
  AllowedOAuthFlowsUserPoolClient: true || false,
  AllowedOAuthScopes: [
    'STRING_VALUE',
    /* more items */
  ],
  AnalyticsConfiguration: {
    ApplicationArn: 'STRING_VALUE',
    ApplicationId: 'STRING_VALUE',
    ExternalId: 'STRING_VALUE',
    RoleArn: 'STRING_VALUE',
    UserDataShared: true || false
  },
  AuthSessionValidity: 'NUMBER_VALUE',
  CallbackURLs: [
    'STRING_VALUE',
    /* more items */
  ],
  DefaultRedirectURI: 'STRING_VALUE',
  EnablePropagateAdditionalUserContextData: true || false,
  EnableTokenRevocation: true || false,
  ExplicitAuthFlows: [
    ADMIN_NO_SRP_AUTH | CUSTOM_AUTH_FLOW_ONLY | USER_PASSWORD_AUTH | ALLOW_ADMIN_USER_PASSWORD_AUTH | ALLOW_CUSTOM_AUTH | ALLOW_USER_PASSWORD_AUTH | ALLOW_USER_SRP_AUTH | ALLOW_REFRESH_TOKEN_AUTH,
    /* more items */
  ],
  GenerateSecret: true || false,
  IdTokenValidity: 'NUMBER_VALUE',
  LogoutURLs: [
    'STRING_VALUE',
    /* more items */
  ],
  PreventUserExistenceErrors: LEGACY | ENABLED,
  ReadAttributes: [
    'STRING_VALUE',
    /* more items */
  ],
  RefreshTokenValidity: 'NUMBER_VALUE',
  SupportedIdentityProviders: [
    'STRING_VALUE',
    /* more items */
  ],
  TokenValidityUnits: {
    AccessToken: seconds | minutes | hours | days,
    IdToken: seconds | minutes | hours | days,
    RefreshToken: seconds | minutes | hours | days
  },
  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:

Callback (callback):

Returns:

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

Creates a new domain for a user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the createUserPoolDomain operation

var params = {
  Domain: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  CustomDomainConfig: {
    CertificateArn: 'STRING_VALUE' /* required */
  }
};
cognitoidentityserviceprovider.createUserPoolDomain(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Deletes a group.

Calling this action 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:

Callback (callback):

Returns:

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

Deletes an IdP for a user pool.

Service Reference:

Examples:

Calling the deleteIdentityProvider operation

var params = {
  ProviderName: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteIdentityProvider(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Deletes a resource server.

Service Reference:

Examples:

Calling the deleteResourceServer operation

var params = {
  Identifier: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteResourceServer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Allows a user to delete their own user profile.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the deleteUser operation

var params = {
  AccessToken: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUser(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Deletes the attributes for a user.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the deleteUserAttributes operation

var params = {
  AccessToken: 'STRING_VALUE', /* required */
  UserAttributeNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
cognitoidentityserviceprovider.deleteUserAttributes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Deletes the specified Amazon Cognito user pool.

Service Reference:

Examples:

Calling the deleteUserPool operation

var params = {
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUserPool(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Allows the developer to delete the user pool client.

Service Reference:

Examples:

Calling the deleteUserPoolClient operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUserPoolClient(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Deletes a domain for a user pool.

Service Reference:

Examples:

Calling the deleteUserPoolDomain operation

var params = {
  Domain: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.deleteUserPoolDomain(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Gets information about a specific IdP.

Service Reference:

Examples:

Calling the describeIdentityProvider operation

var params = {
  ProviderName: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeIdentityProvider(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Describes a resource server.

Service Reference:

Examples:

Calling the describeResourceServer operation

var params = {
  Identifier: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeResourceServer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Describes the risk configuration.

Service Reference:

Examples:

Calling the describeRiskConfiguration operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  ClientId: 'STRING_VALUE'
};
cognitoidentityserviceprovider.describeRiskConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Describes the user import job.

Service Reference:

Examples:

Calling the describeUserImportJob operation

var params = {
  JobId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeUserImportJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Returns the configuration information and metadata of the specified user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

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:

Callback (callback):

`Returns:

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

Client method for returning the configuration information and metadata of the specified user pool app client.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

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:

Callback (callback):

Returns:

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

Gets information about a domain.

Service Reference:

Examples:

Calling the describeUserPoolDomain operation

var params = {
  Domain: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.describeUserPoolDomain(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Forgets the specified device. For more information about device authentication, see Working with user devices in your user pool.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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:

Callback (callback):

Returns:

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

Calling this API causes a message to be sent to the end user with a confirmation code that is required to change the user's password. For the Username parameter, you can use the username or user alias. The method used to send the confirmation code is sent according to the specified AccountRecoverySetting. For more information, see Recovering User Accounts in the Amazon Cognito Developer Guide. To use the confirmation code for resetting the password, call ConfirmForgotPassword.

If neither a verified phone number nor a verified email exists, this API returns InvalidParameterException. If your app client has a client secret and you don't provide a SECRET_HASH parameter, this API returns NotAuthorizedException.

To use this API operation, your user pool must have self-service account recovery configured. Use AdminSetUserPassword if you manage passwords as an administrator.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Calling the forgotPassword operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  Username: 'STRING_VALUE', /* required */
  AnalyticsMetadata: {
    AnalyticsEndpointId: 'STRING_VALUE'
  },
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  SecretHash: 'STRING_VALUE',
  UserContextData: {
    EncodedData: 'STRING_VALUE',
    IpAddress: '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:

Callback (callback):

Returns:

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

Gets the header information for the comma-separated value (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:

Callback (callback):

Returns:

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

Gets the device. For more information about device authentication, see Working with user devices in your user pool.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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:

Callback (callback):

Returns:

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

Gets a group.

Calling this action 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:

Callback (callback):

Returns:

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

Gets the specified IdP.

Service Reference:

Examples:

Calling the getIdentityProviderByIdentifier operation

var params = {
  IdpIdentifier: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getIdentityProviderByIdentifier(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Gets the logging configuration of a user pool.

Service Reference:

Examples:

Calling the getLogDeliveryConfiguration operation

var params = {
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getLogDeliveryConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

This method takes a user pool ID, and returns the signing certificate. The issued certificate is valid for 10 years from the date of issue.

Amazon Cognito issues and assigns a new signing certificate annually. This process returns a new value in the response to GetSigningCertificate, but doesn't invalidate the original certificate.

Service Reference:

Examples:

Calling the getSigningCertificate operation

var params = {
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getSigningCertificate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Gets the user interface (UI) Customization information for a particular app client's app UI, if any such information exists for the client. If nothing is set for the particular client, but there is an existing pool level customization (the app clientId is ALL), then that information is returned. If nothing is present, then an empty shape is returned.

Service Reference:

Examples:

Calling the getUICustomization operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  ClientId: 'STRING_VALUE'
};
cognitoidentityserviceprovider.getUICustomization(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Gets the user attributes and metadata for a user.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the getUser operation

var params = {
  AccessToken: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getUser(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Generates a user attribute verification code for the specified attribute name. Sends a message to a user with a code that they must return in a VerifyUserAttribute request.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Calling the getUserAttributeVerificationCode operation

var params = {
  AccessToken: 'STRING_VALUE', /* required */
  AttributeName: 'STRING_VALUE', /* required */
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  }
};
cognitoidentityserviceprovider.getUserAttributeVerificationCode(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Gets the user pool multi-factor authentication (MFA) configuration.

Service Reference:

Examples:

Calling the getUserPoolMfaConfig operation

var params = {
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.getUserPoolMfaConfig(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Invalidates the identity, access, and refresh tokens that Amazon Cognito issued to a user. Call this operation when your user signs out of your app. This results in the following behavior.

Other requests might be valid until your user's token expires.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the globalSignOut operation

var params = {
  AccessToken: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.globalSignOut(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Initiates sign-in for a user in the Amazon Cognito user directory. You can't sign in a user with a federated IdP with InitiateAuth. For more information, see Adding user pool sign-in through a third party.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Example username and password sign-in for a user who has TOTP MFA


/* The following example signs in the user mytestuser with analytics data, client metadata, and user context data for advanced security. */

 var params = {
  AnalyticsMetadata: {
   AnalyticsEndpointId: "d70b2ba36a8c4dc5a04a0451a31a1e12"
  }, 
  AuthFlow: "USER_PASSWORD_AUTH", 
  AuthParameters: {
   "PASSWORD": "This-is-my-test-99!", 
   "SECRET_HASH": "oT5ZkS8ctnrhYeeGsGTvOzPhoc/Jd1cO5fueBWFVmp8=", 
   "USERNAME": "mytestuser"
  }, 
  ClientId: "1example23456789", 
  ClientMetadata: {
   "MyTestKey": "MyTestValue"
  }, 
  UserContextData: {
   EncodedData: "AmazonCognitoAdvancedSecurityData_object", 
   IpAddress: "192.0.2.1"
  }
 };
 cognitoidentityserviceprovider.initiateAuth(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    ChallengeName: "SOFTWARE_TOKEN_MFA", 
    ChallengeParameters: {
     "FRIENDLY_DEVICE_NAME": "mytestauthenticator", 
     "USER_ID_FOR_SRP": "mytestuser"
    }, 
    Session: "AYABeC1-y8qooiuysEv0uM4wAqQAHQABAAdTZXJ2aWNlABBDb2duaXRvVXNlclBvb2xzAAEAB2F3cy1rbXMAS2Fybjphd3M6a21zOnVzLXdlc3QtMjowMTU3MzY3MjcxOTg6a2V5LzI5OTFhNGE5LTM5YTAtNDQ0Mi04MWU4LWRkYjY4NTllMTg2MQC4AQIBAHhjxv5lVLhE2_WNrC1zuomqn08qDUUp3z9v4EGAjazZ-wGP3HuBF5Izvxf-9WkCT5uyAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMeQoT5e6Dpfh52caqAgEQgDvuL8uLMhPt0WmQpZnkNED1gob6xbqt5LaQo_H4L5CuT4Kj499dGCoZ1q1trmlZSRgRm0wwGGG8lFU37QIAAAAADAAAEAAAAAAAAAAAAAAAAADuLe9_UJ4oZAMsQYr0ntiT_____wAAAAEAAAAAAAAAAAAAAAEAAADnLDGmKBQtsCafNokRmPLgl2itBKuKR2dfZBQb5ucCYkzThM5HOfQUSEL-A3dZzfYDC0IODsrcMkrbeeVyMJk-FCzsxS9Og8BEBVnvi9WjZkPJ4mF0YS6FUXnoPSBV5oUqGzRaT-tJ169SUFZAUfFM1fGeJ8T57-QdCxjyISRCWV1VG5_7TiCioyRGfWwzNVWh7exJortF3ccfOyiEyxeqJ2VJvJq3m_w8NP24_PMDpktpRMKftObIMlD5ewRTNCdrUXQ1BW5KIxhJLGjYfRzJDZuKzmEgS-VHsKz0z76w-AlAgdfvdAjflLnsgduU5kUX4YP6jqnetg"
   }
   */
 });

Calling the initiateAuth operation

var params = {
  AuthFlow: USER_SRP_AUTH | REFRESH_TOKEN_AUTH | REFRESH_TOKEN | CUSTOM_AUTH | ADMIN_NO_SRP_AUTH | USER_PASSWORD_AUTH | ADMIN_USER_PASSWORD_AUTH, /* required */
  ClientId: 'STRING_VALUE', /* required */
  AnalyticsMetadata: {
    AnalyticsEndpointId: 'STRING_VALUE'
  },
  AuthParameters: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  UserContextData: {
    EncodedData: 'STRING_VALUE',
    IpAddress: 'STRING_VALUE'
  }
};
cognitoidentityserviceprovider.initiateAuth(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists the sign-in devices that Amazon Cognito has registered to the current user. For more information about device authentication, see Working with user devices in your user pool.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the listDevices operation

var params = {
  AccessToken: 'STRING_VALUE', /* required */
  Limit: 'NUMBER_VALUE',
  PaginationToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listDevices(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists the groups associated with a user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the listGroups operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  Limit: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listGroups(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists information about all IdPs for a user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the listIdentityProviders operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listIdentityProviders(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists the resource servers for a user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the listResourceServers operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listResourceServers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists the tags that are assigned to an Amazon Cognito user pool.

A tag is a label that you can apply to user pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.

You can use this action up to 10 times per second, per account.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  ResourceArn: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists user import jobs for a user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the listUserImportJobs operation

var params = {
  MaxResults: 'NUMBER_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  PaginationToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUserImportJobs(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists the clients that have been created for the specified user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the listUserPoolClients operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUserPoolClients(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists the user pools associated with an Amazon Web Services account.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the listUserPools operation

var params = {
  MaxResults: 'NUMBER_VALUE', /* required */
  NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUserPools(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

`Returns:

````` ### listUsers(params = {}, callback) ⇒ AWS.Request

Lists users and their basic details in a user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

A ListUsers request for the next 3 users whose email address starts with "testuser."


/* This request submits a value for all possible parameters for ListUsers. By iterating the PaginationToken, you can page through and collect all users in a user pool. */

 var params = {
  AttributesToGet: [
     "email", 
     "sub"
  ], 
  Filter: "\"email\"^=\"testuser\"", 
  Limit: 3, 
  PaginationToken: "abcd1234EXAMPLE", 
  UserPoolId: "us-east-1_EXAMPLE"
 };
 cognitoidentityserviceprovider.listUsers(params, function(err, data) {
   if (err) console.log(err, err.stack); // an error occurred
   else     console.log(data);           // successful response
   /*
   data = {
    PaginationToken: "efgh5678EXAMPLE", 
    Users: [
       {
      Attributes: [
         {
        Name: "sub", 
        Value: "eaad0219-2117-439f-8d46-4db20e59268f"
       }, 
         {
        Name: "email", 
        Value: "testuser@example.com"
       }
      ], 
      Enabled: true, 
      UserCreateDate: <Date Representation>, 
      UserLastModifiedDate: <Date Representation>, 
      UserStatus: "CONFIRMED", 
      Username: "testuser"
     }, 
       {
      Attributes: [
         {
        Name: "sub", 
        Value: "3b994cfd-0b07-4581-be46-3c82f9a70c90"
       }, 
         {
        Name: "email", 
        Value: "testuser2@example.com"
       }
      ], 
      Enabled: true, 
      UserCreateDate: <Date Representation>, 
      UserLastModifiedDate: <Date Representation>, 
      UserStatus: "UNCONFIRMED", 
      Username: "testuser2"
     }, 
       {
      Attributes: [
         {
        Name: "sub", 
        Value: "5929e0d1-4c34-42d1-9b79-a5ecacfe66f7"
       }, 
         {
        Name: "email", 
        Value: "testuser3@example.com"
       }
      ], 
      Enabled: true, 
      UserCreateDate: <Date Representation>, 
      UserLastModifiedDate: <Date Representation>, 
      UserStatus: "UNCONFIRMED", 
      Username: "testuser3@example.com"
     }
    ]
   }
   */
 });

Calling the listUsers operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  AttributesToGet: [
    'STRING_VALUE',
    /* more items */
  ],
  Filter: 'STRING_VALUE',
  Limit: 'NUMBER_VALUE',
  PaginationToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUsers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Lists the users in the specified group.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the listUsersInGroup operation

var params = {
  GroupName: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  Limit: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE'
};
cognitoidentityserviceprovider.listUsersInGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Resends the confirmation (for confirmation of registration) to a specific user in the user pool.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Calling the resendConfirmationCode operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  Username: 'STRING_VALUE', /* required */
  AnalyticsMetadata: {
    AnalyticsEndpointId: 'STRING_VALUE'
  },
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  SecretHash: 'STRING_VALUE',
  UserContextData: {
    EncodedData: 'STRING_VALUE',
    IpAddress: '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:

Callback (callback):

Returns:

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

Some API operations in a user pool generate a challenge, like a prompt for an MFA code, for device authentication that bypasses MFA, or for a custom authentication challenge. A RespondToAuthChallenge API request provides the answer to that challenge, like a code or a secure remote password (SRP). The parameters of a response to an authentication challenge vary with the type of challenge.

For more information about custom authentication challenges, see Custom authentication challenge Lambda triggers.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Calling the respondToAuthChallenge operation

var params = {
  ChallengeName: SMS_MFA | SOFTWARE_TOKEN_MFA | SELECT_MFA_TYPE | MFA_SETUP | PASSWORD_VERIFIER | CUSTOM_CHALLENGE | DEVICE_SRP_AUTH | DEVICE_PASSWORD_VERIFIER | ADMIN_NO_SRP_AUTH | NEW_PASSWORD_REQUIRED, /* required */
  ClientId: 'STRING_VALUE', /* required */
  AnalyticsMetadata: {
    AnalyticsEndpointId: 'STRING_VALUE'
  },
  ChallengeResponses: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  Session: 'STRING_VALUE',
  UserContextData: {
    EncodedData: 'STRING_VALUE',
    IpAddress: '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:

Callback (callback):

Returns:

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

Revokes all of the access tokens generated by, and at the same time as, the specified refresh token. After a token is revoked, you can't use the revoked token to access Amazon Cognito user APIs, or to authorize access to your resource server.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the revokeToken operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  Token: 'STRING_VALUE', /* required */
  ClientSecret: 'STRING_VALUE'
};
cognitoidentityserviceprovider.revokeToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Sets up or modifies the logging configuration of a user pool. User pools can export user notification logs and advanced security features user activity logs.

Service Reference:

Examples:

Calling the setLogDeliveryConfiguration operation

var params = {
  LogConfigurations: [ /* required */
    {
      EventSource: userNotification | userAuthEvents, /* required */
      LogLevel: ERROR | INFO, /* required */
      CloudWatchLogsConfiguration: {
        LogGroupArn: 'STRING_VALUE'
      },
      FirehoseConfiguration: {
        StreamArn: 'STRING_VALUE'
      },
      S3Configuration: {
        BucketArn: 'STRING_VALUE'
      }
    },
    /* more items */
  ],
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.setLogDeliveryConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Configures actions on detected risks. To delete the risk configuration for UserPoolId or ClientId, pass null values for all four configuration types.

To activate Amazon Cognito advanced security features, update the user pool to include the UserPoolAddOns keyAdvancedSecurityMode.

Service Reference:

Examples:

Calling the setRiskConfiguration operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  AccountTakeoverRiskConfiguration: {
    Actions: { /* required */
      HighAction: {
        EventAction: BLOCK | MFA_IF_CONFIGURED | MFA_REQUIRED | NO_ACTION, /* required */
        Notify: true || false /* required */
      },
      LowAction: {
        EventAction: BLOCK | MFA_IF_CONFIGURED | MFA_REQUIRED | NO_ACTION, /* required */
        Notify: true || false /* required */
      },
      MediumAction: {
        EventAction: BLOCK | MFA_IF_CONFIGURED | MFA_REQUIRED | NO_ACTION, /* required */
        Notify: true || false /* required */
      }
    },
    NotifyConfiguration: {
      SourceArn: 'STRING_VALUE', /* required */
      BlockEmail: {
        Subject: 'STRING_VALUE', /* required */
        HtmlBody: 'STRING_VALUE',
        TextBody: 'STRING_VALUE'
      },
      From: 'STRING_VALUE',
      MfaEmail: {
        Subject: 'STRING_VALUE', /* required */
        HtmlBody: 'STRING_VALUE',
        TextBody: 'STRING_VALUE'
      },
      NoActionEmail: {
        Subject: 'STRING_VALUE', /* required */
        HtmlBody: 'STRING_VALUE',
        TextBody: 'STRING_VALUE'
      },
      ReplyTo: 'STRING_VALUE'
    }
  },
  ClientId: 'STRING_VALUE',
  CompromisedCredentialsRiskConfiguration: {
    Actions: { /* required */
      EventAction: BLOCK | NO_ACTION /* required */
    },
    EventFilter: [
      SIGN_IN | PASSWORD_CHANGE | SIGN_UP,
      /* more items */
    ]
  },
  RiskExceptionConfiguration: {
    BlockedIPRangeList: [
      'STRING_VALUE',
      /* more items */
    ],
    SkippedIPRangeList: [
      'STRING_VALUE',
      /* more items */
    ]
  }
};
cognitoidentityserviceprovider.setRiskConfiguration(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Sets the user interface (UI) customization information for a user pool's built-in app UI.

You can specify app UI customization settings for a single client (with a specific clientId) or for all clients (by setting the clientId to ALL). If you specify ALL, the default configuration is used for every client that has no previously set UI customization. If you specify UI customization settings for a particular client, it will no longer return to the ALL configuration.

Note: To use this API, your user pool must have a domain associated with it. Otherwise, there is no place to host the app's pages, and the service will throw an error.

Service Reference:

Examples:

Calling the setUICustomization operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  CSS: 'STRING_VALUE',
  ClientId: 'STRING_VALUE',
  ImageFile: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */
};
cognitoidentityserviceprovider.setUICustomization(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Set the user's multi-factor authentication (MFA) method preference, including which MFA factors are activated and if any are preferred. Only one factor can be set as preferred. The preferred MFA factor will be used to authenticate a user if multiple factors are activated. If multiple options are activated and no preference is set, a challenge to choose an MFA option will be returned during sign-in. If an MFA type is activated for a user, the user will be prompted for MFA during all sign-in attempts unless device tracking is turned on and the device has been trusted. If you want MFA to be applied selectively based on the assessed risk level of sign-in attempts, deactivate MFA for users and turn on Adaptive Authentication for the user pool.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the setUserMFAPreference operation

var params = {
  AccessToken: 'STRING_VALUE', /* required */
  SMSMfaSettings: {
    Enabled: true || false,
    PreferredMfa: true || false
  },
  SoftwareTokenMfaSettings: {
    Enabled: true || false,
    PreferredMfa: true || false
  }
};
cognitoidentityserviceprovider.setUserMFAPreference(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Sets the user pool multi-factor authentication (MFA) configuration.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Calling the setUserPoolMfaConfig operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  MfaConfiguration: OFF | ON | OPTIONAL,
  SmsMfaConfiguration: {
    SmsAuthenticationMessage: 'STRING_VALUE',
    SmsConfiguration: {
      SnsCallerArn: 'STRING_VALUE', /* required */
      ExternalId: 'STRING_VALUE',
      SnsRegion: 'STRING_VALUE'
    }
  },
  SoftwareTokenMfaConfiguration: {
    Enabled: true || false
  }
};
cognitoidentityserviceprovider.setUserPoolMfaConfig(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

This action is no longer supported. You can use it to configure only SMS MFA. You can't use it to configure time-based one-time password (TOTP) software token MFA. To configure either type of MFA, use SetUserMFAPreference instead.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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:

Callback (callback):

Returns:

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

Registers the user in the specified user pool and creates a user name, password, and user attributes.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Calling the signUp operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  Password: 'STRING_VALUE', /* required */
  Username: 'STRING_VALUE', /* required */
  AnalyticsMetadata: {
    AnalyticsEndpointId: 'STRING_VALUE'
  },
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  },
  SecretHash: 'STRING_VALUE',
  UserAttributes: [
    {
      Name: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  UserContextData: {
    EncodedData: 'STRING_VALUE',
    IpAddress: 'STRING_VALUE'
  },
  ValidationData: [
    {
      Name: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ]
};
cognitoidentityserviceprovider.signUp(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Starts the user import.

Service Reference:

Examples:

Calling the startUserImportJob operation

var params = {
  JobId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.startUserImportJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Stops the user import job.

Service Reference:

Examples:

Calling the stopUserImportJob operation

var params = {
  JobId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.stopUserImportJob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Assigns a set of tags to an Amazon Cognito user pool. A tag is a label that you can use to categorize and manage user pools in different ways, such as by purpose, owner, environment, or other criteria.

Each tag consists of a key and value, both of which you define. A key is a general category for more specific values. For example, if you have two versions of a user pool, one for testing and another for production, you might assign an Environment tag key to both user pools. The value of this key might be Test for one user pool, and Production for the other.

Tags are useful for cost tracking and access control. You can activate your tags so that they appear on the Billing and Cost Management console, where you can track the costs associated with your user pools. In an Identity and Access Management policy, you can constrain permissions for user pools based on specific tags or tag values.

You can use this action up to 5 times per second, per account. A user pool can have as many as 50 tags.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  ResourceArn: 'STRING_VALUE', /* required */
  Tags: { /* required */
    '<TagKeysType>': 'STRING_VALUE',
    /* '<TagKeysType>': ... */
  }
};
cognitoidentityserviceprovider.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Removes the specified tags from an Amazon Cognito user pool. You can use this action up to 5 times per second, per account.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  ResourceArn: 'STRING_VALUE', /* required */
  TagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
cognitoidentityserviceprovider.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Provides the feedback for an authentication event, whether it was from a valid user or not. This feedback is used for improving the risk evaluation decision for the user pool as part of Amazon Cognito advanced security.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the updateAuthEventFeedback operation

var params = {
  EventId: 'STRING_VALUE', /* required */
  FeedbackToken: 'STRING_VALUE', /* required */
  FeedbackValue: Valid | Invalid, /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  Username: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.updateAuthEventFeedback(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Updates the device status. For more information about device authentication, see Working with user devices in your user pool.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

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:

Callback (callback):

Returns:

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

Updates the specified group with the specified attributes.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the updateGroup operation

var params = {
  GroupName: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  Description: 'STRING_VALUE',
  Precedence: 'NUMBER_VALUE',
  RoleArn: 'STRING_VALUE'
};
cognitoidentityserviceprovider.updateGroup(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Updates IdP information for a user pool.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the updateIdentityProvider operation

var params = {
  ProviderName: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  AttributeMapping: {
    '<AttributeMappingKeyType>': 'STRING_VALUE',
    /* '<AttributeMappingKeyType>': ... */
  },
  IdpIdentifiers: [
    'STRING_VALUE',
    /* more items */
  ],
  ProviderDetails: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  }
};
cognitoidentityserviceprovider.updateIdentityProvider(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Updates the name and scopes of resource server. All other fields are read-only.

If you don't provide a value for an attribute, it is set to the default value.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the updateResourceServer operation

var params = {
  Identifier: 'STRING_VALUE', /* required */
  Name: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  Scopes: [
    {
      ScopeDescription: 'STRING_VALUE', /* required */
      ScopeName: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
cognitoidentityserviceprovider.updateResourceServer(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

With this operation, your users can update one or more of their attributes with their own credentials. You authorize this API request with the user's access token. To delete an attribute from your user, submit the attribute in your API request with a blank value. Custom attribute values in this request must include the custom: prefix.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Service Reference:

Examples:

Calling the updateUserAttributes operation

var params = {
  AccessToken: 'STRING_VALUE', /* required */
  UserAttributes: [ /* required */
    {
      Name: 'STRING_VALUE', /* required */
      Value: 'STRING_VALUE'
    },
    /* more items */
  ],
  ClientMetadata: {
    '<StringType>': 'STRING_VALUE',
    /* '<StringType>': ... */
  }
};
cognitoidentityserviceprovider.updateUserAttributes(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Note: This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers require you to register an origination phone number before you can send SMS messages to US phone numbers. If you use SMS text messages in Amazon Cognito, you must register a phone number with Amazon Pinpoint. Amazon Cognito uses the registered number automatically. Otherwise, Amazon Cognito users who must receive SMS messages might not be able to sign up, activate their accounts, or sign in. If you have never used SMS text messages with Amazon Cognito or any other Amazon Web Services service, Amazon Simple Notification Service might place your account in the SMS sandbox. In sandbox mode , you can send messages only to verified phone numbers. After you test your app while in the sandbox environment, you can move out of the sandbox and into production. For more information, see SMS message settings for Amazon Cognito user pools in the Amazon Cognito Developer Guide.

Updates the specified user pool with the specified attributes. You can get a list of the current user pool settings using DescribeUserPool.

If you don't provide a value for an attribute, Amazon Cognito sets it to its default value.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the updateUserPool operation

var params = {
  UserPoolId: 'STRING_VALUE', /* required */
  AccountRecoverySetting: {
    RecoveryMechanisms: [
      {
        Name: verified_email | verified_phone_number | admin_only, /* required */
        Priority: 'NUMBER_VALUE' /* required */
      },
      /* more items */
    ]
  },
  AdminCreateUserConfig: {
    AllowAdminCreateUserOnly: true || false,
    InviteMessageTemplate: {
      EmailMessage: 'STRING_VALUE',
      EmailSubject: 'STRING_VALUE',
      SMSMessage: 'STRING_VALUE'
    },
    UnusedAccountValidityDays: 'NUMBER_VALUE'
  },
  AutoVerifiedAttributes: [
    phone_number | email,
    /* more items */
  ],
  DeletionProtection: ACTIVE | INACTIVE,
  DeviceConfiguration: {
    ChallengeRequiredOnNewDevice: true || false,
    DeviceOnlyRememberedOnUserPrompt: true || false
  },
  EmailConfiguration: {
    ConfigurationSet: 'STRING_VALUE',
    EmailSendingAccount: COGNITO_DEFAULT | DEVELOPER,
    From: 'STRING_VALUE',
    ReplyToEmailAddress: 'STRING_VALUE',
    SourceArn: 'STRING_VALUE'
  },
  EmailVerificationMessage: 'STRING_VALUE',
  EmailVerificationSubject: 'STRING_VALUE',
  LambdaConfig: {
    CreateAuthChallenge: 'STRING_VALUE',
    CustomEmailSender: {
      LambdaArn: 'STRING_VALUE', /* required */
      LambdaVersion: V1_0 /* required */
    },
    CustomMessage: 'STRING_VALUE',
    CustomSMSSender: {
      LambdaArn: 'STRING_VALUE', /* required */
      LambdaVersion: V1_0 /* required */
    },
    DefineAuthChallenge: 'STRING_VALUE',
    KMSKeyID: 'STRING_VALUE',
    PostAuthentication: 'STRING_VALUE',
    PostConfirmation: 'STRING_VALUE',
    PreAuthentication: 'STRING_VALUE',
    PreSignUp: 'STRING_VALUE',
    PreTokenGeneration: 'STRING_VALUE',
    PreTokenGenerationConfig: {
      LambdaArn: 'STRING_VALUE', /* required */
      LambdaVersion: V1_0 | V2_0 /* required */
    },
    UserMigration: 'STRING_VALUE',
    VerifyAuthChallengeResponse: 'STRING_VALUE'
  },
  MfaConfiguration: OFF | ON | OPTIONAL,
  Policies: {
    PasswordPolicy: {
      MinimumLength: 'NUMBER_VALUE',
      PasswordHistorySize: 'NUMBER_VALUE',
      RequireLowercase: true || false,
      RequireNumbers: true || false,
      RequireSymbols: true || false,
      RequireUppercase: true || false,
      TemporaryPasswordValidityDays: 'NUMBER_VALUE'
    }
  },
  SmsAuthenticationMessage: 'STRING_VALUE',
  SmsConfiguration: {
    SnsCallerArn: 'STRING_VALUE', /* required */
    ExternalId: 'STRING_VALUE',
    SnsRegion: 'STRING_VALUE'
  },
  SmsVerificationMessage: 'STRING_VALUE',
  UserAttributeUpdateSettings: {
    AttributesRequireVerificationBeforeUpdate: [
      phone_number | email,
      /* more items */
    ]
  },
  UserPoolAddOns: {
    AdvancedSecurityMode: OFF | AUDIT | ENFORCED, /* required */
    AdvancedSecurityAdditionalFlows: {
      CustomAuthMode: AUDIT | ENFORCED
    }
  },
  UserPoolTags: {
    '<TagKeysType>': 'STRING_VALUE',
    /* '<TagKeysType>': ... */
  },
  VerificationMessageTemplate: {
    DefaultEmailOption: CONFIRM_WITH_LINK | CONFIRM_WITH_CODE,
    EmailMessage: 'STRING_VALUE',
    EmailMessageByLink: 'STRING_VALUE',
    EmailSubject: 'STRING_VALUE',
    EmailSubjectByLink: 'STRING_VALUE',
    SmsMessage: 'STRING_VALUE'
  }
};
cognitoidentityserviceprovider.updateUserPool(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

``

`` Callback (callback):

Returns:

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

Updates the specified user pool app client with the specified attributes. You can get a list of the current user pool app client settings using DescribeUserPoolClient.

If you don't provide a value for an attribute, Amazon Cognito sets it to its default value.

You can also use this operation to enable token revocation for user pool clients. For more information about revoking tokens, see RevokeToken.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the updateUserPoolClient operation

var params = {
  ClientId: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE', /* required */
  AccessTokenValidity: 'NUMBER_VALUE',
  AllowedOAuthFlows: [
    code | implicit | client_credentials,
    /* more items */
  ],
  AllowedOAuthFlowsUserPoolClient: true || false,
  AllowedOAuthScopes: [
    'STRING_VALUE',
    /* more items */
  ],
  AnalyticsConfiguration: {
    ApplicationArn: 'STRING_VALUE',
    ApplicationId: 'STRING_VALUE',
    ExternalId: 'STRING_VALUE',
    RoleArn: 'STRING_VALUE',
    UserDataShared: true || false
  },
  AuthSessionValidity: 'NUMBER_VALUE',
  CallbackURLs: [
    'STRING_VALUE',
    /* more items */
  ],
  ClientName: 'STRING_VALUE',
  DefaultRedirectURI: 'STRING_VALUE',
  EnablePropagateAdditionalUserContextData: true || false,
  EnableTokenRevocation: true || false,
  ExplicitAuthFlows: [
    ADMIN_NO_SRP_AUTH | CUSTOM_AUTH_FLOW_ONLY | USER_PASSWORD_AUTH | ALLOW_ADMIN_USER_PASSWORD_AUTH | ALLOW_CUSTOM_AUTH | ALLOW_USER_PASSWORD_AUTH | ALLOW_USER_SRP_AUTH | ALLOW_REFRESH_TOKEN_AUTH,
    /* more items */
  ],
  IdTokenValidity: 'NUMBER_VALUE',
  LogoutURLs: [
    'STRING_VALUE',
    /* more items */
  ],
  PreventUserExistenceErrors: LEGACY | ENABLED,
  ReadAttributes: [
    'STRING_VALUE',
    /* more items */
  ],
  RefreshTokenValidity: 'NUMBER_VALUE',
  SupportedIdentityProviders: [
    'STRING_VALUE',
    /* more items */
  ],
  TokenValidityUnits: {
    AccessToken: seconds | minutes | hours | days,
    IdToken: seconds | minutes | hours | days,
    RefreshToken: seconds | minutes | hours | days
  },
  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:

Callback (callback):

Returns:

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

Updates the Secure Sockets Layer (SSL) certificate for the custom domain for your user pool.

You can use this operation to provide the Amazon Resource Name (ARN) of a new certificate to Amazon Cognito. You can't use it to change the domain for a user pool.

A custom domain is used to host the Amazon Cognito hosted UI, which provides sign-up and sign-in pages for your application. When you set up a custom domain, you provide a certificate that you manage with Certificate Manager (ACM). When necessary, you can use this operation to change the certificate that you applied to your custom domain.

Usually, this is unnecessary following routine certificate renewal with ACM. When you renew your existing certificate in ACM, the ARN for your certificate remains the same, and your custom domain uses the new certificate automatically.

However, if you replace your existing certificate with a new one, ACM gives the new certificate a new ARN. To apply the new certificate to your custom domain, you must provide this ARN to Amazon Cognito.

When you add your new certificate in ACM, you must choose US East (N. Virginia) as the Amazon Web Services Region.

After you submit your request, Amazon Cognito requires up to 1 hour to distribute your new certificate to your custom domain.

For more information about adding a custom domain to your user pool, see Using Your Own Domain for the Hosted UI.

Note: Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

Service Reference:

Examples:

Calling the updateUserPoolDomain operation

var params = {
  CustomDomainConfig: { /* required */
    CertificateArn: 'STRING_VALUE' /* required */
  },
  Domain: 'STRING_VALUE', /* required */
  UserPoolId: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.updateUserPoolDomain(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Use this API to register a user's entered time-based one-time password (TOTP) code and mark the user's software token MFA status as "verified" if successful. The request takes an access token or a session string, but not both.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the verifySoftwareToken operation

var params = {
  UserCode: 'STRING_VALUE', /* required */
  AccessToken: 'STRING_VALUE',
  FriendlyDeviceName: 'STRING_VALUE',
  Session: 'STRING_VALUE'
};
cognitoidentityserviceprovider.verifySoftwareToken(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

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

Verifies the specified user attributes in the user pool.

If your user pool requires verification before Amazon Cognito updates the attribute value, VerifyUserAttribute updates the affected attribute to its pending value. For more information, see UserAttributeUpdateSettingsType.

Authorize this action with a signed-in user's access token. It must include the scope aws.cognito.signin.user.admin.

Note: Amazon Cognito doesn't evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can't use IAM credentials to authorize requests, and you can't grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.

Service Reference:

Examples:

Calling the verifyUserAttribute operation

var params = {
  AccessToken: 'STRING_VALUE', /* required */
  AttributeName: 'STRING_VALUE', /* required */
  Code: 'STRING_VALUE' /* required */
};
cognitoidentityserviceprovider.verifyUserAttribute(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

Returns:

```` ````` `````` ``````` ````````