Skip to content

Authentication, Sessions & MFA

Account supports password-based authentication alongside modern passwordless and hardware-backed sign-in flows. All authentication screens and JSON actions enforce ProcessWire CSRF validation, rate limiting, and AccountGuard role restrictions.

Route (Default Prefix /auth) Purpose
/auth/login Email/username + password sign-in, WebAuthn Passkey Conditional UI autofill, and OAuth provider buttons.
/auth/register Open, verified, approval-gated, or invite-only registration according to your policy.
/auth/magic Passwordless Magic Link + 6-digit OTP request and verification (supports browser WebOTP autofill).
/auth/verify Email address verification via signed token or 6-digit code.
/auth/forgot & /auth/reset Time-limited password recovery and reset flow.
/auth/mfa Second-factor challenge for TOTP authenticator apps and recovery codes.
/auth/oauth/{slug} & /auth/oauth/{slug}/callback OAuth 2.0 / OIDC authorization redirect and state-verified callback linking to account-identities.
  • WebAuthn Passkeys: Stored in account-credentials. Account supports both usernameless/discoverable Passkeys with browser Conditional UI (autocomplete="webauthn") and named security keys enrolled from /account/security.
  • TOTP MFA: Generates RFC 6238 secrets, QR provisioning URIs, and single-use backup codes. Sensitive actions (adding or removing credentials, changing email/password, deleting an account) require an active sudo window verified via $account->hasActiveSudo().

When a member chooses “Remember this device”, Account issues an HTTP-only account_remember cookie containing a split selector.validator token:

  1. Only the selector and a cryptographic hash of the validator are persisted in account-sessions.
  2. Each automatic re-authentication rotates the validator atomically.
  3. If an attacker replays a previously rotated validator for an existing selector, Account revokes all active sessions for that member and writes a locked account.session.theft_detected event to account-audit.
Members manage their own devices at /account/sessions while administrators can audit or revoke sessions from Setup -> Account -> Sessions or via account:sessions CLI.
Terminal window
# List active sessions for a specific user
php vendor/bin/wire account:sessions --user=claire --json
# Preview revoking all sessions for a user
php vendor/bin/wire account:sessions --user=claire --revoke-all --dry-run --json
# Force-revoke all active sessions
php vendor/bin/wire account:sessions --user=claire --revoke-all --force --json

Next steps