Signing out#
This page shows how an app signs a visitor out: what the logout link does, which of the three sessions it ends and which it leaves to the app, and how an operator ends every gateway session a person holds, on every app host, without waiting for them to expire.
The logout link#
An app links to /_drawbridge/oidc/callback?logout=<URL-encoded address on the same host>. mod_auth_openidc ends
the gateway session for that host and sends the browser through Entra's sign-out endpoint (named in the provider's
discovery document) back to the address. An address on another host is refused, so the link cannot be used to bounce
visitors elsewhere.
Signing in is held the same way: a sign-in started with a target_link_uri on another host (written plainly, protocol-relative or with a userinfo trick) never sends the visitor there, and the answer never names that host. The rig proves it (GatewayTest::testLoginReturnsOnlyToTheSameHost).
What ends, and what does not#
A signed-in visitor holds up to three sessions at once (Sessions and lifetimes). The ?logout= link
touches the gateway and Entra layers, and leaves the app's session to the app:
- Gateway (mod_auth_openidc, one per app host). Ends. mod_auth_openidc drops the session for that host, so a
protected path sends the visitor back to Entra and an
apipath answers 401. - Entra (the identity provider). Asked to end. The browser is sent through Entra's sign-out endpoint, so Entra may end its own session for that browser.
- App (SESAME). Left to the app. The app ends its own session first (
sesame_logout()), then sends the browser to the link.
Single sign-out, and what Entra offers#
The ?logout= link is RP-initiated logout: mod_auth_openidc ends the session for the host the link is on, then sends
the browser, as a top-level redirect, to the end-session endpoint in Entra's discovery document. Entra ends its own
session for that browser and sends it back to the address. That is the whole chain, and every hop is a normal
redirect the browser follows itself.
What it does not do is end the person's gateway sessions on the other app hosts. Entra tells other apps about a
sign-out only by front-channel logout: it loads each registered logout URL in a hidden iframe on its own sign-out page.
Browsers that block or partition third-party cookies send no session cookie with that iframe, so the call cannot end
anything, and Microsoft documents that it is not reliable across browsers. Entra documents no OpenID Connect
back-channel logout (a server-to-server call) for app registrations. So Drawbridge registers no front-channel URL and
renders no iframe, and the other hosts' sessions end on their own clocks, or at once with drawbridge revoke below.
The next section shows why the ?logout= link itself keeps working when third-party cookies are blocked.
Signing out with third-party cookies blocked#
Safari, Firefox and Chrome with tracking protection block or partition third-party cookies: a site loaded inside
another site's page (an iframe, an image, a script) gets no cookies of its own. A sign-out built on that, such as
front-channel logout, silently does nothing. The ?logout= sign-out never needs it:
- The app's link (or the redirect after its own
sesame_logout()) is a top-level navigation to the app host, so the browser sends the gateway session cookie, a first-party cookie, as always. - mod_auth_openidc ends that session, answers
302withCache-Control: no-store, and sends the browser to Entra's end-session endpoint as a top-level redirect. At Entra, Entra's cookies are first-party. - Entra sends the browser back to the address, again a top-level redirect, and the session cookie for the app host
is first-party there too (it is
SameSite=Lax, which a top-levelGETcarries).
No hop is an iframe, an image or a script, so blocking third-party cookies changes nothing. Even a browser that holds no Entra cookie at all (cleared, or partitioned away) ends the gateway session in step 2, before Entra is asked anything.
The rig walks the hops one by one with a browser that holds only the app host's cookies
(tests/E2E/LogoutTest.php): every answer is a redirect or the final page, none holds an <iframe>, a frame, an
image from the provider or a script that navigates, the chain ends on the app host, and the old session cookie is
dead. The keycloak profile checks the same with Keycloak's end-session endpoint, which validates the return address
(KeycloakTest::testLogoutWithThirdPartyCookiesBlocked). A real browser engine with its cookie rules switched on
runs the same round trip in tools/a11y/signout.mjs: with the rig's keycloak profile left up, npm ci, then
npx playwright install chromium, then npm run signout from tools/a11y shows the block live, the chain ending
back on the app host, and the old session cookie dead.
Neither of those can run in composer ci, which has no Docker, no browser and no provider. So composer ci holds
the pieces of the chain that live in the repository (tests/Unit/SignOutFlowTest.php): every app host answers the
?logout= link itself, never cached, never framed and never proxied to the app; the session cookie is
SameSite=Lax on every host, so it rides the top-level return and never a cross-site iframe or image (which also
keeps another site from signing a visitor out behind their back); nothing in the rendered config widens where a
sign-out may return or turns on front-channel logout; the strip hook leaves the endpoint its cookies; the gateway's
error pages embed nothing; and the browser check still drives the same link this page names.
Ending a person's sessions from outside#
drawbridge revoke <subject> ends every gateway session that person holds now, on every app host, without waiting
for them to expire. The subject is the value of oidc.user_claim (the AccessID at WSU). Run it where the gateway can
read the list, for example inside the running gateway container:
docker exec <gateway-container> /opt/drawbridge/bin/drawbridge revoke ab1234
docker exec <gateway-container> /opt/drawbridge/bin/drawbridge revoke --list
What happens:
- The command adds
<subject> <unix time>to the revocation list (DRAWBRIDGE_REVOCATION_FILE, default/tmp/drawbridge/revoked.txt), under a lock and in one rename, so the gateway never reads half a file. It drops the entries older thangateway.session_seconds, which no session can still match. - The gateway reads the list again at most once a second. On the person's next request to a protected path, a
session whose ID token was issued at or before that time opens nothing: a browser is sent through the
?logout=sign-out above and back to the app's front door, and anapicaller gets 401. Nothing is signed and nothing reaches the app. - A session that began after the revocation works as before. Revoking ends what the person holds now; it is not a ban. To keep someone out, disable the account in Entra too: a disabled account cannot sign in again.
- Public paths carry no identity and are not affected.
- The app's own session is the app's. The gateway refuses every protected request, so the app gets no new assertion, but a SESAME session that already exists lives on its own clock until the app ends it.
The list never holds a token, a cookie or a session ID: only the subject and the time. The rig proves the whole path
(tests/E2E/RevocationTest.php): sessions on two hosts end together, an api caller gets 401, another person is
untouched, and a fresh sign-in works.