0

I am trying to set up oauth2-server to set up GitHub authentication before reaching my code-server. I am using Nginx and Cert bot to deploy the server.

This is what I have configured in Nginx to connect to the oauth2-proxy

location / {
   proxy_pass http://127.0.0.1:4180;
   proxy_set_header Host $host;
   proxy_set_header X-Real-IP $remote_addr;
   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
   proxy_set_header X-Forwarded-Proto $scheme;
}

The site example.tld successfully loads and allows the user to authenticate with GitHub, but then throw a redirect_uri_mismatch error, and I'm unsure why.

This is what I have configured in my oauth2-proxy config

client_id = "12345"
client_secret = "secret"
cookie_secret = "secret"
redirect_url = "http://127.0.0.1:4180/oauth2/callback/"
upstreams = ["http://127.0.0.1:8080/"]
cookie_secure = true
provider = "github"
proxy_websockets = true
github_repo = "repo"
reverse_proxy = true
email_domains = "*"

If anybody could help me pinpoint the problem and help me correct it, that would be appreciated. Thank you in advance!

djdomi
  • 1,599
  • 3
  • 12
  • 19
foureal
  • 1
  • 2

0 Answers0