Execute the WebAuthn registration ceremony client-side using navigator.credentials.create with PublicKeyCredentialCreationOptions

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

Steps

  1. Fetch a server-generated, cryptographically random challenge (at least 16 bytes) from your backend; never generate the challenge client-side.
  2. Construct PublicKeyCredentialCreationOptions with rp.id set to a registrable domain suffix of the current origin, user.id as an opaque byte array (not PII), pubKeyCredParams listing preferred algorithms (e.g. ES256, RS256), and authenticatorSelection specifying residentKey, userVerification, and authenticatorAttachment as needed.
  3. Call navigator.credentials.create({ publicKey: options }) and await the PublicKeyCredential response.
  4. Extract response.rawId, response.response.clientDataJSON, response.response.attestationObject, and response.response.transports from the returned credential.
  5. Send these values base64url-encoded to the server; the server must parse clientDataJSON, verify type is 'webauthn.create', verify the challenge matches and is single-use, check origin, and decode the CBOR attestation object to extract the COSE public key and store it.
  6. Record the credential ID and public key (plus the aaguid and sign counter) persistently so subsequent authentication assertions can be verified.

Known gotchas

Related routes

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

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

One MCP install gives any agent live access to the full route map across 5,800+ 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