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

oauth: always set token cookies in response regardless of forward_bearer_token option #34156

Conversation

derekargueta
Copy link
Member

@derekargueta derekargueta commented May 15, 2024

Commit Message: oauth: always set token cookies in response regardless of forward_bearer_token option
Additional Description: Unconditionally set the BearerToken, IdToken, and RefreshToken cookies in the response. The documentation of forward_bearer_token states "Forward the OAuth token as a Bearer to upstream web service." It's confusing for this behavior to affect response cookies as well and I can't think of a benefit that's being achieved here. This brings the behavior of this filter more aligned with what the documentation describes.
Risk Level: Low
Testing: Included
Docs Changes: N/A
Release Notes: Included
Platform Specific Features: N/A
Fixes: #32566 #15489

…rer_token option

Signed-off-by: Derek Argueta <darguetap@gmail.com>
Signed-off-by: Derek Argueta <darguetap@gmail.com>
Signed-off-by: Derek Argueta <darguetap@gmail.com>
Signed-off-by: Derek Argueta <darguetap@gmail.com>
@derekargueta derekargueta marked this pull request as draft May 19, 2024 20:03
Signed-off-by: Derek Argueta <darguetap@gmail.com>
Signed-off-by: Derek Argueta <darguetap@gmail.com>
@rgshenoy
Copy link

rgshenoy commented Jun 3, 2024

Any ETA on this PR? We'd love to use OAuth2 filter in prod - but we hit this bug and it is preventing us. Thank you!

@denniskniep
Copy link
Contributor

Hi @derekargueta,

is there any chance to land this into the next release? If there is help needed, I can take something over.

Cheers,
Dennis

@zetaab
Copy link

zetaab commented Jun 25, 2024

@derekargueta ping

@zetaab
Copy link

zetaab commented Jul 8, 2024

@denniskniep thinking that could you just make separate PR as @derekargueta is not answering/pr not progressing? At least we need this feature

@derekargueta
Copy link
Member Author

derekargueta commented Jul 10, 2024

Was out on PTO. One reason I had for closing this was consideration of implementing encrypted cookies first (#23508), as this change would set the raw bearer token in the client browser which is undesirable by some.

Signed-off-by: Derek Argueta <darguetap@gmail.com>
Signed-off-by: Derek Argueta <darguetap@gmail.com>
@denniskniep
Copy link
Contributor

denniskniep commented Jul 11, 2024

Does it make sense to apply this functionality only, if a certain knob is set?

Edit: I ment introducing a new knob which controls if the cookies are set or not

@zetaab
Copy link

zetaab commented Jul 26, 2024

so how we should proceed here to get this forward?

@arkodg
Copy link
Contributor

arkodg commented Aug 2, 2024

hey @derekargueta afaik this PR should bring back the previous behavior that existed with this filter
#23508 could be added as an enhancement with a new field in the filter

@denniskniep
Copy link
Contributor

@derekargueta does it make sense to introduce further properties to disable single cookies disable_XYZ_set_cookie? Like it was done here: #33825

Adding following properties:

  • disable_access_token_set_cookie
  • disable_refresh_token_set_cookie

Then

  1. we don't need to wait for OAuth2: tokens set in the cookies are not encrypted #23508
  2. everyone can precisely control which cookies should be set or not, even if encryption is implemented.
  3. forward_bearer_token no longer influences the cookie set behavior

What do you think?

@denniskniep
Copy link
Contributor

@derekargueta I created a PR for my proposal here:
#35839

Copy link

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label Sep 24, 2024
Copy link

github-actions bot commented Oct 1, 2024

This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@github-actions github-actions bot closed this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stalebot believes this issue/PR has not been touched recently
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OAuth2 Filter - Unexpected behaviour of forward_bearer_token
6 participants