-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
passport-google-oauth20 passport.authenticate doesn't run #989
Comments
This doesn't seem to be a passport issue. It seems like you are not configuring your oauth callback properly, since you said the code works in your dev environment but not production. |
But I only changed the environment variables used locally to the ones used for the online website, without modifying any other code. Moreover, the Google OAuth API settings are also directed to the corresponding URL. |
The docs explain it. |
|
I have solved the issue. My Passport Google OAuth 2.0 is not the problem. The issue lies in the deployment on CloudFront, where the cache is not accepting the req.query parameters. This caused an error in the redirected route as it couldn't retrieve the code parameter. Still, thank you very much for your help.
|
I have the same problem with you. How do you solve that ? |
|
can you tell how you figure that issue and resolve exactly i have same problem my google oauth working in development but not in production |
When I visit the Google oauth authentication page:
My passport about Google oauth authentication strategy:
redirect page:
When I use Google authentication with localhost:5000 as the backend server, it successfully redirects to the specified page after selecting the authentication account in Google. However, when I upload the frontend of the website to AWS S3 and configure it with CloudFront, and upload the backend to a public EC2 and also configure it with CloudFront, and access the backend server through the HTTPS link generated by CloudFront, the callback function (accessToken, refreshToken, profile, done) => {...} in Google authentication is not executed on the backend server hosted on CloudFront. Instead, the response header redirects to the authentication page: https://accounts.google.com/o/oauth2/v2/auth...
Should I adjust the backend code, Google OAuth settings, or AWS configuration
to successfully execute the authentication process?
The text was updated successfully, but these errors were encountered: