Amplify/Cognito oauth federated sign-in (Google) ,does not show popup, instead redirects in the same page

Viewed 418

We are using Cognito with Google as the identity provider.

On the client side, we are using Amplify to sign-in sign-out etc.

During the sign in, I call the Amplify federatedSignIn method with the provider as 'Google'"

Something like this:

Auth.federatedSignIn({ provider: "Google" });

This redirects to the google email picker page (oauth). I was expecting a popup instead of redirecting in the same page.

Is this a client configuration problem in Google Cloud Platform? How would I be able to get a popup instead of redirecting in the same page?

Something to note: This happens on the Hosted UI too.

1 Answers

There are a few things can go wrong here :

1/ You may have to clear cache and hard reload to try it again

2/ Authorised JavaScript origins URL need to be corrected like

https://frei.dswswc5n7bb6c.amplifyapp.com

and

http://localhost:3000

3/ Authorised redirect URIs also need to be corrected

https://{your-domain-name}.auth.{your-aws-region}.amazoncognito.com/oauth2/idpresponse

4/ You have to make sure both User Pool and Identity Pool are configured correctly using the credentials above

Related