Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Access token forwarding through nginx auth request #424

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

patrickfuller
Copy link

Related to #420.

This enables expected behavior when using:

set_xauthrequest = true
pass_access_token = true

If both of these are set, the access token will be included in an X-Auth-Request-Access-Token header, following the X-Auth-Request-* pattern used for User and Email.

The access token allows for further validation by upstream services. In my case, I use the token to get more user information, which is then used to set read-only / read-write / admin permissions on internal software.

README.md Outdated
@@ -370,8 +370,10 @@ server {
# requires running with --set-xauthrequest flag
auth_request_set $user $upstream_http_x_auth_request_user;
auth_request_set $email $upstream_http_x_auth_request_email;
auth_request_set $token $upstream_http_x_auth_request_access_token; # Available with --pass-access-token flag
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is a bit long - I'd put the comment on a separate line just above.
(You could also group with proxy_set_header line, like --cookie-refresh group just below.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - followed the cookie-refresh example.

@ploxiln
Copy link
Contributor

ploxiln commented Jul 16, 2017

Looks good to me.

@JoelSpeed
Copy link
Contributor

Is this going to be merged any time soon? This would be really useful for me

@jehiah jehiah added this to the v2.3 milestone Oct 23, 2017
jbarnette added a commit to jbarnette/docker-oauth2-proxy that referenced this pull request Nov 2, 2017
@kincl
Copy link

kincl commented Dec 20, 2017

Agreed, this would be useful for me as well.

@jonassvatos
Copy link

Hi, can we have this merged soon, please?
I've seen many issues related to this, and as this doesn't have any merge conflicts, it's just one-click-of-a-button ahead :)
Thanks in advance

@devcomb
Copy link

devcomb commented Aug 31, 2018

Agree with Isde. This should be merged. Running into same issue where I would like to have token be usable in nginx that is in front of oauth2_proxy. Please merge.

ploxiln added a commit to ploxiln/oauth2_proxy that referenced this pull request Nov 22, 2018
rebased+squashed version of bitly PR 424
@jayzeng
Copy link

jayzeng commented Nov 29, 2018

Any update on merging this? will be super helpful

@ploxiln
Copy link
Contributor

ploxiln commented Nov 29, 2018

There will be no more merges or releases for this repository - see #628 (comment) and read down to see discussion of a maintained fork.

I've started my own fork, and made a v2.3 release which includes this change, see https://github.com/ploxiln/oauth2_proxy/releases

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

8 participants