opencloud icon indicating copy to clipboard operation
opencloud copied to clipboard

Backchannel logout keeps the cached claims if the logout event cannot be published

Open zerox80 opened this issue 3 weeks ago • 0 comments

Describe the bug

In backchannelLogout (services/proxy/pkg/staticroutes/backchannellogout.go), a failed publishBackchannelLogoutEvent skips the rest of the loop iteration with continue. The cached claims and the lookup record of that session are then not deleted, and the handler still answers 200. The IDP considers the logout done, while the proxy keeps accepting the token until its cache entry expires.

Publishing fails, for example, if the events publisher is unavailable or if the user cannot be resolved from the cached claims.

Steps to reproduce

  1. Log in and send a request with an access token.
  2. Make publishing the event fail, for example by stopping the event bus.
  3. Log out at the IDP, so it sends a backchannel logout for the session.
  4. Send a request with the same access token.

Expected behavior

The cached claims are removed even if the notification fails, and the request is rejected with 401.

Actual behavior

The proxy logs failed to publish backchannel logout event, answers the logout with 200 and keeps accepting the token.

Setup

Found while reading the code on main. The regression test in #3477 runs the handler without an events publisher.

Additional context

Fix proposed in #3477.

zerox80 avatar Nov 10 '26 21:11 zerox80