Search code examples
amazon-cognitoaws-amplify

Amplify "Unable to verify secret hash for client"


We have been using Amplify and Cognito to register our users for an Angular6 application deployed to Lambda. The client wanted to transition from email to username as primary user identification. So we created a new user pool / client. I don't have visibility into the configuration settings, I was simply given new user pool, identity pool, and client id's. Then I changed the code for application signup to look like this:

  return from(Auth.signUp({
  'username': username, // was email
  'password': password, 
  attributes: { // added these
    'email': email,
    'phone_number': phone_number,
    'family_name': name,
    'birthdate': DOB,
    'custom:last_4_ssn': SSN // custom attribute
  }}));

The response I'm getting with no other changes made is: Unable to verify secret hash for client. Google claims the problem is that secretAccess is currently an unsupported configuration, but the guy who has access to these services swears to me that nowhere is secretAccess configured in our setup.

I apologize for not having access to the configuration, but is there any other possible reason to receive this error?


Solution

  • That error is probably originating from the fact that the app client you are connected to has an associated secret key. When you create a user pool app client, it generates a secret by default: enter image description here

    Right now, with React-Native Amplify you have to use an app client that does not have a secret key generated. So when you create a new app client with your desired attributes, make sure the "Generate client secret" box is unchecked.