Skip to content

/logout

GET/logoutissuer host
POST/logoutissuer host

Ends the browser’s session on the issuer host: the end_session_endpoint of RP-initiated logout. The browser is sent here; it is a page, not an API.

A client that logged its user in through the embedded login has no session cookie on the issuer host to end. It signs out by revoking its refresh token at /revoke, which ends that session. The SDKs choose the right one: logout() in auth-js and auth-react revokes, and goes through /logout as well when the session came from the hosted page.

A GET reads them from the query, a POST from the form body.

Parameter Meaning
id_token_hint An ID token this environment issued to the client. It may have expired. It names the client, and lets the logout go without a question when it belongs to the browser’s session.
client_id The client, when there is no id_token_hint.
post_logout_redirect_uri Where to send the browser afterwards.
state Added to post_logout_redirect_uri.

post_logout_redirect_uri is followed only when the client is known (from the hint or client_id) and the address is exactly one of the client’s post-logout redirect URIs. A development environment also takes http://localhost:<port> addresses. Any other address is ignored, never followed: the browser gets the “Logged out” page instead.

When the browser has an active session here, the page first asks “Log out?”, unless the request proves the client speaks for that session:

  • id_token_hint is an ID token of the session in the browser’s cookie, or
  • the request is the page’s own POST, which carries its confirmation.

So a link to /logout from anywhere cannot sign a user out without their say.

Only the session the browser’s cookie proves, with all its tokens; session.revoked is recorded with the reason logout. A session named only by an id_token_hint and not by the cookie is never ended. The session cookie is cleared when the request carried one. A request without the cookie (a form another site posts here, which browsers send without it) ends nothing and clears nothing: it gets the “Logged out” page, or the return address, and the browser’s session is as it was.

The answer is 303 to the return address, or the “Logged out” page.

Front-channel and back-channel logout are not implemented: other apps that hold tokens of the same session learn of it when their next refresh is refused with invalid_grant, or from the session.revoked webhook.

GET /logout?id_token_hint=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCIs…&post_logout_redirect_uri=https%3A%2F%2Fapp.your-app.com%2Fbye&state=bye HTTP/1.1
Host: your-app.auth.dev.seek.services
Cookie: __Host-sid=…
HTTP/1.1 303 See Other
Location: https://app.your-app.com/bye?state=bye

Without a hint that matches the cookie, the same request first shows “Log out?”; the user’s answer posts back to /logout and gets the same 303.