Passkeys: the registration page (#334) #469

Merged
jcoffey-dev merged 1 commits from feat/334-passkey-register into main 2026-11-19 03:27:22 +00:00
Owner

Part of #334. Step 2 of 4 in docs/spec/features/passkeys.md (PK-6 to PK-8).

  • /passkey/register?ticket= served by the server, next to the login page (same look, logo and theme).
  • The page asks for the password (plus the TOTP code when the account has one) before the browser's passkey dialog, so a stolen session token can't finish a registration.
  • POST /api/passkey/register, anonymous and limited like /api/auth: start checks ticket + password through the normal sign-in path and returns the WebAuthn options (discoverable, UV required, attestation none, existing passkeys excluded); finish verifies and turns the passkey active. The step between waits in the in-memory store (prefix 203), good once, any node.
  • RP id = host of the public URL; that URL is the only origin. A credential id registered before is refused. Per-account random user handle.
  • webauthn-rs 0.6.2 + webauthn-rs-proto. Licenses checked by hand: webauthn-rs family and crypto-glue MPL-2.0, the other 37 new crates MIT/Apache-2.0; no OpenSSL in the build.
  • Spec: algorithm list now ES256, ES384, RS256 (what webauthn-rs tests); status updated. The "or an active passkey" part of PK-8 comes with sign-in (step 3).

Tests: system test system::passkeys::passkey_tests now registers with a software authenticator (wrong password, no start, bad ticket, wrong origin, success with flags and transports, ticket reuse, duplicate credential id) and passes locally; the test server can take a host name for its public URL. Page gzip-sync test, fmt, fork checks and cargo test --workspace --locked --no-run are clean.

Part of #334. Step 2 of 4 in `docs/spec/features/passkeys.md` (PK-6 to PK-8). - `/passkey/register?ticket=` served by the server, next to the login page (same look, logo and theme). - The page asks for the password (plus the TOTP code when the account has one) before the browser's passkey dialog, so a stolen session token can't finish a registration. - `POST /api/passkey/register`, anonymous and limited like `/api/auth`: `start` checks ticket + password through the normal sign-in path and returns the WebAuthn options (discoverable, UV required, attestation none, existing passkeys excluded); `finish` verifies and turns the passkey active. The step between waits in the in-memory store (prefix 203), good once, any node. - RP id = host of the public URL; that URL is the only origin. A credential id registered before is refused. Per-account random user handle. - webauthn-rs 0.6.2 + webauthn-rs-proto. Licenses checked by hand: webauthn-rs family and crypto-glue MPL-2.0, the other 37 new crates MIT/Apache-2.0; no OpenSSL in the build. - Spec: algorithm list now ES256, ES384, RS256 (what webauthn-rs tests); status updated. The "or an active passkey" part of PK-8 comes with sign-in (step 3). Tests: system test `system::passkeys::passkey_tests` now registers with a software authenticator (wrong password, no start, bad ticket, wrong origin, success with flags and transports, ticket reuse, duplicate credential id) and passes locally; the test server can take a host name for its public URL. Page gzip-sync test, fmt, fork checks and `cargo test --workspace --locked --no-run` are clean.
jcoffey-dev added 1 commit 2026-11-19 03:14:08 +00:00
Passkeys: the registration page (#334)
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 12m46s
138178c85b
Second part of passkeys (docs/spec/features/passkeys.md, PK-6 to PK-8).
The server now serves /passkey/register, the page an inbuxa:Passkey
create's registrationUrl opens, next to the login page.

The page asks for the account's password, and its TOTP code when it has
one, before the browser's passkey dialog: a stolen session token can
start a registration but not finish one. It posts to
/api/passkey/register in two steps. "start" checks the ticket and the
password through the usual sign-in path (limits and failure counting
included) and answers with the WebAuthn options: a discoverable
credential, user verification required, attestation none, the account's
existing passkeys excluded. "finish" checks what the browser made and
turns the passkey active. What "start" began waits in the in-memory
store, so any node can finish it, and is good once.

The relying-party id is the host of the server's public URL, and that
URL is the only origin accepted. A credential id already registered to
any account is refused. Each account gets a random user handle the
first time it registers one, for sign-in to find it by.

The WebAuthn checks come from webauthn-rs 0.6.2 (MPL-2.0; its new
dependencies are MIT or Apache-2.0, crypto-glue MPL-2.0; no OpenSSL).
It tests ES256, ES384 and RS256, so the spec's algorithm list now says
those.

The "or an active passkey" of PK-8 arrives with passkey sign-in.
jcoffey-dev merged commit 06069a00ed into main 2026-11-19 03:27:22 +00:00
jcoffey-dev deleted branch feat/334-passkey-register 2026-11-19 03:27:23 +00:00
Sign in to join this conversation.