Receive back-channel logout tokens
Verify WorkPair’s OpenID Connect Back-Channel Logout 1.0 tokens and end the person’s session; send people to WorkPair’s end-session page.
- Who it’s for
- Developers of an application that uses Login with WorkPair.
- What you need first
- A
backchannelLogoutUriregistered for your client (see Sign-out and device-key sign-in for your client)
- A
- Time needed
- 30 minutes
Receive the logout token
Discovery advertises
backchannel_logout_supported: true,backchannel_logout_session_supported: trueandend_session_endpoint.Keep the ID token’s
subandsidwith your session when the person signs in.WorkPair POSTs to your URI with
Content-Type: application/x-www-form-urlencodedand a bodylogout_token=<JWT>.Verify the JWT against
/.well-known/jwks.jsonwith the same algorithm as your ID tokens (headertypislogout+jwt). Checkissis WorkPair’s issuer,audis yourclient_id,iatis recent andexp(two minutes later) hasn’t passed.Check
eventshas the memberhttp://schemas.openid.net/event/backchannel-logout, there is nononce, andjtihasn’t been seen before (keepjtivalues for a few days).End every session of that
sub(andsidwhen present), then answer200. Anything else is retried with backoff over about two and a half days, with the samejtiand a freshly signed token.
Send people to WorkPair’s sign-out page
Register
postLogoutRedirectUrisfor your client.After signing the person out of your application, send the browser to
GET /oidc/logout?id_token_hint=<their ID token>&post_logout_redirect_uri=<registered URI>&state=<value>(orclient_idinstead ofid_token_hint).WorkPair offers Sign out of WorkPair and every app and links back to your URI with your
state. It never signs anyone out just because the page was opened.
What happens next
- The developer guide lists every ID-token claim, including
sidandacr.
Common problems and fixes
- The token has no
sid. - People who signed in before back-channel logout existed have no
siduntil they sign in again: end every session of thatsub. /oidc/logoutanswers400 invalid_request.post_logout_redirect_urimust be registered exactly, and needsclient_idor a validid_token_hintissued by WorkPair.
Still stuck? Write to support@workpair.io and say which guide and step you were on. WorkPair will never ask for your passphrase, a code or an API key.