Skip to content

api(oidc): Allow override of all OIDC CookieNames#5655

Closed
coro wants to merge 1 commit intoenvoyproxy:mainfrom
coro:api-oidc-cookies
Closed

api(oidc): Allow override of all OIDC CookieNames#5655
coro wants to merge 1 commit intoenvoyproxy:mainfrom
coro:api-oidc-cookies

Conversation

@coro
Copy link
Contributor

@coro coro commented Apr 2, 2025

What type of PR is this?

What this PR does / why we need it:

Allows for:

  • removal of the internal OAuthFilter cookies before forwarding the request to upstream
  • migrations from other OIDC providers with preemptible cookie names

Which issue(s) this PR fixes:

Fixes #5152

Release Notes: No

Signed-off-by: Connor Rogers <23215294+coro@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Apr 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.22%. Comparing base (2f81596) to head (f6f3acc).
Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5655      +/-   ##
==========================================
- Coverage   65.28%   65.22%   -0.07%     
==========================================
  Files         213      213              
  Lines       34132    34132              
==========================================
- Hits        22282    22261      -21     
- Misses      10515    10531      +16     
- Partials     1335     1340       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arkodg arkodg requested a review from zhaohuabing April 2, 2025 20:18
Copy link
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

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

@coro Thanks for picking this up. Could you please also add CodeVerifier cookie?

reference: envoyproxy/envoy#37849

@zhaohuabing
Copy link
Member

zhaohuabing commented Apr 2, 2025

A second thought, we probably shouldn't expose these cookies to the API - not like the ID and Access tokens, they're some trivial internal implementation details.

I'd rather remove these cookies by default in the OAuth2 filter.

@coro
Copy link
Contributor Author

coro commented Apr 3, 2025

@zhaohuabing so just to confirm, you'd like no configurability for any of the Oauth* cookie names? But configurability is OK for RefreshToken-* and CodeVerifier-*?

@zhaohuabing
Copy link
Member

zhaohuabing commented Apr 4, 2025

@coro sorry for the confusion. I meant that the existing AccessToken and IDToken cookies are needed in the API because some backend applications may need them for auth purposes/getting user identity, but all the other cookies should not be exposed to the user-facing API and just be deleted before forwarding the request to the Backend applications. We should fix this in the Envoy OAuth2 filter.

Does this make sense?

@coro
Copy link
Contributor Author

coro commented Apr 22, 2025

That makes sense. I'm happy for this to be closed. I'll leave a comment in the original issue about this.

@zhaohuabing
Copy link
Member

Tracked in this Enovy issue: envoyproxy/envoy#39196

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to overwrite every OAuth2Filter Cookie via OIDCCookieNames

2 participants