-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add support to forward header with oidc token #100
base: master
Are you sure you want to change the base?
Add support to forward header with oidc token #100
Conversation
I like this - I wonder if there's a more generic way to handle forwarding parameters from providers? There's an earlier request for the access token with the google provider in #30 as well the OIDC claims. |
@thomseddon, Ideally we should have id_token , access_token and refresh_token available, but I don't know if there is security implications for access_token. Looking at some solutions like AWS ALB, it makes those tokens available as forwarded headers: This PR can be this first step; acess and refresh token can and should be implemented in future PRs. If we going for this path, we should use |
This was actually raised in #30 and I think it would make sense to use the same generic header as oauth2_proxy: To prevent tampering, we will also need to include this in the hash that's prepended in the cookie, and verify the hash matches in I'm also wondering if we should encrypt the value rather than leaving it in plain text in the cookie, I will have to do some reading in the specs/rfcs on that one and will update here when that's clear. Would you be willing to make the above changes? |
Hi, |
@thomseddon I'm willing to finish this PR. Do you have some update about the spec reading? |
Hey - I've done a bit more reading and I'm pretty positive we should be encrypting the tokens before storing them in the cookie (perhaps the email should be encrypted too?), please let me know if you think this may be unnecessary? This shouldn't be too difficult to do, I'd also like to ensure the implementation is backwards compatible - so users who still have a cookie generated using the previous technique will not suddenly be flagged as having an invalid cookie. That all sounds good? |
Hi, you have done an amazing work on the whole project. |
Hey any updates here? Would be pretty helpful if this can be merged somehow soon. |
Is this PR going to move forward or should I look to maybe a Lua filter if I want to log fields from inside a token? |
I wasn't sure about the changes needed to work, but it seems more clear now. I feel that the last part of your comment can be considered as an answer to that other comment that you did, that said: What I Think: Maybe the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was passing by and saw the typo.
Cheers :)
@@ -320,6 +320,9 @@ Note, if you pass `whitelist` then only this is checked and `domain` is effectiv | |||
|
|||
The authenticated user is set in the `X-Forwarded-User` header, to pass this on add this to the `authResponseHeaders` config option in traefik, as shown [here](https://github.com/thomseddon/traefik-forward-auth/blob/master/examples/docker-compose-dev.yml). | |||
|
|||
The OIDC/JWT token is set in the `X-Oidc-Token` header, to pass this on add this to the `authResponseHeaders` config option in traefik; the value is encrypt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: encrypted*
What exactly is preventing this PR to get merged? |
If I understand this feature correctly, I think I may be another person who will benefit. I currently use Forward Auth with Auth0, where I have custom metadata fields in the user profile in the access token which are used to determine things like what URL a User is redirected to after logging in to auth.domain.com. Forward Auth sits in front of each subdomain so I'd like to be able to access those fields so that the bearer of an access token who was routed to x.domain.com can't access y.domain.com or z.domain.com. Or is there a way I can use something like Cookie Domain? Thanks. |
I guess this is waiting to address this comment before it is merged #100 (comment) but at least in my case this is preventing my project to use this tool. @gcavalcante8808 as it has been commented before I would use standard header introduced by oauth2_proxy |
I'd also like to see support for passing the token, but with an option for a more standard |
Any updates on this? I think this project does a pretty awesome job and is a pretty clean solution for people that want to use Traefik as an API gateway, but this feature is crucial for my project. |
Scenario
For whom that want to use the user claims in their application or other layers (OPA I'm looking to you :D), this PR add the header
X-Oidc-Token
to the forwarded headers supported bythomseddon / traefik-forward-auth
; with that, subsequent middlewares or applications can decrypt and use the information inside the token.Inspired by istio/istio#11108
What has been done
oidc token
to AuthCookie.X-Oidc-Token
header.