SAML single logout
IdP- and SP-initiated SAML single logout, the sso.logout event, and how to turn it on per connection.
With single logout (SLO), signing out at the identity provider also ends the user’s session in your app, and your app can sign the user out of the IdP. It is off by default on each SAML connection.
Turn it on
Section titled “Turn it on”PUT / (or ohauthcat slo set) with enabled: true. OhAuthCat reads the IdP’s SingleLogoutService URL and binding from its metadata when the metadata is uploaded, fetched or refreshed; set idp_slo_url, idp_slo_response_url and idp_slo_binding (redirect or post) yourself to override it. GET / shows the stored, metadata and effective values, and sp_slo_urls: the logout URLs the IT admin enters at the IdP.
Once on, your SP metadata advertises SingleLogoutService for the Redirect and POST bindings, including on custom domains that carry the connection’s ACS URLs. While it is off, logout messages are refused with saml_slo_disabled.
IdP-initiated logout
Section titled “IdP-initiated logout”- The IdP sends a signed LogoutRequest to
/sso/saml/slo/{conn}. - OhAuthCat checks the signature, issuer, destination, time window and that the message ID was not seen before.
- It ends the matching SAML sessions and emits an
sso.logoutevent in the same transaction, then answers the IdP with a signed LogoutResponse. - Your app receives
sso.logoutand ends the user’s session.
If no session matches, the IdP gets a Responder status and OhAuthCat records saml_logout_session_not_found.
SP-initiated logout
Section titled “SP-initiated logout”When the user signs out in your app, call POST /v1/sso/logout with the user’s profile_id and a registered return_to URL. The answer has a logout_url and the sign_in_id; send the browser there. OhAuthCat sends a signed LogoutRequest to the IdP (a redirect, or an auto-submitting form for the POST binding that also works without JavaScript), checks the IdP’s LogoutResponse and returns the browser to return_to.
The sso.logout event
Section titled “The sso.logout event”It identifies the organization, connection and sign-in whose session ended; the webhook event catalogue lists the envelope. Treat it like any other webhook: verify the signature, deduplicate by event ID, and end every session you created from that sign-in.
SAML sessions are kept only while they can still be logged out, and deleted an hour after they end or expire.