title: Unable to verify secret hash for client in Amazon Cognito Userpools
body: <p>I am stuck at "Amazon Cognito Identity user pools" process. </p>
  
  <p>I tried all possible codes for authenticating user in cognito userpools. But I always get error saying <strong>"Error: Unable to verify secret hash for client 4b*******fd".</strong></p>
  
  <p>Here is code:</p>
  
  <pre><code>AWS.config.region = 'us-east-1'; // Region
  AWS.config.credentials = new AWS.CognitoIdentityCredentials({
      IdentityPoolId: 'us-east-1:b64bb629-ec73-4569-91eb-0d950f854f4f'
  });
  
  AWSCognito.config.region = 'us-east-1';
  AWSCognito.config.credentials = new AWS.CognitoIdentityCredentials({
      IdentityPoolId: 'us-east-1:b6b629-er73-9969-91eb-0dfffff445d'
  });
  
  AWSCognito.config.update({accessKeyId: 'AKIAJNYLRONAKTKBXGMWA', secretAccessKey: 'PITHVAS5/UBADLU/dHITesd7ilsBCm'})
  
  var poolData = { 
      UserPoolId : 'us-east-1_l2arPB10',
      ClientId : '4bmsrr65ah3oas5d4sd54st11k'
  };
  var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
  
  var userData = {
       Username : 'ronakpatel@gmail.com',
       Pool : userPool
  };
  
  var cognitoUser = new AWSCognito.CognitoIdentityServiceProvider.CognitoUser(userData);
  
  cognitoUser.confirmRegistration('123456', true,function(err, result) {
  if (err) {
      alert(err);
      return;
  }
  console.log('call result: ' + result);
  });
  </code></pre>