How-to guide
Sign people out from your app
Send people from your app's sign-out to Sovrain, so that they leave the Sovrain session and every app in it, and bring them back to your app.
This guide makes your app’s sign-out end the person’s Sovrain session too, so that the next visit to any app asks them to sign in again.
Signing out of Sovrain is one event for the whole browser session: it signs the person out of every app they used in it, not only yours. About sessions and sign-out explains why. To react when the person signs out somewhere else, see End your app’s session when people sign out elsewhere.
Before you start
On the Sign-out tab of your app, ask an admin to:
- leave Enable sign-out for this application on (it is on by default);
- add the page your app shows after sign-out, for example
https://wiki.acme.example/signed-out, under Post-logout redirect URIs.
When the person signs in, keep the ID token with their session in your app.
Sign the person out with OpenID Connect
End the person’s session in your app.
Redirect the browser to the
end_session_endpointfrom the discovery document (line breaks added for reading):https://acme.sovrain.net/oidc/logout ?id_token_hint=eyJ… &client_id=7KpZq2WmXc4RtYvBn8HdLs &post_logout_redirect_uri=https%3A%2F%2Fwiki.acme.example%2Fsigned-out &state=x7Hd2An expired ID token is fine as
id_token_hint. If you send both,client_idmust be the token’saud.Sovrain always shows Sign out? first, and nothing ends until the person selects Sign out. Then Sovrain ends its session, signs the person out of the other apps, and sends the browser to your
post_logout_redirect_uriwith yourstateadded.
If the browser has no Sovrain session, the page says You are not signed in on this browser. and Continue
sends it straight to your post_logout_redirect_uri with your state.
If the person selects Stay signed in, they stay signed in to Sovrain and land on their Sovrain home page, not on your app.
post_logout_redirect_uri must be registered for your app exactly as you send it; otherwise Sovrain shows an error
page. If Sovrain cannot tell which app sent the request (no client_id and no readable id_token_hint), or sign-out
is turned off for your app, it does not redirect and the person ends on their Sovrain home page.
If your app uses SAML
- Ask the admin to turn on Enable Single Logout for this application on the Sign-out tab and to enter your SP SLO URL and its binding.
- End the person’s session in your app.
- Send a
LogoutRequesttohttps://acme.sovrain.net/saml/<app slug>/logout, signed: Sovrain requires a signed request by default (Require signed LogoutRequest). - Sovrain ends the person’s Sovrain session in that browser and sends its
LogoutResponseto your configured SP SLO URL, not to the address the request came from.
Sovrain does not pass this sign-out on to other SAML apps; OpenID Connect apps with back-channel logout still hear about it. If the admin turns Require signed LogoutRequest off, Sovrain ends only the person’s sessions at your app and keeps their Sovrain session.
All logout parameters: OpenID Connect › Sign-out and SAML › Single Logout.