espressif / esp-rainmaker-android

ESP RainMaker Android app sources
https://rainmaker.espressif.com/
Apache License 2.0
95 stars 55 forks source link

[HELP] Cannot log-in, possible Amazon Cognito setup issue #2

Closed meltdown03 closed 3 years ago

meltdown03 commented 3 years ago

I followed the README file and setup an Amazon Cognito User Pool. (I used the default options for it.) I also created the App Client so I have the 3 required pieces of information according to the README. I successfully built the Android App in AndroidStudio and loaded it onto my phone. I get this error when attempting to login:

Sign-in failed Unable to verify secret hash for client

Screenshot_20201110-182702_ESP RainMaker

Can you please provide more info on the Amazon Cognito side of the configuration? Also, will I be able to login with my normal email/password or am I required to use a new one that is also in Cognito?

KhushbuShah25 commented 3 years ago

Hi @meltdown03 ,

Try with below configuration.

"aws_region" --> ""
"user_pool_id" --> "us-east-1_kWz4M6MfD"
"client_id" --> "60i6kac5f9rjuetqnq5mnmaqv6"
meltdown03 commented 3 years ago

Your config did let me log in though. I must have something set up wrong with Amazon Cognito. Could you tell me what you changed from the default values when you set up your pool? Like URLs, App Client, and Authorization settings.

meltdown03 commented 3 years ago

I recreated the app client and unchecked "Generate secret key". I no longer get the the error as in the OP. I now get "Incorrect username or password". If I signup a new user, that user works. It's not forwarding or linking to the ESP-Rainmakers user database, just making it's own. How did you @khushbushah2302 get it setup in Cognito to do that?

meltdown03 commented 3 years ago

I'm assuming you gave me the pool_id and app_client_id that all users use so I'm closing this issue. I now realize that I can make my own User Pool if I want.

shahpiyushv commented 3 years ago

@meltdown03 , I think there is some confusion here. The phone apps and CLI for ESP RainMaker will work with only one specific Cognito User Pool we have created in our RainMaker backend (and which @khushbushah2302 has mentioned above). Any other cognito user pool will not work. I may be wrong in my own understanding of the issue, so do let me know accordingly.

meltdown03 commented 3 years ago

@meltdown03 , I think there is some confusion here. The phone apps and CLI for ESP RainMaker will work with only one specific Cognito User Pool we have created in our RainMaker backend (and which @khushbushah2302 has mentioned above). Any other cognito user pool will not work. I may be wrong in my own understanding of the issue, so do let me know accordingly.

Yes, that is how it works as I understand. You can make your own User Pool if you want, otherwise, use the info from @khushbushah2302 to use the normal pool from Espressif.