Skip to content

Session tickets

Apps of one group share their users and an issuer. A user signed in to one of them can arrive signed in at another with a session ticket: a one-time value, good for a minute, that the first app mints and puts in the link to the second. See Apps that share accounts for when to use it.

POST/session-ticketissuer host
Authentication The user’s access token for the account API (aud account), as at /userinfo: DPoP with a proof for POST {issuer}/session-ticket, or Bearer together with the secret of the client the token was issued to (client_secret in the body). A token for another audience is invalid_token “a session ticket needs an access token for the account API”; a Bearer token without its client’s secret, or with a wrong one, is invalid_client (401).
Body JSON: { "client_id": "<the client of the app to go to>" }, and "client_secret" with a Bearer token.
Target A web, spa or native client of this environment; anything else is invalid_request “unknown client”.
POST /session-ticket HTTP/1.1
Host: your-app.auth.dev.seek.services
Authorization: DPoP eyJhbGciOiJFUzI1NiIsInR5cCI6ImF0K2p3dCIs…
DPoP: eyJ0eXAiOiJkcG9wK2p3dCIs…
Content-Type: application/json
{ "client_id": "your-shop-spa" }
{ "session_ticket": "Qm9v…", "expires_in": 60 }

A ticket turns a token that lasts minutes into a browser session, so the token alone is not enough: a public client’s token is DPoP-bound and comes with its proof, and a web client’s backend, whose token is a bearer token, authenticates as the client as well. A token that leaked from an API it was sent to buys no ticket.

The answer carries Cache-Control: no-store. The ticket is 43 characters, good for one use within 60 seconds, for that client only, and only while the session it came from is active.

In the SDKs: createSessionTicket(targetClientId) in auth-js and auth-react. A web client asks its own backend, whose /session-ticket route (auth-client) mints one with the session it holds and sends the client’s secret with it.

The other app starts an ordinary authorization request with the ticket added:

GET /authorize?response_type=code&client_id=your-shop-spa&redirect_uri=…&code_challenge=…&code_challenge_method=S256&state=…&session_ticket=Qm9v… HTTP/1.1
Host: your-app.auth.dev.seek.services

A link can come from anyone, so unless the browser is already signed in as that user, the page first asks:

  • “Continue to {app}?”, with “Continue as {email}”, when nobody is signed in here;
  • “Switch account?”, when someone else is. Confirming ends the other account’s session in this browser.

The answer counts only from the same browser that was asked. Declining drops the ticket from the request and goes on as a normal login. With prompt=none the question is interaction_required; with prompt=login the ticket is ignored. The ticket stays unspent until the user answers.

When it is redeemed:

The browser Then
Already has that session Nothing changes.
Has another session of the same user That session is used as it is.
Has none, or confirmed a switch A new session is made in this browser with the ticket session’s first factors and login time, at acr aal1; the user gets the new-device email.

A ticket never carries a second factor: a page’s script can read a ticket, and two-step login proven in one browser does not travel to another with it. So where the app or the environment asks for a second factor, or the user has one, a browser that got its session from a ticket is asked for it on the login page before the code, as at any step-up. Hopping between apps in the browser the user logged in with is not affected: that browser already has the session.

Then /authorize answers with a code as usual. A ticket that is unknown, used, expired, for another client, or whose session has ended is invalid_request “the session ticket is invalid or expired”.