Open hulbert opened 8 years ago
Apologies for bumping but wondering if anyone has ideas on this? Or a replicable Github config for 2.0.1?
Try removing
scope = "user:email,read:org"
The scopes should be setup automatically.
https://github.com/bitly/oauth2_proxy/blob/v2.0.1/providers/github.go#L42 https://github.com/bitly/oauth2_proxy/blob/v2.0.1/providers/github.go#L50
Off the top of my head, I'm wondering if you aren't getting some weirdness in ParseQuery
by having, essentially, p.Scope = "user:email,read:org read:org"
@gkuchta thanks for the idea, I tried w/ that line removed from my config file but ended up with the same type of logging of authentication complete but then Cookie Signature not valid
(same as before).
I'm stuck on this same issue, getting "Cookie Signature not valid" with github provider after authentication complete Session{ token:true}
.
Here's a snippet of my Kubernetes config with the start options:
command: ["oauth2_proxy",
"--tls-cert=/etc/prometheus-proxy-cert/cert",
"--tls-key=/etc/prometheus-proxy-cert/key",
"--provider=github",
"--github-org=$(GITHUB_ORG)",
"--upstream=http://127.0.0.1:9090",
"--email-domain=*",
"--client-id=$(CLIENT_ID)",
"--client-secret=$(CLIENT_SECRET)",
"--cookie-expire=168h0m0s",
"--cookie-name=proxysession",
"--redirect-url=$(BASE_URL)/oauth2/callback",
"--cookie-secret=$(COOKIE_SECRET)",
"--cookie-secure=true",
"--cookie-httponly=false",
"--https-address=0.0.0.0:4443"]
@gkuchta Did you get past this?
Cookie Signature not valid
Experienced this too. Workaround for me was to configure the proxy with a custom cookie name. The only reason I suspect this works is because I had multiple oauth proxies on different subdomains sharing the same cookie name, and I customized them all to use unique names respectively. Just a guess.
@mbrevoort - were you able to resolve the issue. Could you post the working config if your were able to resolve this?
TIA
Cookie Signature not valid
is the key here. GitHub provider probably has nothing to do with it.
If you get this, something is mangling or replacing your cookies. As @hollingsworthd suggested, using a custom cookie name may work-around this problem.
If you have multiple oauth2_proxy instances serving the same domain, and the same cookie, they will need the same cookie secret. If you do tricky things with multiple subdomains, you really have to know how everything works underneath, and inspect all requests and responses to debug.
I'm trying to set up proxying on Heroku using oauth2_proxy with Github in front.
I've tried a number of things but continue to just get redirected back to the sign in page. The cookie never seems to get set and the logging of the session after successful contact with Github seems odd compared to other examples I've seen.
The Heroku procfile runs this
bin/oauth2_proxy-2.0.1.linux-amd64.go1.4.2/oauth2_proxy -http-address="0.0.0.0:$PORT" -config='oauth2_proxy.cfg'
. The config file (after massaging numerous times, I've tried a variety of things) looks like this:I set up a Github app as directed in the README on master, with the redirect URL matching before.
I've tried config files without the last 5 last lines from above, and also with the scope not set.
The are three environment variables set on the Heroku box:
Here are logs of restarting the dyno and loading the main page. I've also tried revoking all user access tokens via Github.
The line that looks weird to me is
authentication complete Session{ token:true}
. Other posted issues I've seen have more info here, like email or organization. Thanks!