question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

An error occurred calling InitiateAuth operation: Unable to verify secret hash for client

See original GitHub issue

Hi,

I’m trying to use the package using the example you provide… but it doen’t work, what I’m doing wrong?

from warrant import Cognito

POOL_ID = 'eu-central-1_J1HZ86xLX'
APP_ID = '23o6vbtasvacvd7f567go7svfk'
USERNAME = 'user1'
PASSWORD = '@perw1fg'
ACCESS_KEY = 'AKIAI5WPBLQZAQFPLGGQ'
SECRET_KEY = '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'

u = Cognito(POOL_ID, APP_ID, username=USERNAME, user_pool_region='eu-central-1')#, access_key=ACCESS_KEY, secret_key=SECRET_KEY)
u.authenticate(password=PASSWORD)

The settings are fake 😉

The error message is the following:

Traceback (most recent call last):
  File "./warrant-test.py", line 20, in <module>
    tokens = aws.authenticate_user()
  File "/usr/local/lib/python2.7/site-packages/warrant/aws_srp.py", line 187, in authenticate_user
    ClientId=self.client_id
  File "/Users/m2tz/Library/Python/2.7/lib/python/site-packages/botocore/client.py", line 253, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/Users/m2tz/Library/Python/2.7/lib/python/site-packages/botocore/client.py", line 557, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.NotAuthorizedException: An error occurred (NotAuthorizedException) when calling the InitiateAuth operation: Unable to verify secret hash for client 23o6vbtasvacvd7f567go7svfk

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
RaydelMirandacommented, Jan 9, 2018

Please, update the documentation, it would be nice know about this at the “Getting started” stage.

0reactions
kushan-gunasekeracommented, Jun 13, 2019

Try this answer which I posted in stackoverflow. It mention how to create SECRET_HASH in python without uncheck Generate client secret when creating an app.

solution - https://stackoverflow.com/questions/37438879/unable-to-verify-secret-hash-for-client-in-amazon-cognito-userpools/56581239#56581239

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve Amazon Cognito “Unable to verify secret hash for ...
When a user pool app client is configured with a client secret in the user pool, a SecretHash value is required in the...
Read more >
Unable to verify secret hash for client in ... - Stack Overflow
But I always get error saying "Error: Unable to verify secret hash for client 4b*******fd". Here is code: AWS.config.region = 'us-east-1'; // Region...
Read more >
Unable to verify Secret Hash For Client AWS Error | bobbyhadz
The "Unable to verify Secret Hash for Client" error occurs in Cognito and Amplify requests when the App client of a User pool...
Read more >
Unable to verify secret hash for client _xxxxxxxxx_ [#3211026]
Problem/Motivation 1. Installed Cognito on a D8.9.14 site. 2. Set up my settings.php file. 3. use a user/password pair from cognito (never ...
Read more >
TIP: Using AWS Cognito User pool for API Authorization
An error occurred (NotAuthorizedException) when calling the InitiateAuth operation: Unable to verify secret hash for client.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found