Signing a user out of the identity provider does not sign them out of the applications that trusted it. In OpenID Connect every relying party (RP) keeps its own session, usually a cookie, and often holds refresh tokens as well, so a logout, a password reset or an account disable at the OpenID Provider (OP) only ends access everywhere if each RP is told and acts on it. The OpenID Foundation publishes four Final specifications for this: Session Management, Front-Channel Logout, Back-Channel Logout and RP-Initiated Logout. This guide explains what each one does, which survive modern browser privacy controls, how to implement and test single logout, and how to measure whether sessions really end. It is written for identity engineers, application developers and security architects who run an OP or build RPs.
Key takeaways
- There are four logout specs, not one. RP-Initiated Logout starts a logout; Session Management, Front-Channel Logout and Back-Channel Logout tell the other RPs about it.
- Back-Channel Logout is the dependable default. It is a signed server-to-server message and, as both browser-based specs themselves note, it is not known to be affected by third-party cookie blocking.
- Front-channel and iframe session checks fail silently in modern browsers. Treat them as a best-effort extra, never as the control that ends access for a leaver.
- Logout must reach tokens, not just cookies. The Back-Channel spec says RPs should revoke refresh tokens issued without
offline_accessfor the logged-out session; offline tokens need a separate revocation path. - Measure the gap. Track the time from disable or logout at the OP to the last successful request at each RP; that number is your real session exposure.
Why logout is a distributed problem
An OIDC login creates at least three independent things: the OP session (the cookie on the OP's domain that enables single sign-on), an RP session for each application the user opens, and, where the RP called APIs, access and refresh tokens. Each has its own lifetime. Ending one does not end the others unless something connects them.
| Artefact | Where it lives | Ended by OP logout? | What actually ends it |
|---|---|---|---|
| OP session cookie | Browser, OP domain | Yes | OP logout endpoint, OP session timeout, admin revoke |
| RP session cookie | Browser, RP domain; server-side session store | No | RP local logout, RP timeout, a logout notification the RP handles |
| ID Token | RP | No (it is a one-time assertion) | Nothing; it should not be used as a session after login |
| Access token | RP or API client | No | Expiry, revocation plus introspection at the resource server |
| Refresh token | RP back end (or browser for SPAs) | No | Revocation at the authorisation server, expiry, rotation reuse detection |
| Downstream sessions | Apps where the RP is itself an OP or broker | No | Propagated logout from the intermediate RP |
This is why offboarding and incident response so often leave access behind. Disabling the directory account stops new logins, but a user, or an attacker holding their cookie, keeps working in every RP whose session has not expired. See the Token and Session Security Guide for session and token fundamentals; this page focuses on the logout protocols.
The four OpenID Connect logout specifications
All four are OpenID Foundation Final specifications (checked 27 October 2026). Session Management, Front-Channel Logout and RP-Initiated Logout are dated 12 September 2022. Back-Channel Logout 1.0 is the Final version incorporating errata set 1, dated 15 December 2023.
| Spec | Direction | Mechanism | Key metadata | Browser privacy impact |
|---|---|---|---|---|
| RP-Initiated Logout 1.0 | RP to OP | RP redirects the browser to the OP's end_session_endpoint | end_session_endpoint, post_logout_redirect_uris | Low: a top-level redirect |
| Session Management 1.0 | RP polls OP | Hidden RP iframe posts client_id + " " + session_state to the OP's check_session_iframe | check_session_iframe, session_state | High: third-party storage blocking can make every check return "changed" |
| Front-Channel Logout 1.0 | OP to RPs via browser | OP logout page loads each RP's frontchannel_logout_uri in an iframe | frontchannel_logout_supported, frontchannel_logout_session_supported, frontchannel_logout_uri, frontchannel_logout_session_required | High: the iframe may not see the RP's cookies, so logout silently fails |
| Back-Channel Logout 1.0 | OP to RPs, server to server | OP POSTs a signed Logout Token to each RP's backchannel_logout_uri | backchannel_logout_supported, backchannel_logout_session_supported, backchannel_logout_uri, backchannel_logout_session_required | None known; it does not use the browser |
RP-Initiated Logout
- Request: the RP sends the browser to
end_session_endpoint(HTTPS, GET or POST supported) withid_token_hint(recommended), and optionallylogout_hint,client_id,post_logout_redirect_uri,stateandui_locales. - Redirect safety: the OP must not redirect unless
post_logout_redirect_uriexactly matches a value pre-registered in the client'spost_logout_redirect_uris, and without a validid_token_hintit must not redirect unless it has another way to confirm the target is legitimate. - Confirmation: requests without a valid
id_token_hintcould be used for denial of service, so the OP should ask the user to confirm, and must ask whether to log out of the OP too when no hint is given or it does not match the current session. - Idempotence: logging out a user who is not logged in is not an error, which makes retries safe.
Back-Channel Logout and the Logout Token
The Logout Token is a signed JWT with required claims iss, aud, iat, exp, jti and events, plus at least one of sub or sid. The events claim must contain the member http://schemas.openid.net/event/backchannel-logout. A nonce claim is prohibited so the token cannot be confused with an ID Token, and explicit typing with the JWT header typ value logout+jwt is recommended. The RP replies 200 OK (OPs should also accept 204) or 400 Bad Request on validation failure, and Cache-Control: no-store is recommended.
On a valid token the RP must clear state for the sessions identified by iss with sub, sid or both, should propagate the logout downstream if it is itself an OP, and should revoke refresh tokens issued without offline_access for that session. Refresh tokens issued with offline_access normally should not be revoked by a logout, which is exactly why leaver and incident processes need their own token revocation step. See the JWT Security Guide for general JWT validation.
Front-Channel Logout and Session Management
Front-Channel Logout renders each RP's logout URI in an iframe; the URI must share scheme, host and port with a registered redirect URI. When the OP sends iss or sid it must send both. Session Management lets an RP detect an OP session change by polling, then attempt a silent prompt=none re-authentication. Both specifications include a section warning that browsers blocking third-party content may stop the iframe reaching the state it needs, that logout may then fail or loop, and that Back-Channel Logout is not known to be affected. Treat both as legacy or supplementary in new designs.
Choosing a logout architecture
| Situation | Recommended approach | Why |
|---|---|---|
| Server-rendered web apps or a backend-for-frontend | Back-Channel Logout with sid, plus RP-Initiated Logout for the user's own sign-out | Reliable, signed, independent of browser cookie policy |
| Pure single-page app with tokens in the browser | Short token lifetimes, refresh token revocation, RP-Initiated Logout; consider moving to a BFF so back-channel works | A browser-only app has no endpoint to receive a server-to-server message |
| Legacy RPs that cannot receive back-channel calls | Front-Channel Logout as best effort, short RP session lifetime as the real control | Front-channel delivery cannot be guaranteed |
| RP behind a broker or federation hub | Broker receives back-channel logout and propagates it to its own RPs | The spec expects an RP that is also an OP to propagate logout |
| Many OPs, SaaS estate, cross-vendor | Back-Channel Logout where supported, plus Shared Signals CAEP session-revoked and credential-change events | CAEP covers revocations that do not come from a user logout |
Small organisations: you usually depend on your identity provider and SaaS vendors. Ask each vendor whether it implements Back-Channel Logout or CAEP, set short RP session limits where it does not, and make "revoke all sessions" part of every leaver ticket. Large organisations: publish a logout standard for internal RPs (back-channel required, backchannel_logout_session_required true, tested in CI) and track compliance per application. See the Shared Signals Framework Guide for CAEP event delivery.
Implementing Back-Channel Logout at the relying party
- Store the binding at login: when you accept an ID Token, record
iss,subandsidagainst your local session ID and any refresh tokens you hold. Without this index you cannot find the session a Logout Token names. - Use server-side sessions: a stateless, self-contained session cookie cannot be killed from the server. Keep a session store (or a revocation list keyed by
sid) that every request checks. - Expose the endpoint: register
backchannel_logout_uriover HTTPS, and setbackchannel_logout_session_requiredto true if you rely onsid. The endpoint takes anapplication/x-www-form-urlencodedPOST with alogout_tokenparameter, needs no user cookie and must not be protected by CSRF tokens tied to a browser session. - Validate strictly: verify the signature with the OP's published keys, reject
algnone, checkiss,audequal to your client ID,iatandexp, require theeventsmember, requiresuborsid, reject any token containingnonce, and checktypif your OP sets it. Optionally cachejtivalues to detect replay. - Terminate everything bound to the session: delete the server-side session, revoke non-offline refresh tokens at the authorisation server (RFC 7009), drop cached access tokens, and close any websocket or long-poll connections the session opened.
- Propagate: if your application is a broker or OP for others, send your own logout notifications downstream.
- Return quickly: respond 200 with
Cache-Control: no-storeonce state is cleared, or 400 with anerrorif validation fails. Log both outcomes.
Operating single logout at the OP
- Issue short-lived Logout Tokens: the spec recommends that
expbe no more than about two minutes ahead, to limit replay. - Retry sensibly: retransmit only after potentially recoverable failures (timeouts, 5xx), after a delay, and record undelivered notifications so someone can follow up.
- Trigger logout from more than the button: send back-channel notifications on admin session revoke, account disable, password reset and risk events, not only on user logout. Check how your OP product behaves: many only notify on user-initiated logout.
- Register redirect targets tightly: require exact
post_logout_redirect_urisper client and reject wildcards, which prevents the logout endpoint becoming an open redirector. - Keep
sidunguessable: both browser-based specs require session IDs with enough entropy to prevent guessing; the same applies to back-channelsidvalues.
Testing and rollout
- Inventory RPs: list every OIDC client, its session store type, whether it holds refresh tokens, and which logout mechanisms it has registered. Clients with no logout URI are your first gap list.
- Pilot back-channel on two or three internal apps: deploy the endpoint in logging-only mode first (validate and log, but do not terminate) to confirm tokens arrive and validate.
- Switch to enforcement: enable termination, then run a scripted test: log in to every pilot RP, trigger OP logout and admin revoke, and confirm the next request to each RP is rejected.
- Add the test to CI: a regression test that posts a signed test Logout Token and asserts the session is gone keeps the behaviour from rotting.
- Expand in rings: high-risk applications (admin consoles, finance, source code) next, then the long tail.
- Rollback: if the endpoint causes false logouts, set it back to logging-only and keep short session lifetimes while you fix validation; do not unregister the URI, or the OP stops sending.
Detection and measurement
Log at the OP: logout events, Logout Token delivery result per RP (status code, latency, retries). Log at each RP: Logout Tokens received, validation failures by reason, sessions terminated, refresh tokens revoked, and any request presenting a session that was already terminated. A terminated session reappearing is a strong signal of cookie theft or a broken store (see ATT&CK T1539 Steal Web Session Cookie and T1550.004 Web Session Cookie).
- Logout coverage: percentage of OIDC clients with a working back-channel (or CAEP) receiver, target 100% for high-risk apps.
- Delivery success rate: successful Logout Token deliveries divided by attempts, per RP.
- Session exposure after disable: time from account disable to the last successful request at each RP, measured by a monthly test leaver account.
- Orphaned refresh tokens: refresh tokens still valid for disabled users, which should be zero.
- Post-termination use: count of requests carrying terminated session IDs.
Framework mapping
| Framework | Reference | How logout supports it |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AC-12 Session Termination; AC-2(3) Disable Accounts; SC-23 Session Authenticity; IA-11 Re-authentication | Ending sessions on events and making disable effective in every application |
| NIST CSF 2.0 | PR.AA-01; PR.AA-03; DE.CM-03 | Managing credentials and sessions, monitoring session activity |
| OWASP ASVS 5.0 | V7.4.1, V7.4.2, V7.4.3, V7.4.5, V7.5.2 | No reuse after termination, terminate on disable, terminate on factor change, admin and user session termination |
| ISO/IEC 27001:2022 Annex A | A.5.18 Access rights; A.8.5 Secure authentication | Removing access on change or departure; session handling |
| CIS Controls v8.1 | Safeguard 6.2 Establish an Access Revoking Process | Revocation that reaches application sessions |
| MITRE ATT&CK | T1539; T1550.004; T1078.004 Cloud Accounts | Limits the useful life of stolen sessions and disabled accounts |
Common failure patterns
- Relying on front-channel logout: iframes blocked by third-party cookie controls fail silently, so users and administrators believe sessions ended when they did not.
- Stateless RP sessions: a signed cookie valid for 12 hours with no server-side check cannot be revoked; the Logout Token arrives and nothing happens.
- Disable without logout: account disable at the OP sends no notification, so leavers keep working in open apps. Pair every disable with an explicit revoke-sessions action. See the Employee Offboarding Security Guide.
- Cookies outliving MFA: a stolen SSO session that already passed MFA is as good as the user. In the CircleCI breach, malware stole an engineer's SSO session cookie and the attacker reused that MFA-backed session, which shows why session lifetime and server-side revocation matter as much as the login itself. See the Session Hijacking and Cookie Theft Guide.
- Forgetting offline refresh tokens: logout correctly leaves
offline_accesstokens alive, and nobody revokes them when the user leaves or the incident starts. - Loose post-logout redirects: wildcard or prefix-matched
post_logout_redirect_uristurn the logout endpoint into a phishing redirector.
Practitioner checklist
- Inventory every OIDC client and record which logout mechanism it has registered.
- Require Back-Channel Logout with
sidfor all new internal relying parties. - Use server-side session stores indexed by
iss,subandsid. - Validate Logout Tokens fully: signature,
iss,aud,exp,events, nononce. - Revoke non-offline refresh tokens on logout and all refresh tokens on disable or incident.
- Register exact
post_logout_redirect_urisand reject wildcards. - Configure the OP to notify RPs on admin revoke, disable and password reset, not only user logout.
- Run a monthly test leaver and record session exposure per application.
- Subscribe to CAEP
session-revokedevents from SaaS and identity providers that support them.
Standards and references
- OpenID Foundation: OpenID Connect Back-Channel Logout 1.0
- OpenID Foundation: OpenID Connect RP-Initiated Logout 1.0
- OpenID Foundation: OpenID Connect Front-Channel Logout 1.0
- OpenID Foundation: OpenID Connect Session Management 1.0
- OpenID Foundation: OpenID Continuous Access Evaluation Profile 1.0
- IETF: RFC 7009 OAuth 2.0 Token Revocation
- OWASP: Application Security Verification Standard 5.0
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Token and Session Security Guide · OAuth Token Introspection and Revocation Guide · OAuth for Browser-Based Applications and the BFF Pattern Guide · Shared Signals Framework Guide · OAuth 2.0 and OpenID Connect Guide