OIDC single logout, consent, and rate limiting

This document covers the last three platform features: OIDC front/back-channel single logout, the per-client consent screen, and configurable per-IP/per-client rate limiting.

OIDC single logout

Clients may register logout endpoints in addition to their redirect URIs:

  • frontchannel_logout_uri — a page on the client that clears the user's session in the browser. During single logout Ipseity renders an HTML page that frames this URI in a hidden iframe with iss and sid query parameters, then redirects the browser to post_logout_redirect_uri (or shows a signed-out message).
  • backchannel_logout_uri — a server-side endpoint on the client. During single logout Ipseity POSTs an OIDC Back-Channel Logout token (a JWT signed by Ipseity containing sub, sid, events and aud) to this URI so the client can revoke server-side state even when the user's browser has already left.

Both are optional; a client that defines neither simply participates in Rp-initiated logout via post_logout_redirect_uri.

A session counts as "the user being logged out" when the logout request carries an id_token_hint (the user's id_token). Ipseity:

  1. decodes the hint to find the principal and home realm,
  2. enumerates the principal's active sessions to find every client with an active refresh-token session,
  3. revokes all the principal's refresh tokens (its SSO sessions),
  4. POSTs back-channel logout tokens to every involved client advertising a backchannel_logout_uri,
  5. renders front-channel iframes for every involved client advertising a frontchannel_logout_uri, and then
  6. redirects to post_logout_redirect_uri when one was validated against the requesting client's redirect rules.

The discovery document advertises frontchannel_logout_supported and backchannel_logout_supported.

Clients may set require_consent. When enabled, after the user successfully authenticates in the authorization-code flow (password or external provider login) Ipseity renders a consent screen naming the client and the requested scopes instead of immediately issuing an authorization code.

  • Approve issues the code and remembers the grant for the principal + client for the refresh-token TTL, so subsequent identical (or narrower) scope requests for that client skip the prompt.
  • Deny redirects to the client's redirect_uri with error=access_denied (preserving state).

The pending consent record lives in the realm KV under a one-time random token (TTL IPSEITY_CONSENT_TTL_SECONDS, default 300s) and is consumed on the decision (POST /oauth/authorize/consent). Consent is scoped to the client: the internal UI client has no flag set, so the console itself is unaffected.

Rate limiting

/oauth/authorize and /oauth/token optionally enforce sliding-window limits per source IP and per client:

Config Default Meaning
IPSEITY_RATE_LIMIT_IP_MAX 0 (disabled) Max requests per source IP in the window
IPSEITY_RATE_LIMIT_IP_WINDOW_SECONDS 60 Windowing period for the IP limit
IPSEITY_RATE_LIMIT_CLIENT_MAX 0 (disabled) Max requests per client_id in the window
IPSEITY_RATE_LIMIT_CLIENT_WINDOW_SECONDS 60 Windowing period for the client limit

When a request exceeds a limit the endpoint returns 429 Too Many Requests. Limits are per-process and best-effort (the service typically runs with a small replica count behind a load balancer), complementing the persistent per-principal login lockout stored in the realm KV.