Account self-service

Any authenticated principal can manage their own account without admin entity permissions: change their password, enroll / reset TOTP MFA, unlink external auth providers, and inspect or revoke their own active sessions. All account endpoints operate on the principal's home realm regardless of any X-Ipseity-Realm targeting header (a ipseity.super principal cannot use self-service to change another account).

These are "me" endpoints (/api/account...): they require an authenticated bearer token but no *.read/*.write/*.delete permission, matching the TO-DO item "account self-service".

Endpoints

For membership sessions, profile reads and session listing/revocation refer to the tenant membership. Change the home account's password, MFA, providers or email-verification state through its normal home login instead; tenant membership sessions cannot mutate those identity fields.

Method Path Purpose
GET /api/account The caller's profile: type, name, display name, given/family name, email + email_verified, mfa_enabled, has_password, external, and linked providers (name / display / enabled).
GET /api/account/sessions The caller's active sessions (refresh tokens): id, client_id, scope, realm, iat, exp, expires_in.
POST /api/account/password Change own password: {current_password, new_password} (new ≥ 8 chars). Verifies the current password; revokes all other sessions on success.
POST /api/account/mfa/enroll Start TOTP enrollment: {current_password}. Returns {secret, otpauth_uri, expires_in} (pending 10 min). Refuses when MFA is already enabled.
POST /api/account/mfa/confirm Finish enrollment: {code} verified against the pending secret, then enables MFA and revokes all sessions.
POST /api/account/mfa/reset Disable MFA: {current_password, code}. Requires a valid current MFA code, plus the current password when one is set. Revokes all sessions.
POST /api/account/providers/unlink Unlink an external provider: {provider}. Refuses when a passwordless account would be left with no sign-in path.
POST /api/account/sessions/revoke Revoke a session by {session_id}, or all when {all: true}. Returns the count for all.

Session model

A "session" is an active refresh token for the principal (issued via the authorization-code flow). Listing surfaces an opaque id (the token digest, never the raw token); revoking by id only works when the session belongs to the caller. Changing the password, enrolling or resetting MFA, and "revoke all" invalidate the principal's refresh tokens, forcing re-authentication on other devices.

Console sign-out also revokes its own refresh-token session, identified by the access token's sid, before clearing browser state. It uses the authenticated home-realm session endpoints and leaves other sessions active. If server revocation fails, the browser still signs out and reports the failure. Closing a tab does not revoke its session. Expired Kubernetes refresh-token records are swept on startup and every five minutes; Revoke All removes older unwanted sessions that are still within their configured lifetime (default 30 days).

Console

Open /realms/<your-realm>; the main realm also has the root / alias. Console clients are created automatically, and no identity read permissions are needed to sign in. See console access for routing and session details.

The sidebar gains an Account page (available to every signed-in principal, even one with no identity read access) with:

  • a profile summary and a "Send Verification Email" action;
  • a password-change form;
  • a TOTP MFA panel that shows the otpauth:// provisioning URI and a code field for confirm, or a reset form once enabled;
  • the principal's linked external providers with unlink buttons;
  • a table of active sessions with per-session revoke and a "Revoke All".

Notes

  • New self-service audit events are recorded: account.password.change, account.mfa.enroll/confirm/reset, account.provider.unlink, account.sessions.revoke.
  • MFA enrollment generates a fresh RFC 6238 base32 secret (app/oauth.generate_totp_secret) and provisioning URI (app/oauth.totp_otpauth_uri); the pending secret lives in the realm KV with a 10-minute TTL.