From 4865cfaa77a769b21f1aac88f750afd7a9fb3e25 Mon Sep 17 00:00:00 2001 From: Steven Kang Date: Mon, 17 Jul 2017 14:14:07 -0700 Subject: [PATCH] Allows developers to configure user pools for email/phone based signup and sign-in. --- .../cognito-idp-2016-04-18.normal.json | 30 +++++++++-- .../Model/AdminInitiateAuthRequest.cs | 4 +- .../Generated/Model/CreateUserPoolRequest.cs | 20 ++++++++ .../Generated/Model/InitiateAuthRequest.cs | 6 +-- ...inResetUserPasswordResponseUnmarshaller.cs | 12 +++++ .../CreateUserPoolRequestMarshaller.cs | 11 ++++ .../UserPoolTypeUnmarshaller.cs | 6 +++ .../Generated/Model/UserPoolType.cs | 20 ++++++++ .../Generated/ServiceEnumerations.cs | 50 +++++++++++++++++++ .../AmazonCognitoIdentityProviderClient.cs | 14 ++++++ .../_bcl35/IAmazonCognitoIdentityProvider.cs | 14 ++++++ .../AmazonCognitoIdentityProviderClient.cs | 14 ++++++ .../_bcl45/IAmazonCognitoIdentityProvider.cs | 14 ++++++ 13 files changed, 206 insertions(+), 9 deletions(-) diff --git a/generator/ServiceModels/cognito-idp/cognito-idp-2016-04-18.normal.json b/generator/ServiceModels/cognito-idp/cognito-idp-2016-04-18.normal.json index 057e253e1561..154cef31d3bb 100644 --- a/generator/ServiceModels/cognito-idp/cognito-idp-2016-04-18.normal.json +++ b/generator/ServiceModels/cognito-idp/cognito-idp-2016-04-18.normal.json @@ -320,6 +320,9 @@ {"shape":"TooManyRequestsException"}, {"shape":"LimitExceededException"}, {"shape":"UserNotFoundException"}, + {"shape":"InvalidSmsRoleAccessPolicyException"}, + {"shape":"InvalidEmailRoleAccessPolicyException"}, + {"shape":"InvalidSmsRoleTrustRelationshipException"}, {"shape":"InternalErrorException"} ], "documentation":"

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

When a developer calls this API, the current password is invalidated, so it must be changed. If a user tries to sign in after the API is called, the app will get a PasswordResetRequiredException exception back and should direct the user down the flow to reset the password, which is the same as the forgot password flow. In addition, if the user pool has phone verification selected and a verified phone number exists for the user, or if email verification is selected and a verified email exists for the user, calling this API will also result in sending a message to the end user with the code to change their password.

Requires developer credentials.

" @@ -1872,11 +1875,11 @@ }, "AuthFlow":{ "shape":"AuthFlowType", - "documentation":"

The authentication flow for this call to execute. The API action will depend on this value. For example:

Valid values include:

" + "documentation":"

The authentication flow for this call to execute. The API action will depend on this value. For example:

Valid values include:

" }, "AuthParameters":{ "shape":"AuthParametersType", - "documentation":"

The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow:

" + "documentation":"

The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow:

" }, "ClientMetadata":{ "shape":"ClientMetadataType", @@ -2829,6 +2832,10 @@ "shape":"AliasAttributesListType", "documentation":"

Attributes supported as an alias for this user pool. Possible values: phone_number, email, or preferred_username.

" }, + "UsernameAttributes":{ + "shape":"UsernameAttributesListType", + "documentation":"

Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.

" + }, "SmsVerificationMessage":{ "shape":"SmsVerificationMessageType", "documentation":"

A string representing the SMS verification message.

" @@ -3692,11 +3699,11 @@ "members":{ "AuthFlow":{ "shape":"AuthFlowType", - "documentation":"

The authentication flow for this call to execute. The API action will depend on this value. For example:

Valid values include:

ADMIN_NO_SRP_AUTH is not a valid value.

" + "documentation":"

The authentication flow for this call to execute. The API action will depend on this value. For example:

Valid values include:

ADMIN_NO_SRP_AUTH is not a valid value.

" }, "AuthParameters":{ "shape":"AuthParametersType", - "documentation":"

The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow:

" + "documentation":"

The authentication parameters. These are inputs corresponding to the AuthFlow that you are invoking. The required values depend on the value of AuthFlow:

" }, "ClientMetadata":{ "shape":"ClientMetadataType", @@ -5471,6 +5478,10 @@ "shape":"AliasAttributesListType", "documentation":"

Specifies the attributes that are aliased in a user pool.

" }, + "UsernameAttributes":{ + "shape":"UsernameAttributesListType", + "documentation":"

Specifies whether email addresses or phone numbers can be specified as usernames when a user signs up.

" + }, "SmsVerificationMessage":{ "shape":"SmsVerificationMessageType", "documentation":"

The contents of the SMS verification message.

" @@ -5572,6 +5583,17 @@ }, "documentation":"

The user type.

" }, + "UsernameAttributeType":{ + "type":"string", + "enum":[ + "phone_number", + "email" + ] + }, + "UsernameAttributesListType":{ + "type":"list", + "member":{"shape":"UsernameAttributeType"} + }, "UsernameExistsException":{ "type":"structure", "members":{ diff --git a/sdk/src/Services/CognitoIdentityProvider/Generated/Model/AdminInitiateAuthRequest.cs b/sdk/src/Services/CognitoIdentityProvider/Generated/Model/AdminInitiateAuthRequest.cs index 152613bd32fc..e8cdd1bc9267 100644 --- a/sdk/src/Services/CognitoIdentityProvider/Generated/Model/AdminInitiateAuthRequest.cs +++ b/sdk/src/Services/CognitoIdentityProvider/Generated/Model/AdminInitiateAuthRequest.cs @@ -57,7 +57,7 @@ public partial class AdminInitiateAuthRequest : AmazonCognitoIdentityProviderReq /// ///
  • /// - /// USER_SRP_AUTH will take in USERNAME and SRPA + /// USER_SRP_AUTH will take in USERNAME and SRP_A /// and return the SRP variables to be used for next challenge execution. /// ///
  • @@ -105,7 +105,7 @@ internal bool IsSetAuthFlow() /// /// /// @@ -97,7 +97,7 @@ internal bool IsSetAuthFlow() /// ///