mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 15:40:06 +00:00
06aaddc34d
OpenID Connect Back-Channel Logout 1.0: the provider calls POST /api/auth/oidc/backchannel-logout with a logout token when a user signs out there or an admin ends their session, and TREK ends the matching sessions. Until now a session lived on for up to 30 days after access was taken away at the provider. - The token is checked as section 2.6 asks, through the verifier the login uses for the id_token (provider JWKS, issuer incl. a custom discovery URL, client id in aud), plus a recent iat, the logout event, a sub or sid, no nonce, an accepted typ and a jti not seen before (in-memory, bounded replay store; a jti whose sessions failed to end is released for the retry). - The id_token's sid is stored on the session the SSO sign-in creates (nullable user_sessions.oidc_sid, both engines), and an app session handed off from that browser sign-in carries it too. A token with a sid ends those sessions only; a token with only a sub ends every session of the account. - A valid token answers 200 with no-store also when it names nobody here; an invalid one 400 invalid_request, never 500, with the reason only in the server log. Public route with its allow-list entry, rate limited, audited as oidc.backchannel_logout. - Always active: nothing changes until an admin enters the URL at the provider. Wiki: the URL, where it goes in Authentik, Keycloak and Pocket ID, and Keycloak's single token when an admin signs a user out. Addresses discussion #3124.