Skip to main content

Passkeys

Imported component documentation. Source: melodee-project/melodee-auth-ui at commit 0bf9bd04697609fc3d8b82eb933b1d1d29e84059. Version 2026.11.0-rc.0. License MIT. Status: A0–A10 implemented and verified on a disposable real API 1.0.0 stack; not published, tagged or deployed. This is the component's committed documentation, not proof of a distribution release or production qualification.

Melodee supports passkeys as one sign-in and step-up method. The Auth UI uses the native browser WebAuthn API and server-issued ceremonies. The API verifies signatures, origin, RP ID, challenge, counter and user handle. The UI performs only base64url conversion and native calls.

What users can do​

  • Sign in with a discoverable passkey from /auth/login without entering an email address.
  • Enroll a passkey from /auth/account/passkeys with an explicit action.
  • Give it a recognisable label, or clear the label.
  • See creation and last-used timestamps, transports and backup state.
  • Remove a passkey with a two-step confirmation.
  • Satisfy a sensitive-action recent-auth challenge with a genuine passkey assertion from the step-up dialog.

The API protects the last usable authentication path with 409 last_usable_path. The UI explains this; it does not bypass it. The UI never displays or stores protected-object identifiers, raw credential IDs, user handles or challenge bytes.

Enrollment​

  1. Sign in with a recent session.
  2. Open /auth/account/passkeys.
  3. Choose Add a passkey.
  4. Approve with this device, a security key or a nearby authenticator.
  5. Label it so you can recognize it later.

A stale session returns 403 reauthentication_required; the step-up dialog offers a passkey or email re-authentication and retries only after success. Cancellation creates nothing. The ceremony is one-time; a replay is rejected.

Sign-in​

  1. Open /auth/login.
  2. Choose Sign in with a passkey.
  3. Select the passkey when the browser prompts.
  4. The API sets only HttpOnly session and CSRF cookies; the UI navigates to the account or the safe continuation route.

The flow cookie is HttpOnly and path-scoped; the browser never reads it or a session bearer.

Step-up​

A sensitive API operation may return 403 reauthentication_required. The dialog starts a server step-up ceremony; the assertion refreshes the current session's freshness. The UI then rotates the cookie once and retries the original action. Email re-authentication is the fallback. A stale step-up cannot be replayed.

Capability and storage prerequisites​

GET /api/v1/auth/capabilities reports:

  • enabled — WebAuthn is configured;
  • rpId / origin — the exact browser origin and RP the passkey is bound to;
  • protectedStorageWritable — whether a writable API volume can hold the protected public-key object.

If protected storage is not writable, existing passkeys may still sign in, but the UI disables Add a passkey and explains the operator prerequisite.

Configuration​

API:

MELODEE_WEBAUTHN_RP_ID=example.test
MELODEE_WEBAUTHN_ORIGIN=https://auth.example.test
MELODEE_WEBAUTHN_RP_NAME="Melodee"
# optional authenticator AAGUID allowlist
MELODEE_WEBAUTHN_ALLOWED_AAGUIDS=...

The RP ID and origin must match the browser origin exactly. The API needs a writable storage volume for protected objects; never place binary credential objects in PostgreSQL.

Qualification boundary​

Automated evidence uses Chromium's virtual authenticator. Physical security keys, platform biometrics, synchronized passkey providers (iCloud/Google Password Manager), Android/iOS devices, roaming authenticators and protected-object restore/recovery are not qualified. A green virtual-authenticator run is not a hardware or synced-provider claim.