AdminConfirmSignUp
Confirms user sign-up as an administrator.
Unlike ConfirmSignUp, your IAM credentials authorize this operation to confirm user accounts. 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.
Note
Amazon Cognito evaluates AWS 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.
To configure your user pool to require administrative confirmation of users, set
AllowAdminCreateUserOnly
to true
in a
CreateUserPool
or UpdateUserPool
request.
Request Syntax
{
"ClientMetadata": {
"string
" : "string
"
},
"Username": "string
",
"UserPoolId": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- ClientMetadata
-
A map of custom key-value pairs that you can provide as input for any custom workflows that this action triggers.
If your user pool configuration includes triggers, the AdminConfirmSignUp API action invokes the AWS Lambda function that is specified for the post confirmation trigger. When Amazon Cognito invokes this function, it passes a JSON payload, which the function receives as input. In this payload, the
clientMetadata
attribute provides the data that you assigned to the ClientMetadata parameter in your AdminConfirmSignUp request. In your function code in Lambda, you can process the ClientMetadata value to enhance your workflow for your specific needs.For more information, see Using Lambda triggers in the Amazon Cognito Developer Guide.
Note
When you use the
ClientMetadata
parameter, note that Amazon Cognito won't do the following:-
Store the
ClientMetadata
value. This data is available only to AWS Lambda triggers that are assigned to a user pool to support custom workflows. If your user pool configuration doesn't include triggers, theClientMetadata
parameter serves no purpose. -
Validate the
ClientMetadata
value. -
Encrypt the
ClientMetadata
value. Don't send sensitive information in this parameter.
Type: String to string map
Key Length Constraints: Minimum length of 0. Maximum length of 131072.
Value Length Constraints: Minimum length of 0. Maximum length of 131072.
Required: No
-
- Username
-
The name of the user that you want to query or modify. The value of this parameter is typically your user's username, but it can be any of their alias attributes. If
username
isn't an alias attribute in your user pool, this value must be thesub
of a local user or the username of a user from a third-party IdP.Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
[\p{L}\p{M}\p{S}\p{N}\p{P}]+
Required: Yes
- UserPoolId
-
The ID of the user pool where you want to confirm a user's sign-up request.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 55.
Pattern:
[\w-]+_[0-9a-zA-Z]+
Required: Yes
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalErrorException
-
This exception is thrown when Amazon Cognito encounters an internal error.
- message
-
The message returned when Amazon Cognito throws an internal error exception.
HTTP Status Code: 500
- InvalidLambdaResponseException
-
This exception is thrown when Amazon Cognito encounters an invalid AWS Lambda response.
- message
-
The message returned when Amazon Cognito throws an invalid AWS Lambda response exception.
HTTP Status Code: 400
- InvalidParameterException
-
This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
- message
-
The message returned when the Amazon Cognito service throws an invalid parameter exception.
- reasonCode
-
The reason code of the exception.
HTTP Status Code: 400
- LimitExceededException
-
This exception is thrown when a user exceeds the limit for a requested AWS resource.
- message
-
The message returned when Amazon Cognito throws a limit exceeded exception.
HTTP Status Code: 400
- NotAuthorizedException
-
This exception is thrown when a user isn't authorized.
- message
-
The message returned when the Amazon Cognito service returns a not authorized exception.
HTTP Status Code: 400
- ResourceNotFoundException
-
This exception is thrown when the Amazon Cognito service can't find the requested resource.
- message
-
The message returned when the Amazon Cognito service returns a resource not found exception.
HTTP Status Code: 400
- TooManyFailedAttemptsException
-
This exception is thrown when the user has made too many failed attempts for a given action, such as sign-in.
- message
-
The message returned when Amazon Cognito returns a
TooManyFailedAttempts
exception.
HTTP Status Code: 400
- TooManyRequestsException
-
This exception is thrown when the user has made too many requests for a given operation.
- message
-
The message returned when the Amazon Cognito service returns a too many requests exception.
HTTP Status Code: 400
- UnexpectedLambdaException
-
This exception is thrown when Amazon Cognito encounters an unexpected exception with AWS Lambda.
- message
-
The message returned when Amazon Cognito returns an unexpected Lambda exception.
HTTP Status Code: 400
- UserLambdaValidationException
-
This exception is thrown when the Amazon Cognito service encounters a user validation exception with the AWS Lambda service.
- message
-
The message returned when the Amazon Cognito service returns a user validation exception with the Lambda service.
HTTP Status Code: 400
- UserNotFoundException
-
This exception is thrown when a user isn't found.
- message
-
The message returned when a user isn't found.
HTTP Status Code: 400
Examples
Example
The following example operation confirms sign-up for the user "testuser." Note that because this is an administrative API operation, no confirmation code is required.
Sample Request
POST HTTP/1.1
Host: cognito-idp.us-west-2.amazonaws.com
X-Amz-Date: 20230613T200059Z
Accept-Encoding: gzip, deflate, br
X-Amz-Target: AWSCognitoIdentityProviderService.AdminConfirmSignUp
User-Agent: <UserAgentString>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature>
Content-Length: <PayloadSizeBytes>
{
"UserPoolId": "us-west-2_EXAMPLE",
"Username": "testuser"
}
Sample Response
HTTP/1.1 200 OK
Date: Tue, 13 Jun 2023 20:00:59 GMT
Content-Type: application/x-amz-json-1.0
Content-Length: <PayloadSizeBytes>
x-amzn-requestid: a1b2c3d4-e5f6-a1b2-c3d4-EXAMPLE11111
Connection: keep-alive
{}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: