Amazon-cognito-identity-js: Error: Unable to verify secret hash for client

Created on 20 Jan 2017  路  4Comments  路  Source: amazon-archives/amazon-cognito-identity-js

Using https://github.com/aws/amazon-cognito-identity-js/tree/master/examples/babel-webpack

$ cat src/config.js
export default {
  region: 'ap-northeast-2',
  IdentityPoolId: 'ap-northeast-2:f27e4c2b-219f-46d6-9831-88ba7f4341a0',
  UserPoolId: 'ap-northeast-2_3m64mS9ch',
  ClientId: '37tdsno2jkaiu9585hdon8qaa6',
}

Error: Unable to verify secret hash for client 37tdsno2jkaiu9585hdon8qaa6 is what I see when I try authenticate.

https://s.natalian.org/2017-01-20/1484885208_1278x1393.png

What am I missing?

Most helpful comment

@jbailey2010 Could you please give more information about why secret is not implemented in sdk? Is it not required? I am talking about nodeJS, not about browser JS

All 4 comments

Hi,

Per the docs, the javascript SDK doesn't support apps with a client secret. You can un-check that box through the user pool page in the cognito console.

@jbailey2010 Could you please give more information about why secret is not implemented in sdk? Is it not required? I am talking about nodeJS, not about browser JS

if not using the JS SDK which does not work with app client secrets, It appears we need to run a hashing function on the app client secret. Amazon support provided me with this link for how to do it in Java: http://docs.aws.amazon.com/cognito/latest/developerguide/signing-up-users-in-your-app.html#cognito-user-pools-computing-secret-hash

I am also using cognito on nodejs, I am also having difficulty adding a secret to my server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

carlnordenfelt picture carlnordenfelt  路  5Comments

magnattic picture magnattic  路  5Comments

hscheckenbacher picture hscheckenbacher  路  5Comments

sarah-pixvana picture sarah-pixvana  路  4Comments

guyb1 picture guyb1  路  4Comments