OIDC Session Management and Single Logout
You'll learn how OpenID Connect coordinates sessions across multiple applications and implements logout that works everywhere at once.
The Multi-Session Challenge
When you authenticate with OIDC, you often end up with multiple active sessions:
- A session at the Identity Provider (IdP) (like Google, Auth0)
- A session at each Relying Party (RP) application you've logged into
The problem: Logging out of one application doesn't automatically log you out of others, creating a security gap. If you walk away from your computer after logging out of one app, other apps may still grant access using their independent sessions.
OIDC Session Management
OIDC provides mechanisms to check and coordinate session state:
Front-Channel Communication: The RP's browser can periodically check with the IdP (in a hidden iframe) whether the user's IdP session is still valid. If the IdP session ends, the RP can respond accordingly.
Back-Channel Communication: The IdP can directly notify RPs when a user's session changes (like logout), without relying on browser communication.
Think of it like a security guard (RP) periodically calling headquarters (IdP) to verify someone's badge is still valid.
Single Logout (SLO)
Single Logout means when you log out from one place, you're logged out everywhere:
RP-Initiated Logout: User clicks logout in an application → RP redirects to IdP's end_session_endpoint → IdP terminates its session and notifies all other RPs → user is logged out from all applications.
Front-Channel Logout: IdP redirects the user's browser through each RP's logout endpoint using hidden iframes.
Back-Channel Logout: IdP sends direct server-to-server logout tokens to each RP's registered logout endpoint.
Key Takeaway: OIDC Session Management and Single Logout coordinate authentication state across multiple applications, ensuring that logout actions propagate properly and sessions remain synchronized between Identity Providers and Relying Parties.