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

ssl via proxy #149

Closed
mithereal opened this issue Feb 17, 2020 · 3 comments
Closed

ssl via proxy #149

mithereal opened this issue Feb 17, 2020 · 3 comments

Comments

@mithereal
Copy link

hello i am trying to use pow_assent to auth via google
i have a phx umbrella app behind nginx doing a proxypass xxx.com to localhost:4433
ssl all works as well as logging in with pow until i try to do the google auth, where it gives an error about the callback url
i beleive this is due to how pow assent is getting the endpoint url in my case it is appending the port to the callback url and failing
ie. The redirect URI in the request, https://xxx.com:4433/auth/google/callback, does not match the ones authorized for the OAuth client. i can see the request url varible has the port, how can i remove the port and complete google auth.

@alukito
Copy link

alukito commented Feb 18, 2020

Hi, you need to change the config of your endpoint, there are two entries which contain port, the http or https key which is the binding port and the url key which is your advertised port. For OAuth, you need to adjust the port in the url key. For example:

config :your_app, YourAppWeb.Endpoint,
  url: [
    host: xxx.com
    port: 443,
    scheme: "https"
  ],
  http: [:inet6, port: 4433],
  secret_key_base: <yoursecretkey>

Edit: This is phoenix config, not pow_assent.

@danschultzer
Copy link
Collaborator

@alukito is correct, the URL generator in the Phoenix endpoint has to be configured. Adding the port should fix the issue.

Ref #147

@crockwave
Copy link

This solved my issue, with the prod.exs being the file that needed editing in a Phoenix Liveview project. It would be nice to have this info in the docs.

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

4 participants