OIDC front-channel logout: handle browser-based session notifications
Learn how OIDC front-channel logout uses an OP-loaded iframe, map `iss` and `sid` to RP sessions, and account for browser storage limits.
OIDC front-channel logout: handle browser-based session notifications
OpenID Connect front-channel logout lets the OpenID Provider (OP) call registered logout URLs for relying parties (RPs) through the user’s browser. The OP loads each URL in a hidden iframe; the RP handles the request and clears associated local session state. Browser restrictions on third-party cookies or storage can prevent the RP from identifying or ending the intended session, so this mechanism alone does not guarantee that every app is logged out.
How the mechanism works
The RP registers an absolute `frontchannel_logout_uri` with the OP. It must not contain a fragment; its scheme, host, and port must meet the specification’s registration constraints.
The OP tracks logged-in RPs and opens their registered logout URI in an iframe during logout.
The RP endpoint ends only the local session state associated with that request. Handling should be idempotent if the session is already gone.
If session-specific logout is supported, the OP sends both `iss` and `sid` query parameters, or neither. The RP maps them to a session recorded from a verified ID Token. Do not treat arbitrary query values as account identity or end every session for a user by mistake.
sid is an opaque session identifier scoped to an issuer. Front-channel logout does not deliver a separately signed logout token; use the RP’s stored, verified session mapping to decide what to terminate. Set Cache-Control: no-store on logout responses so an old response is not reused.
Configure and verify
Check the OP Discovery metadata values frontchannel_logout_supported and, for per-session targeting, frontchannel_logout_session_supported. A missing support flag defaults to unsupported. Register a dedicated endpoint on the production origin. At login, securely map verified iss, sub, optional sid, and the RP’s local session.
Test in a development environment with two RPs and a test account. Trigger OP logout, then make fresh protected requests to both RPs and inspect server-side session state. Repeat with browser third-party cookie/storage restrictions enabled and in separate profiles. The source article proposes this plan; it does not claim a live test was run. Do not log token values or personal data.
Browser limitations and troubleshooting
Because the OP loads the RP endpoint in a third-party iframe, browser privacy controls may block access to the RP’s cookie or storage. A notification can arrive without the RP being able to identify the session.
**OP is logged out but RP session remains:** check whether the browser blocked the iframe or storage access and whether the RP endpoint responded.
**Other devices also end:** verify that `sid` maps to one RP session and distinguish this from an intentional all-session policy.
**Repeated logout requests:** use idempotent handling and prevent cached responses.
**`iss` or `sid` does not match:** ignore the request for that session and investigate provider registration and session mapping; never use arbitrary query data as an account key.
OIDC recommends defensive handling and user communication when browser restrictions prevent session access. Back-channel logout can complement this flow because it does not depend on an active browser context, but each RP still needs correct session mapping and termination logic.
References
[OpenID Connect Front-Channel Logout 1.0, §§2–4](https://openid.net/specs/openid-connect-frontchannel-1_0.html)
[OpenID Connect RP-Initiated Logout 1.0](https://openid.net/specs/openid-connect-rpinitiated-1_0.html)
[OpenID Connect Back-Channel Logout 1.0, errata set 1](https://openid.net/specs/openid-connect-backchannel-1_0.html)