OIDC back-channel logout: validate Logout Tokens and end RP sessions
Implement the server-to-server logout endpoint, validate the signed Logout Token, map it to the right RP session, and handle delivery failures.
OIDC back-channel logout: validate Logout Tokens and end RP sessions
OpenID Connect (OIDC) back-channel logout lets an OpenID Provider (OP) send a Logout Token directly to a relying party (RP) server. It avoids browser iframe and third-party-cookie limits, but the RP endpoint must be reachable and the RP must validate the token and map it to stored session state.
Configure the endpoint
Register an absolute backchannel_logout_uri with the OP, normally using HTTPS and no URI fragment. The OP sends an HTTP POST with Content-Type: application/x-www-form-urlencoded and a logout_token field. Do not expect browser cookies; identify sessions from trusted server-side records. Check Discovery metadata for backchannel_logout_supported and, when needed, backchannel_logout_session_supported. An omitted support flag defaults to false.
Validate before changing state
Decrypt only if encryption was negotiated, using the registered keys and algorithms.
Verify the signature and permitted algorithm; reject `alg: none`.
Validate `iss`, `aud`, `iat`, `exp`, and `jti`.
Require an `events` object containing `http://schemas.openid.net/event/backchannel-logout`.
Require `sub` or `sid` (or both); reject any token containing `nonce`.
Optionally detect a recently reused `jti`, and compare issuer, subject, or session ID with trusted ID Token records.
A Logout Token is not an ID Token. Explicit typ: logout+jwt is recommended, but requiring it can break existing integrations; agree on it with the OP.
End the intended session
Map (iss, sid) to a specific RP session. If sid is absent, (iss, sub) identifies the user's RP sessions for that issuer. Never treat the same sub from different issuers as the same identity. Make repeated valid notifications idempotent. On success return HTTP 200; an OP should also accept HTTP 204 where a framework substitutes it for an empty 200. Return HTTP 400 for invalid or failed requests and include Cache-Control: no-store.
Verify and handle outages
In a test environment, check valid signatures and claims, rejection of wrong audience, expired tokens, nonce, missing event or missing sub and sid, correct session targeting, repeat delivery, response codes, and no-store. This is a verification plan, not a reported test. The RP endpoint must be reachable from the OP; network outages can delay logout, so retain normal session expiry and make processing idempotent. Log only a correlation ID and non-sensitive error code, never the raw token. See Back-Channel Logout 1.0 §§2.2–2.8, Front-Channel Logout 1.0, and RFC 8725.