Third part of passkeys (docs/spec/features/passkeys.md, PK-8 to PK-12). The login page offers passkeys in the authorization-code flow: the browser's autofill on the username field where it supports conditional mediation, and a "Sign in with a passkey" button. Each try asks POST /api/auth/passkey for a challenge (anonymous and limited like the login request), kept in the in-memory store for two minutes and good once, so any node can answer the next step. The login request then carries the browser's assertion in a new passkey field in place of the name and password. The server finds the passkey by credential id and the account by user handle, and both must agree. It checks the signature, the origin, user verification, that the passkey was made for the current relying-party id, and the counter: one that didn't go up fails and is logged as a possibly cloned passkey. Then the same checks run as for a password: a locked account fails the same way, and the client, redirect URI and PKCE checks are unchanged. A passkey signs in on its own, with no TOTP code after it. Failures count toward the same sign-in blocking as wrong passwords. A successful sign-in keeps the new counter and lastUsedAt, raises auth.success with type passkey, and is recorded in the audit log with via passkey where sign-ins are recorded. The registration page now takes one of the account's active passkeys instead of the password, and refuses an app password. The device flow, the settings and the external-directory rule follow in the last part.
11 KiB
11 KiB