Backchannel logout keeps the cached claims if the logout event cannot be published
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
- Log in and send a request with an access token.
- Make publishing the event fail, for example by stopping the event bus.
- Log out at the IDP, so it sends a backchannel logout for the session.
- 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.