Skip to content

OAuth2: remove internal cookies before forwarding request to backend #39196

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

Open
zhaohuabing opened this issue Apr 22, 2025 · 3 comments
Open
Labels
area/oauth enhancement Feature requests. Not bugs or questions.

Comments

@zhaohuabing
Copy link
Member

zhaohuabing commented Apr 22, 2025

Title: OAuth2: remove internal cookies before forwarding request to backend

Description:
The cookies other than AccessToken and IDToken should be deleted before forwarding the request to the Backend applications since they're supposed to be only used by the OAuth2 filter itself.

Discussion in Envoy Gateway:

@zhaohuabing zhaohuabing added enhancement Feature requests. Not bugs or questions. triage Issue requires triage labels Apr 22, 2025
@ravenblackx
Copy link
Contributor

@derekargueta

@ravenblackx ravenblackx added area/oauth and removed triage Issue requires triage labels Apr 22, 2025
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or "no stalebot" or other activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale stalebot believes this issue/PR has not been touched recently label May 23, 2025
@coro
Copy link

coro commented May 27, 2025

Just adding a bit of extra context here: some webserver libraries by default have a rather low limit for the size of HTTP headers, for example the Ring Jetty adapter. With default behaviour in Envoy OIDC, there are 5 additional headers added to backend requests, as well as the same information potentially repeated in a Cookie header. Some of these headers are full JWTs so the header payload can be rather large, leading to 413 errors with out of the box behaviour.

@github-actions github-actions bot removed the stale stalebot believes this issue/PR has not been touched recently label May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oauth enhancement Feature requests. Not bugs or questions.
Projects
None yet
Development

No branches or pull requests

3 participants