I'm an AWS noob and I'm having some issues getting started with user authentication on my app. I'm working on a simple web app and I got started using the awsmobile cli and the aws-amplify tools.
I created a new project on the mobile hub and was able to succesfully sign up, validate and sign in users, however the default user pool created by the mobile hub enforces for the username to be used. There no real good use for a username in my app and ultimately i would like to only use the email address, first name and last name as required fields for creating accounts.
I found an Answer from a member of the AWS developer experience, I followed the recommended steps but I am now having issues signing in as the requests are rejected due to an error whilst calculating the hash from the client secret.
"Unable to verify secret hash for client ***********************6pl"
After deleting the old user pool, I am now getting a No userPool
error which makes sense as It looks like the new user pool has not been associated with the identity pool.
On the user resources view of the mobile hub I can still see the Old User pool (Even-though I deleted it). And I have updated the authentication providers to match the client Id and details from the new user pool.
On my client, I manually modified the backend-details.json
file to match the new user pool, and also the aws-exports.js
file. Pushing the changes through the console using awsmobile push
does not seem to work as it pulls down the details from the old user pool.
Any ideas on what I am doing wrong?
The error Unable to verify secret hash for client
could be caused by enabling Generate Client Secret
when creating a User Pool App. At this time the Javascript SDK does not support Apps with a Client Secret. To disable this feature, uncheck the Generate client secret
checkbox when creating an App in the Create a user pool form inside Cognito.
The No userPool
error could be attributed to the aws-exports.js
file not containing the value of your new user pool. I would modify the file to include the new Pool ID. At this time Mobile Hub does not support using an existing User Pool, so when you push your changes through the console you will still only get the details from your Mobile Hub created User Pool.
Let me know if this helps solve your problem. Like Andrew said, we have had several customers request being able to re-use their Cognito User Pool and Cognito Identity Pool, so we are working on prioritizing those requests.
Sincerely,
Dan G
AWS Mobile Developer Experience