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.
Authentication Flows
Section titled “Authentication Flows”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 & TOTP MFA
Section titled “WebAuthn Passkeys & TOTP MFA”- 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().
Device Sessions & Theft Detection
Section titled “Device Sessions & Theft Detection”When a member chooses “Remember this device”, Account issues an HTTP-only account_remember cookie containing a split selector.validator token:
- Only the
selectorand a cryptographic hash of thevalidatorare persisted inaccount-sessions. - Each automatic re-authentication rotates the validator atomically.
- 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_detectedevent toaccount-audit.
Revoking Sessions via CLI
Section titled “Revoking Sessions via CLI”# List active sessions for a specific userphp vendor/bin/wire account:sessions --user=claire --json
# Preview revoking all sessions for a userphp vendor/bin/wire account:sessions --user=claire --revoke-all --dry-run --json
# Force-revoke all active sessionsphp vendor/bin/wire account:sessions --user=claire --revoke-all --force --json