Skip to content

Logout (end_session and back-channel)

Someone signed into your app with Sign in with Canverly has two sessions: your app’s and Canverly’s. Leaving your app does not end the Canverly one. Two OIDC standards cover both directions.

I want Standard Discovery field
Sign out of Canverly from my app RP-Initiated Logout 1.0 end_session_endpoint
Be told when the Canverly session ends (other app, account panel, password change) Back-Channel Logout 1.0 backchannel_logout_supported, backchannel_logout_session_supported

frontchannel_logout_supported is false: no iframe logout. Use back-channel.

Endpoint: https://auth.<domain>/oauth/logout (from discovery). GET or POST:

Parameter Required Description
id_token_hint recommended The id_token from login (may be expired; the signature is still checked).
client_id with post_logout_redirect_uri Your app.
post_logout_redirect_uri optional Where to return. Must be registered (up to 20, exact address comparison). Otherwise ignored.
state optional Echoed back on post_logout_redirect_uri.
GET /oauth/logout
?id_token_hint=eyJ...
&client_id=SEU_CLIENT_ID
&post_logout_redirect_uri=https%3A%2F%2Fseuapp.example%2Fsaiu
&state=abc123
  • With a valid id_token_hint for the current session, Canverly ends it with no confirmation screen and redirects.
  • Without a hint, or with another session’s hint, a confirmation screen appears.
  • Logout is irreversible as always: it revokes refresh and its family and deletes the server-side session.
  • Afterwards, apps with a registered back-channel are notified (below).

The id_token carries sid whenever there is a session; store it with your app’s session.

Register the app’s back-channel logout URL (backchannel_logout_uri, https, public host). The field is optional: an app that only uses Connect Canverly (no login) leaves it empty and receives nothing. An app that uses both can receive the logout_token without losing its publishing connection. The OAUTH_BACKCHANNEL_LOGOUT_ENABLED flag (off by default) turns the feature on. When off, nothing is registered or sent and the discovery reports backchannel_logout_supported=false; end_session_endpoint works regardless. An app without a backchannel_logout_uri receives nothing.

When the Canverly session dies, Canverly sends, for each app that received an id_token in that session (each app is notified once per session):

POST /your/logout/route HTTP/1.1
Content-Type: application/x-www-form-urlencoded
logout_token=eyJ...

The reasons that end the session and trigger the notice are: logout, device revocation, password change or recovery, session refresh reuse and commenter deletion. Normal refresh rotation does not notify.

A JWT signed with EdDSA (Ed25519), with the same keys as the id_token (jwks_uri, kid in the header).

Claim Value
iss Discovery issuer.
aud A list with your client_id.
iat, exp Issued/expiry (2 minutes).
jti Unique id; store to refuse reuse.
sub The person’s pairwise sub for your app.
sid The session that ended (same sid as the id_token).
events {"http://schemas.openid.net/event/backchannel-logout": {}}

There is no nonce. If a nonce is present, reject it.

The request is a POST application/x-www-form-urlencoded with the logout_token field, headers Cache-Control: no-store and User-Agent: canverly-auth-backchannel/1. Only https with an absolute host and no user info in the URL.

  1. Validate signature (JWKS), iss, aud, exp (60 s skew), the event in events and the absence of nonce.
  2. Reject a jti already seen (keep it at least 2 minutes).
  3. End your app’s sessions with that sid (without sid, those of (iss, sub)).
  4. Reply 200 (or 204). Any response that is not 2xx counts as a delivery failure and triggers another attempt, including the 400 for a validation error.

Delivery has a 5-second timeout, does not follow redirects and only goes to a public IP. Outside production it uses the same policy as the events webhook: only hosts in OAUTH_WEBHOOKS_ALLOWLIST (up to 5) go out over the network, the others go to the log sink and the notice is not stamped as delivered; the hourly cap OAUTH_WEBHOOKS_MAX_POR_HORA also applies.

Retry differs from the webhook: back-channel makes 3 attempts, waiting 0, 2 and 10 seconds before each one, with at most 16 deliveries in flight. When the attempts run out, auth logs an error (oauth_backchannel_entrega_esgotada) and the metric oauth_backchannel_falhas_total. There is no durable queue: delivery runs in the background of the process, and the end of the session never fails because of the app. If your app is down for all three attempts, the notice is lost. So keep refreshing the id_token when you need recent proof.