feat(authn/oidc): add front-channel logout support#6164
Conversation
|
The latest Buf updates on your PR. Results from workflow Proto / proto-lint (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## v2 #6164 +/- ##
==========================================
+ Coverage 62.27% 62.37% +0.09%
==========================================
Files 145 145
Lines 14815 14867 +52
==========================================
+ Hits 9226 9273 +47
- Misses 4829 4833 +4
- Partials 760 761 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Verdict: request changes
The front-channel logout wiring is well-structured and the session.secure validation is solid, but the prior review’s major concern remains unaddressed: ForwardRevokeOIDCResponseOption unconditionally clears session cookies for every successful GET /auth/v1/method/oidc/{provider}/revoke—including no-op responses where sid/iss is missing or no matching session was found. This incorrectly logs out the currently authenticated user when the front-channel request targets a different (or absent) session.
internal/server/authn/middleware/http/middleware.go
- major (L71): Clearing session cookies unconditionally for every successful GET
/auth/v1/method/oidc/{provider}/revokewill force-logout the current browser user even when theRevokehandler returned a no-op becausesid/isswas missing, mismatched, or no session was found. The handler should signal when sessions were actually terminated (e.g., by setting outgoing gRPC metadata such asx-oidc-session-cleared), and this middleware should check for that signal before callingclearAllCookies.
🤖 Automated review by the Flipt PR review agent.
437177b to
0a51ae3
Compare
|
I'll stop here. If anyone has security concerns about Front-Channel Logout, Back-Channel Logout is available as an alternative. Azure, please consider supporting Back-Channel Logout as well. |
- Add AllowFrontChannelLogout config option for OIDC providers
- Route GET /auth/v1/method/oidc/{provider}/revoke to Revoke handler
- Validate iss/sid query params on front-channel logout requests
- Clear session cookies via ForwardRevokeOIDCResponseOption only when
front-channel logout succeeds (gated by provider config)
- Set SameSite=None on cleared cookies so browser discards them in
cross-origin iframe context (required by OIDC front-channel logout)
- Add proto fields iss/sid to RevokeOIDCRequest for front-channel params
Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
Signed-off-by: Roman Dmytrenko <rdmytrenko@gmail.com>
OIDC Front-Channel Logout specifies that |
front-channel logout succeeds (gated by provider config)
cross-origin iframe context (required by OIDC front-channel logout)