Skip to content

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

Open
zhaohuabing wants to merge 1 commit into
envoyproxy:mainfrom
zhaohuabing:oidc-post-logout-redirect-uri
Open

zhaohuabing wants to merge 1 commit 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

@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 3173b27
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/6ab487c721166e00084b1b2c
😎 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 95.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.35%. Comparing base (3b211d2) to head (3173b27).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/gatewayapi/securitypolicy.go 94.44% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9608      +/-   ##
==========================================
+ Coverage   81.32%   81.35%   +0.03%     
==========================================
  Files         264      265       +1     
  Lines       41008    41110     +102     
==========================================
+ Hits        33349    33447      +98     
- Misses       7658     7662       +4     
  Partials        1        1              

☔ 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 2 times, most recently from 549c833 to 4eac001 Compare July 29, 2026 13:28
@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch from 4eac001 to 9159185 Compare August 28, 2026 08:26
@zhaohuabing
zhaohuabing marked this pull request as ready for review August 28, 2026 08:46
@zhaohuabing zhaohuabing added this to the v1.10.0-rc.1 Release milestone Aug 28, 2026
@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch 2 times, most recently from e81c74f to 6e3bb2f Compare August 28, 2026 08:47

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9159185c5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +972 to +973
case plr.URI != nil && plr.Disabled != nil:
return errors.New("only one of OIDC.PostLogoutRedirect.uri or OIDC.PostLogoutRedirect.disabled must be set")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize disabled:false before validating merged policies

When a parent policy supplies uri and a route policy using mergeType supplies disabled: false, mergeSecurityPolicy retains both pointers and this presence-only check rejects the merged policy. This contradicts the new API documentation that disabled: false is equivalent to leaving postLogoutRedirect unset; an actually unset route value would inherit the parent's URI. Normalize false to an unset value before merging/validation, or only treat disabled: true as conflicting, so this valid route policy does not become Accepted=False merely because it is attached beneath a parent URI.

Useful? React with 👍 / 👎.

@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

4 similar comments
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch from 068e77f to 960f964 Compare September 21, 2026 02:06
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch from 960f964 to 4b177ae Compare September 22, 2026 02:09
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch from 4b177ae to d278111 Compare September 23, 2026 02:09
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

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>
Signed-off-by: Huabing (Robin) Zhao <huabing@tetrate.io>
@zhaohuabing
zhaohuabing force-pushed the oidc-post-logout-redirect-uri branch from d278111 to 3173b27 Compare September 24, 2026 02:15
@zhaohuabing

Copy link
Copy Markdown
Member Author

/retest

This branch has not been deployed

No deployments
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