Skip to content
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

Assistance with OAuth 2.0 Configuration for Local Development #206

Closed
KevinCotoCarrera opened this issue Jan 20, 2024 · 2 comments
Closed

Comments

@KevinCotoCarrera
Copy link

KevinCotoCarrera commented Jan 20, 2024

Subject of the issue

Trouble configuring OAuth 2.0 for local development environment on http://localhost:3001

Expected behaviour

Being able to select my google account

Actual behaviour

Blank page in url: https://accounts.google.com/gsi/select?client_id=${my_client_id}apps.googleusercontent.com&ux_mode=popup&ui_mode=card&as=VdS0KEGuH3aPP%2FPwN9lsmA&channel_id=ccf306d44944a42f7f4461300dcb735c9ff16595c89724babb7f8c53757c9224&origin=http%3A%2F%2Flocalhost%3A3001

Additional context

I am currently developing a web application using this boilerplate running on localhost:3001. I have set up my Google Cloud OAuth 2.0 client IDs correctly, but when I try to authenticate using Google's OAuth service, it does not work as expected. Here's how I've configured my OAuth credentials in the Google Cloud Console:

  • Authorized JavaScript origins: http://localhost:3001
  • Authorized redirect URIs: http://localhost:3001

Despite this configuration, I am facing issues with the authentication flow. I have checked the following:

  • The application is running on the correct port and uses the http protocol.
  • The client ID is correctly inserted into the code.
  • The redirect URIs in Google Cloud Console appear to be correctly configured.
  • Browser cache has been cleared, and I've also tried using an incognito window.

I am following the example provided in [link to the example or documentation].

Could you please provide some guidance on what might be going wrong or any additional steps I need to take for local development setup?

@Shchepotin
Copy link
Collaborator

@KevinCotoCarrera please try to add http://localhost to authorized JavaScript origins. Like here:

image

More info here: https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid#get_your_google_api_client_id

image

@KevinCotoCarrera
Copy link
Author

Hey @Shchepotin
Apologies for the late reply, work has had me tied up.

I wanted to let you know I tried your suggestion on the GitHub issue when I could and it worked out great. Really appreciate the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants