Skip to content

Commit 6ee832d

Browse files
author
awstools
committed
feat(client-cognito-identity-provider): Amazon Cognito now supports requiring attribute verification (ex. email and phone number) before update.
1 parent 2b041ea commit 6ee832d

File tree

59 files changed

+3344
-2151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+3344
-2151
lines changed

clients/client-cognito-identity-provider/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99

1010
AWS SDK for JavaScript CognitoIdentityProvider Client for Node.js, Browser and React Native.
1111

12-
<p>Using the Amazon Cognito user pools API, you can create a user pool to manage directories and users. You can authenticate a user to obtain tokens related to user identity and access policies.</p>
12+
<p>Using the Amazon Cognito user pools API, you can create a user pool to manage directories and
13+
users. You can authenticate a user to obtain tokens related to user identity and access
14+
policies.</p>
1315
<p>This API reference provides information about user pools in Amazon Cognito user pools.</p>
14-
<p>For more information, see the <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html">Amazon Cognito Documentation</a>.</p>
16+
<p>For more information, see the <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html">Amazon Cognito
17+
Documentation</a>.</p>
1518

1619
## Installing
1720

clients/client-cognito-identity-provider/src/CognitoIdentityProvider.ts

Lines changed: 261 additions & 157 deletions
Large diffs are not rendered by default.

clients/client-cognito-identity-provider/src/CognitoIdentityProviderClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,12 @@ type CognitoIdentityProviderClientResolvedConfigType = __SmithyResolvedConfigura
678678
export interface CognitoIdentityProviderClientResolvedConfig extends CognitoIdentityProviderClientResolvedConfigType {}
679679

680680
/**
681-
* <p>Using the Amazon Cognito user pools API, you can create a user pool to manage directories and users. You can authenticate a user to obtain tokens related to user identity and access policies.</p>
681+
* <p>Using the Amazon Cognito user pools API, you can create a user pool to manage directories and
682+
* users. You can authenticate a user to obtain tokens related to user identity and access
683+
* policies.</p>
682684
* <p>This API reference provides information about user pools in Amazon Cognito user pools.</p>
683-
* <p>For more information, see the <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html">Amazon Cognito Documentation</a>.</p>
685+
* <p>For more information, see the <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/what-is-amazon-cognito.html">Amazon Cognito
686+
* Documentation</a>.</p>
684687
*/
685688
export class CognitoIdentityProviderClient extends __Client<
686689
__HttpHandlerOptions,

clients/client-cognito-identity-provider/src/commands/AdminConfirmSignUpCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface AdminConfirmSignUpCommandInput extends AdminConfirmSignUpReques
2828
export interface AdminConfirmSignUpCommandOutput extends AdminConfirmSignUpResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Confirms user registration as an admin without using a confirmation code. Works on any user.</p>
31+
* <p>Confirms user registration as an admin without using a confirmation code. Works on any
32+
* user.</p>
3233
* <p>Calling this action requires developer credentials.</p>
3334
* @example
3435
* Use a bare-bones client and the command you need to make an API call.

clients/client-cognito-identity-provider/src/commands/AdminCreateUserCommand.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ export interface AdminCreateUserCommandOutput extends AdminCreateUserResponse, _
2929

3030
/**
3131
* <p>Creates a new user in the specified user pool.</p>
32-
* <p>If <code>MessageAction</code> isn't set, the default is to send a welcome message via email or phone (SMS).</p>
33-
*
34-
*
32+
* <p>If <code>MessageAction</code> isn't set, the default is to send a welcome message via
33+
* email or phone (SMS).</p>
3534
*
3635
* <note>
3736
* <p>This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers
@@ -51,10 +50,13 @@ export interface AdminCreateUserCommandOutput extends AdminCreateUserResponse, _
5150
* Developer Guide</i>.</p>
5251
* </note>
5352
*
54-
* <p>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
55-
* user name and temporary password.</p>
56-
* <p>Alternatively, you can call <code>AdminCreateUser</code> with <code>SUPPRESS</code> for the <code>MessageAction</code> parameter, and Amazon Cognito won't send any email. </p>
57-
* <p>In either case, the user will be in the <code>FORCE_CHANGE_PASSWORD</code> state until they sign in and change their password.</p>
53+
* <p>This message is based on a template that you configured in your call to create or
54+
* update a user pool. This template includes your custom sign-up instructions and
55+
* placeholders for user name and temporary password.</p>
56+
* <p>Alternatively, you can call <code>AdminCreateUser</code> with <code>SUPPRESS</code>
57+
* for the <code>MessageAction</code> parameter, and Amazon Cognito won't send any email. </p>
58+
* <p>In either case, the user will be in the <code>FORCE_CHANGE_PASSWORD</code> state until
59+
* they sign in and change their password.</p>
5860
* <p>
5961
* <code>AdminCreateUser</code> requires developer credentials.</p>
6062
* @example

clients/client-cognito-identity-provider/src/commands/AdminDeleteUserAttributesCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface AdminDeleteUserAttributesCommandInput extends AdminDeleteUserAt
2828
export interface AdminDeleteUserAttributesCommandOutput extends AdminDeleteUserAttributesResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Deletes the user attributes in a user pool as an administrator. Works on any user.</p>
31+
* <p>Deletes the user attributes in a user pool as an administrator. Works on any
32+
* user.</p>
3233
* <p>Calling this action requires developer credentials.</p>
3334
* @example
3435
* Use a bare-bones client and the command you need to make an API call.

clients/client-cognito-identity-provider/src/commands/AdminDisableProviderForUserCommand.ts

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,33 @@ export interface AdminDisableProviderForUserCommandOutput
3131

3232
/**
3333
* <p>Prevents the user from signing in with the specified external (SAML or social)
34-
* identity provider. If the user that you want to deactivate is a Amazon Cognito user pools native
35-
* username + password user, they can't use their password to sign in. If the user to
36-
* deactivate is a linked external identity provider (IdP) user, any link between that user
37-
* and an existing user is removed. When the external user signs in again, and the user is
38-
* no longer attached to the previously linked <code>DestinationUser</code>, the user must
39-
* create a new user account. See <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminLinkProviderForUser.html">AdminLinkProviderForUser</a>.</p>
40-
* <p>This action is enabled only for admin access and requires developer credentials.</p>
41-
* <p>The <code>ProviderName</code> must match the value specified when creating an IdP for the pool. </p>
42-
* <p>To deactivate a native username + password user, the <code>ProviderName</code> value must be <code>Cognito</code> and the <code>ProviderAttributeName</code> must be <code>Cognito_Subject</code>.
43-
* The <code>ProviderAttributeValue</code> must be the name that is used in the user pool for the user.</p>
44-
* <p>The <code>ProviderAttributeName</code> must always be <code>Cognito_Subject</code> for social identity providers. The <code>ProviderAttributeValue</code> must always be the exact
45-
* subject that was used when the user was originally linked as a source user.</p>
46-
* <p>For de-linking a SAML identity, there are two scenarios. If the linked identity has not yet been used to sign in, the <code>ProviderAttributeName</code> and <code>ProviderAttributeValue</code>
47-
* must be the same values that were used for the <code>SourceUser</code> when the identities were originally linked using <code> AdminLinkProviderForUser</code> call. (If the linking was done
48-
* with <code>ProviderAttributeName</code> set to <code>Cognito_Subject</code>, the same applies here). However, if the user has already signed in, the <code>ProviderAttributeName</code> must
49-
* be <code>Cognito_Subject</code> and <code>ProviderAttributeValue</code> must be the subject of the SAML assertion.</p>
34+
* identity provider (IdP). If the user that you want to deactivate is a Amazon Cognito user pools
35+
* native username + password user, they can't use their password to sign in. If the user
36+
* to deactivate is a linked external IdP user, any link between that user and an existing
37+
* user is removed. When the external user signs in again, and the user is no longer
38+
* attached to the previously linked <code>DestinationUser</code>, the user must create a
39+
* new user account. See <a href="https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_AdminLinkProviderForUser.html">AdminLinkProviderForUser</a>.</p>
40+
* <p>This action is enabled only for admin access and requires developer
41+
* credentials.</p>
42+
* <p>The <code>ProviderName</code> must match the value specified when creating an IdP for
43+
* the pool. </p>
44+
* <p>To deactivate a native username + password user, the <code>ProviderName</code> value
45+
* must be <code>Cognito</code> and the <code>ProviderAttributeName</code> must be
46+
* <code>Cognito_Subject</code>. The <code>ProviderAttributeValue</code> must be the
47+
* name that is used in the user pool for the user.</p>
48+
* <p>The <code>ProviderAttributeName</code> must always be <code>Cognito_Subject</code> for
49+
* social IdPs. The <code>ProviderAttributeValue</code> must always be the exact subject
50+
* that was used when the user was originally linked as a source user.</p>
51+
* <p>For de-linking a SAML identity, there are two scenarios. If the linked identity has
52+
* not yet been used to sign in, the <code>ProviderAttributeName</code> and
53+
* <code>ProviderAttributeValue</code> must be the same values that were used for the
54+
* <code>SourceUser</code> when the identities were originally linked using <code>
55+
* AdminLinkProviderForUser</code> call. (If the linking was done with
56+
* <code>ProviderAttributeName</code> set to <code>Cognito_Subject</code>, the same
57+
* applies here). However, if the user has already signed in, the
58+
* <code>ProviderAttributeName</code> must be <code>Cognito_Subject</code> and
59+
* <code>ProviderAttributeValue</code> must be the subject of the SAML
60+
* assertion.</p>
5061
* @example
5162
* Use a bare-bones client and the command you need to make an API call.
5263
* ```javascript

clients/client-cognito-identity-provider/src/commands/AdminGetUserCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface AdminGetUserCommandInput extends AdminGetUserRequest {}
2828
export interface AdminGetUserCommandOutput extends AdminGetUserResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Gets the specified user by user name in a user pool as an administrator. Works on any user.</p>
31+
* <p>Gets the specified user by user name in a user pool as an administrator. Works on any
32+
* user.</p>
3233
* <p>Calling this action requires developer credentials.</p>
3334
* @example
3435
* Use a bare-bones client and the command you need to make an API call.

clients/client-cognito-identity-provider/src/commands/AdminInitiateAuthCommand.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export interface AdminInitiateAuthCommandOutput extends AdminInitiateAuthRespons
3030
/**
3131
* <p>Initiates the authentication flow, as an administrator.</p>
3232
*
33-
*
3433
* <note>
3534
* <p>This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers
3635
* require you to register an origination phone number before you can send SMS messages

clients/client-cognito-identity-provider/src/commands/AdminLinkProviderForUserCommand.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,23 @@ export interface AdminLinkProviderForUserCommandInput extends AdminLinkProviderF
2828
export interface AdminLinkProviderForUserCommandOutput extends AdminLinkProviderForUserResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Links an existing user account in a user pool (<code>DestinationUser</code>) to an identity from an external identity provider (<code>SourceUser</code>) based on a specified
32-
* attribute name and value from the external identity provider. This allows you to create a link from the existing user account to an external federated user identity that has not
33-
* yet been used to sign in. You can then use the federated user identity to sign in as the existing user account. </p>
34-
* <p> 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
35-
* identity, they sign in as the existing user account.</p>
36-
* <note>
37-
* <p>The maximum number of federated identities linked to a user is 5.</p>
38-
* </note>
39-
* <important>
40-
* <p>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
41-
* identity providers and provider attributes that have been trusted by the application owner.</p>
42-
* </important>
31+
* <p>Links an existing user account in a user pool (<code>DestinationUser</code>) to an
32+
* identity from an external IdP (<code>SourceUser</code>) based on a specified attribute
33+
* name and value from the external IdP. This allows you to create a link from the existing
34+
* user account to an external federated user identity that has not yet been used to sign
35+
* in. You can then use the federated user identity to sign in as the existing user
36+
* account. </p>
37+
* <p> For example, if there is an existing user with a username and password, this API
38+
* links that user to a federated user identity. When the user signs in with a federated
39+
* user identity, they sign in as the existing user account.</p>
40+
* <note>
41+
* <p>The maximum number of federated identities linked to a user is five.</p>
42+
* </note>
43+
* <important>
44+
* <p>Because this API allows a user with an external federated identity to sign in as
45+
* an existing user in the user pool, it is critical that it only be used with external
46+
* IdPs and provider attributes that have been trusted by the application owner.</p>
47+
* </important>
4348
*
4449
* <p>This action is administrative and requires developer credentials.</p>
4550
* @example

clients/client-cognito-identity-provider/src/commands/AdminListUserAuthEventsCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export interface AdminListUserAuthEventsCommandInput extends AdminListUserAuthEv
2828
export interface AdminListUserAuthEventsCommandOutput extends AdminListUserAuthEventsResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>A history of user activity and any risks detected as part of Amazon Cognito advanced security.</p>
31+
* <p>A history of user activity and any risks detected as part of Amazon Cognito advanced
32+
* security.</p>
3233
* @example
3334
* Use a bare-bones client and the command you need to make an API call.
3435
* ```javascript

clients/client-cognito-identity-provider/src/commands/AdminResetUserPasswordCommand.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ export interface AdminResetUserPasswordCommandInput extends AdminResetUserPasswo
2828
export interface AdminResetUserPasswordCommandOutput extends AdminResetUserPasswordResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Resets the specified user's password in a user pool as an administrator. Works on any user.</p>
32-
* <p>When a developer calls this API, the current password is invalidated, so it must be changed. If a user tries to sign in after the API is called,
33-
* the app will get a PasswordResetRequiredException exception back and should direct the user down the flow to reset the password, which is the same
34-
* as the forgot password flow. In addition, if the user pool has phone verification selected and a verified phone number exists for the user, or if
35-
* 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
36-
* with the code to change their password.</p>
31+
* <p>Resets the specified user's password in a user pool as an administrator. Works on any
32+
* user.</p>
33+
* <p>When a developer calls this API, the current password is invalidated, so it must be
34+
* changed. If a user tries to sign in after the API is called, the app will get a
35+
* PasswordResetRequiredException exception back and should direct the user down the flow
36+
* to reset the password, which is the same as the forgot password flow. In addition, if
37+
* the user pool has phone verification selected and a verified phone number exists for the
38+
* user, or if email verification is selected and a verified email exists for the user,
39+
* calling this API will also result in sending a message to the end user with the code to
40+
* change their password.</p>
3741
*
3842
* <note>
3943
* <p>This action might generate an SMS text message. Starting June 1, 2021, US telecom carriers

clients/client-cognito-identity-provider/src/commands/AdminSetUserMFAPreferenceCommand.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ export interface AdminSetUserMFAPreferenceCommandInput extends AdminSetUserMFAPr
2828
export interface AdminSetUserMFAPreferenceCommandOutput extends AdminSetUserMFAPreferenceResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>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
32-
* 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
33-
* be returned during sign-in.</p>
31+
* <p>The user's multi-factor authentication (MFA) preference, including which MFA options
32+
* are activated, and if any are preferred. Only one factor can be set as preferred. The
33+
* preferred MFA factor will be used to authenticate a user if multiple factors are
34+
* activated. If multiple options are activated and no preference is set, a challenge to
35+
* choose an MFA option will be returned during sign-in.</p>
3436
* @example
3537
* Use a bare-bones client and the command you need to make an API call.
3638
* ```javascript

clients/client-cognito-identity-provider/src/commands/AdminSetUserPasswordCommand.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ export interface AdminSetUserPasswordCommandInput extends AdminSetUserPasswordRe
2828
export interface AdminSetUserPasswordCommandOutput extends AdminSetUserPasswordResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Sets the specified user's password in a user pool as an administrator. Works on any user. </p>
32-
* <p>The password can be temporary or permanent. If it is temporary, the user status enters the <code>FORCE_CHANGE_PASSWORD</code> state. When the user next tries to sign in,
33-
* the InitiateAuth/AdminInitiateAuth response will contain the <code>NEW_PASSWORD_REQUIRED</code> challenge. If the user doesn't sign in before it expires, the user won't be
34-
* able to sign in, and an administrator must reset their password. </p>
35-
* <p>Once the user has set a new password, or the password is permanent, the user status is set to <code>Confirmed</code>.</p>
31+
* <p>Sets the specified user's password in a user pool as an administrator. Works on any
32+
* user. </p>
33+
* <p>The password can be temporary or permanent. If it is temporary, the user status enters
34+
* the <code>FORCE_CHANGE_PASSWORD</code> state. When the user next tries to sign in, the
35+
* InitiateAuth/AdminInitiateAuth response will contain the
36+
* <code>NEW_PASSWORD_REQUIRED</code> challenge. If the user doesn't sign in before it
37+
* expires, the user won't be able to sign in, and an administrator must reset their
38+
* password. </p>
39+
* <p>Once the user has set a new password, or the password is permanent, the user status is
40+
* set to <code>Confirmed</code>.</p>
3641
* @example
3742
* Use a bare-bones client and the command you need to make an API call.
3843
* ```javascript

0 commit comments

Comments
 (0)