What does a relying party send to an OpenID Provider's `end_session_endpoint` to sign a user out, and what does each parameter do?
answer
- a redirect, not a background call
- the browser carries the provider's cookie
- a hint about which session to end
- recommended, not required
- the return URI must be pre-registered
basics
~10 sThe relying party redirects the browser to end_session_endpoint carrying id_token_hint (which session to end), client_id, a pre-registered post_logout_redirect_uri, state and ui_locales. The provider ends its own session, then redirects back.
solid answer
~40 sRelying-party-initiated logout is a **front-channel redirect**, not a background call: the relying party sends the user agent to the provider's `end_session_endpoint` so the provider can act on its own session cookie. The request may carry `id_token_hint`, a previously issued ID token that tells the provider which end-user session is meant — it is RECOMMENDED, not required. `logout_hint` and `client_id` help the same way when no ID token is at hand. `post_logout_redirect_uri` says where to return afterwards and must have been registered in the client's `post_logout_redirect_uris`; a provider must not redirect to a value it cannot verify belongs to a registered client. `state` is echoed back unchanged so the relying party can match the return, and `ui_locales` asks for a language on any page the provider renders.
code
http · 5 linesGET /logout?id_token_hint=eyJhbGciOiJSUzI1NiJ9.eyJpc3Mi...&client_id=s6BhdRkqt3&post_logout_redirect_uri=https%3A%2F%2Froster.example%2Fsigned-out&state=af0ifjsldkj HTTP/1.1
Host: idp.example
HTTP/1.1 302 Found
Location: https://roster.example/signed-out?state=af0ifjsldkjgo deeper
Recall that signing out of a federated login means sending the user to the provider's logout address, not just clearing a local cookie, and that the address to come back to has to be registered in advance.
Explain each parameter and its strength: why id_token_hint is a hint rather than a requirement, and why the provider refuses to redirect to a return URI it cannot tie to a registered client.
Show that you know the blast radius: one browser, one provider session, plus best-effort notification to other relying parties. Be ready to say what is still live afterwards.
The trade-off is how much you require of every integrating client at onboarding. Registered return URIs and an ID token hint cost integration friction and buy a logout you can reason about.
## The endpoint and what it is for An OpenID Provider that supports relying-party-initiated logout advertises an `end_session_endpoint` member in its configuration document. A relying party that wants to end the user's session **at the provider** — not merely its own — sends the user agent there. The whole point of making it a redirect rather than a server-to-server call is that the provider's session lives in a cookie held by that browser: only a request the browser makes carries it, so only a request the browser makes lets the provider recognise the session and drop it. This is one of four separate session-related documents in the OpenID Connect family, and it is the one with the clearest contract: a single request, one visible effect at the provider, and an optional return trip. ## The parameters | Parameter | Strength | What it does | |---|---|---| | `id_token_hint` | RECOMMENDED | A previously issued ID token, replayed as a request parameter, telling the provider which end-user session and which client this logout is about | | `logout_hint` | OPTIONAL | A provider-specific hint about which end user is meant, for cases where no ID token is available | | `client_id` | OPTIONAL | Identifies the requesting client; when both it and `id_token_hint` appear they must name the same client | | `post_logout_redirect_uri` | OPTIONAL | Where to send the browser afterwards; must have been registered for that client in `post_logout_redirect_uris` | | `state` | OPTIONAL | Opaque value echoed back unchanged on the return redirect | | `ui_locales` | OPTIONAL | Preferred languages for any page the provider renders during logout | The strengths matter. A candidate who says `id_token_hint` is required has learned one provider's behaviour rather than the specification: it is RECOMMENDED, and a request without it is still a valid logout request. What it buys is precision — with it the provider knows exactly which session and which client are involved, and can verify a `post_logout_redirect_uri` against that client's registration without asking anyone anything. ## Why registration of the return URI is not optional in practice The provider must not redirect the browser to a `post_logout_redirect_uri` whose validity it has not established. Without that rule the logout endpoint becomes an open redirector wearing a trusted hostname: anyone could hand a user a link to the provider that bounces them onward to a page of the attacker's choosing, with the provider's domain in the address bar for the first hop. So the provider needs either an `id_token_hint` or a `client_id` to know whose registered list to check against; given neither, it should end the session and render its own page instead of redirecting. ## What happens, in order 1. The relying party builds the logout URI and redirects the browser to it. 2. The provider receives the request with its own session cookie attached, and identifies the session — from the cookie, refined by `id_token_hint` or `logout_hint` if present. 3. The specification permits the provider to ask the end user to confirm, and providers commonly do so when the request carries no `id_token_hint`, because a bare request is an unauthenticated instruction to end somebody's session. 4. The provider ends its own session for that user agent. 5. The provider notifies other relying parties, by whichever of the front-channel and back-channel mechanisms each of them registered. That notification is a separate mechanism with its own failure modes. 6. If a `post_logout_redirect_uri` was supplied and verified, the provider redirects there, appending `state` unchanged if one was sent. ## What this request does not do - It does not, by itself, end any relying party's own application session. That is the relying party's job, triggered either by its own handling of the redirect or by a notification from the provider. - It does not invalidate credentials the provider has already issued. Token lifetime and revocation are a different subject with a different endpoint entirely. - It does not reach other browsers. The vehicle tablet, the phone and the desktop each hold their own provider session cookie; a logout in one of them is a logout of that one, plus whatever notification the provider manages to deliver to relying parties in that same browser or to their servers. ## The word 'state' is overloaded here Three different values share that word on this material: the `state` parameter on an authorization request, which binds a login response to the request that started it; the `state` parameter on this logout request, which is just a round-tripped bookmark; and `session_state`, which is a provider-computed digest and not a client-chosen value at all. In an interview, say which one you mean before you say what it does.
- If a logout request arrives carrying no `id_token_hint`, what may the provider do about `post_logout_redirect_uri`?It must not redirect to a URI whose validity it has not established. With `client_id` present it can check the value against that client's registered `post_logout_redirect_uris` and redirect; with neither, it ends the session and renders its own page. Providers also commonly ask the user to confirm in that case, since nothing in the request proves who sent it.
- What does the `state` parameter do on an RP-initiated logout request?It is opaque to the provider and echoed back unchanged on the return redirect, so the relying party can match the return to the request it started and restore where the user was. It is not `session_state`, which the provider computes, and it is not doing the request-binding job the same-named parameter does on an authorization request.
- Why is this a browser redirect rather than a call from the relying party's server?The provider's session is identified by a cookie held in that browser. A server-to-server call carries no such cookie, so the provider would have nothing to end. Sending the user agent is what puts the session in front of the provider — which is also why the effect is confined to that one browser.
saying these in an interview costs you the question
- Calls end_session_endpoint server-to-server instead of redirecting the browser
- Thinks id_token_hint is required on every logout request
- Sends any post_logout_redirect_uri without registering it first
- Assumes the logout request also invalidates tokens already issued
- Confuses the logout request's state parameter with session_state