Search code examples
javascriptjavaamazon-ec2google-oauth

Google OAuth signin redirecturl AWS


I'm trying to use Google OAuth for an application I deployed on AWS cloud. I have created the OAuth credentials and generated the client id.

I add the Authorized JavaScript origins as localhost, which works fine. However, after I add deploy my application on AWS, it doesn't work. I have also added the Authorized JavaScript origins as http://ec2-xxx-xx-xxx-xx.compute-1.amazonaws.com.

It gives me the below error: enter image description here

Can someone help me figure it out?


Solution

  • I find that Google OAuth doesn't support redirect to dynamical url

    http://ec2-xxx-xx-xxx-xx.compute-1.amazonaws.com

    we have to give a static DNS name.