Resolve Amazon Cognito - Unable To Verify Secret Hash For Client" Error - AWS Re - Post
Resolve Amazon Cognito - Unable To Verify Secret Hash For Client" Error - AWS Re - Post
Ask question
/ Knowledge Center /
How do I troubleshoot "Unable to verify secret hash for client" errors from my Amazon Cognito user pools API?
When I try to access my Amazon Cognito user pools API, I get an "Unable to verify secret
FEEDBACK
Resolution
When you configure your user pool app client as a client secret, you must include a secret
hash value in the API's query parameter. If you don't include a secret hash value, then
Amazon Cognito returns an Unable to verify secret hash for client error.
To resolve the issue, calculate the secret hash value. Then, include the value when you
invoke Amazon Cognito APIs that accept secret hash, such as InitiateAuth or
ForgotPassword.
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI)
commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're
using the most recent AWS CLI version.
App client ID
2. Save the following example Python script as a .py file. For example, you can save the
file as secret_hash.py. The following script uses the application client secret as the
key and the SHA256 hash function to show the calculation of an HMAC digest:
Note: Replace username with the username of the user that's in the user pool. Also,
replace app_client_id with your user pool's app client ID and key with your app
client's secret.
Note: If you're running a version of Python that's earlier than Python 3.0, then
replace python3 with python. Replace secret_hash.py with your file name,
username with the user pool username, app_client_id with your app client ID, and
app_client_secret with your app client's secret.
"AuthenticationResult": {
"AccessToken": "<HIDDEN>",
"ExpiresIn": 3600,
"TokenType":
"Bearer",
"RefreshToken": "<HIDDEN>",
"IdToken": "<HIDDEN>"
}
}
Note: Replace username with your username and secret-hash with your secret hash
value.
{
"CodeDeliveryDetails": {
"Destination": "+***********",
"DeliveryMedium": "SMS",
"AttributeName": "phone_number"
}
}
Follow Share
Topics
Tags
Amazon Cognito
Language
English
AWS OFFICIAL
No comments
Clear
Post comment
Relevant content
perage
asked a year ago
Unable to configure Application Load Balancer using Cognito client App which has no secret
ACCEPTED ANSWER
Jacko
asked 2 years ago
ACCEPTED ANSWER
cao95
asked a year ago
ACCEPTED ANSWER
LorenzoVILLARD
asked 2 years ago
rePost-User-2948449
asked 3 years ago
How do I troubleshoot an "Invalid Refresh Token" error from my Amazon Cognito user pool API?
AWS OFFICIAL
How do I troubleshoot "401 Unauthorized" errors from an API Gateway REST API endpoint after
I've set up an Amazon Cognito user pool?
AWS OFFICIAL
How to setup cross-account Cognito User Pool migration with the Migrate User Lambda Trigger
EXPERT
Mitchell Tennison
published 8 months ago
re:Post
Community Guidelines