Search code examples
google-cloud-platformamazon-cognito

Getting Error 400: redirect_uri_mismatch in cognito idp settings


I am following this cognito add social auth to add google auth into one of my app for testing. Completed all steps as listed, but when I am testing that using this https://<your_user_pool_domain>/login?response_type=code&client_id=<your_client_id>&redirect_uri=https://www.example.com , I am getting an error

Error 400: redirect_uri_mismatch
The redirect URI in the request, https://xxxx-xxxx.auth.ap-south-1.amazoncognito.com/oauth2/idpresponse, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit:

initially the redirect uri and callback url in cognito app client settings were different but i changed those, also I tried changing my redirect url to simple https://google.com, but still not working. I did some research regarding the same, found out that it might take some time to reflect the changes in google oauth setings, its been 2 hrs since I have changed the same, should I wait or is there some other work around this. Also, I setup facebook login following same doc, it is working fine. please help!


Solution

  • Finally I got the solution, redirect url in google auth credentials needs to be your **domainName+/oauth2/idpresponse** .