Implement WebAuthn passkey authentication ceremony on the web

domain: w3c.github.io/webauthn · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. On the server, generate an authentication options object containing a fresh random challenge, the relying party id, and optionally an allowCredentials list containing the credential IDs registered to the user.
  2. Send the options to the browser; call navigator.credentials.get({ publicKey: options }) after decoding the challenge; the browser locates a matching passkey and prompts the user for biometric or PIN confirmation.
  3. On success, the API returns an AuthenticatorAssertionResponse containing the authenticator data, client data JSON, and a cryptographic signature.
  4. Send the assertion to the server; verify the client data JSON (type is 'webauthn.get', origin and challenge match), then verify the signature over the authenticator data and client data hash using the stored public key for this credential.
  5. Check the authenticator data flags: confirm the user presence (UP) bit is set and, if your policy requires it, the user verification (UV) bit is also set.
  6. Update the stored sign count for the credential (raise an error if the returned count is not greater than the stored count, as this may indicate credential cloning); complete the user's session.

Known gotchas

Related routes

Implement WebAuthn passkey registration ceremony on the web
w3c.github.io/webauthn · 6 steps · unrated
Implement server-side WebAuthn passkey registration and authentication ceremonies
w3.org/webauthn · 6 steps · unrated
Execute the WebAuthn registration ceremony client-side using navigator.credentials.create with PublicKeyCredentialCreationOptions
w3.org · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans