Skip to content
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 AccessToken in response headers #30

Open
Malian opened this issue Feb 21, 2019 · 8 comments
Open

Add AccessToken in response headers #30

Malian opened this issue Feb 21, 2019 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@Malian
Copy link

Malian commented Feb 21, 2019

I need to do a collateral call to google APIs from my backend to get additional information about the user (full name, profile picture, team, ...). For that, I need to have the access token. Unfortunately, now I only have access to the user's email.

A solution could be to return the access token in the header key X-Forwarded-AccessToken but I think we will have to manage when the access token expires and refresh it with the refresh_token provided by Google. I am not sure the current implementation allows us to easily do that.

What do you think about this?

@thomseddon
Copy link
Owner

Hmm, to be honest, if you're going to the extent of working against the Google APIs then at that point, I think that this use case may actually be best served by created a forward authentication endpoint in your own application?

I'll leave this open for a while to see if there's any further support/justification but my current thinking is that this wouldn't be something we should support.

@thomseddon thomseddon added enhancement New feature or request under review labels Feb 25, 2019
@tibkiss
Copy link

tibkiss commented Feb 27, 2019

To one of our application it would be a requirement to pass the access token down to the service,
hence I second this ask.

oauth2_proxy is capable of both providing the access token and refreshing the token.

Unfortunately oauth2_proxy it is not integrating so elegantly with Traefik, traefik-forward-auth would be a much nicer solution if those two would be addressed.

@thomseddon
Copy link
Owner

Okie dokie, this shouldn't cause any issues so I'm game for working on this, I'll target 2.1

@thomseddon thomseddon added good first issue Good for newcomers and removed under review labels Apr 18, 2019
@thomseddon thomseddon added this to the 2.1 milestone Apr 18, 2019
@cstack89
Copy link

I think this may be a similar request, but sorry if it's not. But how hard would it be to only authenticate certain paths based on different scopes? Or add the users scope(s) to a header or something along those lines?

@thomseddon
Copy link
Owner

@cstack89 I think #57 and #63 should be what you're looking for

@thomseddon
Copy link
Owner

Note: if this option is enabled, the access token would need to be encrypted prior to storage in the cookie

@thomseddon
Copy link
Owner

I haven't found a elegant way to ensure backwards compatibility on this yet, so I'm going to push into 2.3

@thomseddon thomseddon modified the milestones: 2.2, 2.3 Jun 11, 2020
@thomseddon
Copy link
Owner

Notes added in #100 - hoping to merge that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants