I am trying to use google authentication on my application. And it does work fine on my localhost and I can login by my google account.
However after I deploy the application on aws Elastic beanstalk, the google authentication show the error page as: error 400: redirect_uri_mismatch and I click more information it showed: redirect_uri: http://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize.
I have then go to google cloud platform and add one more Authorised redirect URIs as: https://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize but I am still failed to login by google on elastic beanstalk deployment url.
Could someone help me out this? Thanks so much.
The redirect uri must exactly match the one you have registered in Google developer console.
If it says your system is sending
http://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize.
Then you need to register that.
However you have registered https://myapplication-env.eba-g8xxcswz.us-east-1.elasticbeanstalk.com/authorize
instead. Which is https. It must match exactly.
So either fix your app so its running on https or add the http redirect uri. Note probably wont be able to set this in production or verify the app if its running http.