-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
login loop using ingress nginx, auth_request always returning 401 #74
Comments
We really need to improve the documentation here, apologies! Can you check which domain the I think you might need to set |
ok, I had a wildcard in for the whitelist but for testing sake to see it work, I just hard coded both cookie-domain and whitelist-domain to the same value... This seems to have made things worse. :)
|
aaah, so with your clue and a little bit of experimentation...
and this worked! Yeah, some more documentation would help... It took me all morning to work out that the whitelist-domain was mandatory and that is why everything I was logging into was going to "/". :) |
Yes I believe your findings match our configuration here, I'm out of office right now so can't check unfortunately If you have some time to update the docs I would appreciate it. The whitelist domain flag is, as you say, mandatory if (and only if) you wish to host the oauth2 proxy on a separate domain to the ones you are protecting. A short guide for using this with the nginx Auth request mode would be good |
ok, another question. The power of having the oauth-proxy on its own domain is that you can have many things use it to login. Is there a way to have per domain ACL on it? domain1.k8s.example.com does that make sense? Or so I need to have a separate proxy for each one? |
yeah, so I am trying a another proxy install for the site I want to have email users:
is what I get, I matched the cookie domain and hostname to be the same. |
At present you will need a separate proxy for each one
Can you inspect the responses when setting the cookie and check that the browser is storing the cookie you expect? |
Yeah, I had to create another proxy on another domain and match all the settings for the two authentication scopes I was after. |
A bit more logging here would be super helpful. I hit this required setting today as well. A |
Hi, I have the similar issue Proxy oauth logs:
Ingress controller:
I'm using Azure. This is the setup: Application:
Proxy:
I tried multiple combination and can't figure it out. Any ideas? |
@s1apped Try your cookie domain with a
|
@JoelSpeed unfortunatelly it didn't help. |
Has anyone been able to fix this? Constantly getting 401 Unauthorized error. @s1apped -- Were you able to find a work around? I have tried all kinds of combinations for the cookie-domain and whitelisting, oauth2_proxy keeps throwing the |
If you are using azure, I would recommend trying the redid session storage mechanism. The cookie storage does not work very well with Azure due to the size of the ID Tokens they generate |
This issue has been inactive for 60 days. If the issue is still relevant please comment to re-activate the issue. If no action is taken within 7 days, the issue will be marked closed. |
I am able to reproduce this. We are using the 3.0.0 helm chart
|
@drewwells Your redirect-url is invalid, it should point to the OAuth2 Proxy callback eg |
@JoelSpeed
|
Expected Behavior
Go to the ingress hostname for the first time, be greeted with google login.
Select google account, redirect to application setup to be behind hostname.
Current Behavior
Go to the ingress hostname for the first time, be greeted with google login.
Select google account..... Select google account.... Select Google account.
I can see in ingress nginx that the auth_request requests are always returning a 401.
Steps to Reproduce (for bugs)
I am using the helm chart, here is the values.yaml deployed:
I think have the ingress annotation config of:
I have gone through many iterations to get to this point.
Context
I am try to use this auth proxy without luck. To me it just looks like the nginx auth-request always returns a 401. I realise this maybe an ingress nginx issue but I thought I would start here.
Your Environment
kops 1.11 maintained k8s cluster, k8s version 1.11.6
The text was updated successfully, but these errors were encountered: