Skip to content

feat(oidc): support post_logout_redirect_uri in logout - #9608

Draft
zhaohuabing wants to merge 2 commits into
envoyproxy:mainfrom
zhaohuabing:oidc-post-logout-redirect-uri
Draft

feat(oidc): support post_logout_redirect_uri in logout#9608
zhaohuabing wants to merge 2 commits into
envoyproxy:mainfrom
zhaohuabing:oidc-post-logout-redirect-uri

Conversation

@zhaohuabing

@zhaohuabing zhaohuabing commented Jul 29, 2026

Copy link
Copy Markdown
Member

What this PR does:

Adds spec.oidc.postLogoutRedirect to SecurityPolicy, exposing Envoy's new OAuth2 post_logout_redirect_uri setting for OIDC RP-Initiated Logout:

oidc:
  logoutPath: "/myapp/logout"
  postLogoutRedirect:
    uri: "https://www.example.com/myapp/loggedout"
# or, to omit the parameter entirely
  postLogoutRedirect:
    disabled: true

Envoy previously hardcoded this parameter to <scheme>://<host>/, the root of the inbound request's host. Per RP-Initiated Logout the parameter is optional, but when supplied it must be pre-registered with the provider — and the ingress root generally is not, so providers reject the whole logout request. uri lets operators point at a registered landing page; disabled covers providers that reject any unregistered value, where the parameter itself has to go.

Release Notes: Yes

Fixes #7349

Picks up envoyproxy/envoy#45367, which adds the post_logout_redirect_uri
field to the OAuth2 filter config. Also regenerates extensions.gen.go for
the extension types added since the previous pin.

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing
zhaohuabing requested a review from a team as a code owner July 29, 2026 09:00
@netlify

netlify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 4eac001
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6a69ffe7fb1a1c0008787dfc
😎 Deploy Preview https://deploy-preview-9608--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@zhaohuabing
zhaohuabing marked this pull request as draft July 29, 2026 09:01
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.17647% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.73%. Comparing base (511b1e8) to head (4eac001).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/securitypolicy.go 90.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9608      +/-   ##
==========================================
- Coverage   75.73%   75.73%   -0.01%     
==========================================
  Files         254      254              
  Lines       42110    42178      +68     
==========================================
+ Hits        31892    31943      +51     
- Misses       8073     8090      +17     
  Partials     2145     2145              

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch from 4e07fb5 to 549c833 Compare July 29, 2026 13:12
Adds spec.oidc.postLogoutRedirect to SecurityPolicy, controlling the
post_logout_redirect_uri parameter Envoy sends to the OIDC provider's end
session endpoint during RP-Initiated Logout. Set uri to send a specific
value, or disabled to omit the parameter entirely.

Envoy previously hardcoded this parameter to <scheme>://<host>/, the root of
the inbound request's host. Many providers require the post logout redirect
URI to be registered for the client and reject the logout request otherwise,
so that default made RP-Initiated Logout unusable for them.

The uri accepts the %REQ(header)% command operator so one policy can serve
several hosts. Other operators are rejected up front, because Envoy fails
filter creation on an unknown operator and would NACK the xDS update rather
than report the mistake on the policy. The uri/disabled exclusivity is
re-checked after policy merge as well, since CEL only ever sees an individual
policy and a StrategicMerge can leave both fields set.

Fixes envoyproxy#7349

Signed-off-by: Huabing (Robin) Zhao <zhaohuabing@gmail.com>
@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch from 549c833 to 4eac001 Compare July 29, 2026 13:28
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.

OIDC: support post_logout_redirect_uri in logout

1 participant