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

Unable to deploy Google OAuth on herokuapp.com #199

Open
arjunv27 opened this issue Mar 4, 2020 · 1 comment
Open

Unable to deploy Google OAuth on herokuapp.com #199

arjunv27 opened this issue Mar 4, 2020 · 1 comment

Comments

@arjunv27
Copy link

arjunv27 commented Mar 4, 2020

PROBLEM

Google OAuth requires authentication with an authorized domain list to run outside of localhost. herokuapp.com is not an authorized domain

Potential soltutions:

  • FSA runs internal OAuth server using docker and Ory Hydra
  • FSA grants ability to deploy on fullstackacademy.com
@collin
Copy link
Contributor

collin commented Mar 17, 2020

I looked into this and it is a doozy.

First step was I needed to go to the google client edit page and add the full redirect uri:

I still ran into errors, it turns out the instructions in boilermaker for the redirect uri are to set:

heroku config:set GOOGLE_CALLBACK=/auth/google/callback

With this setting passport will helpfully construct a full url based on the incoming request url.

Which unfortunately in heroku the incoming url is an http:// url as somewhere inside their infrastructure they proxy the external https:// protocol to an unencrypted message.

So the heroku configuration MUST be set to the actual external url.

heroku config:set GOOGLE_CALLBACK=https://gentle-peak-69446.herokuapp.com/auth/google/callback

As far as I can tell this works (deployed at https://gentle-peak-69446.herokuapp.com/) and we should update our materials to cover this twisty maze.

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