Implement passkey autofill (conditional UI) using mediation:'conditional' in navigator.credentials.get

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

Steps

  1. Add autocomplete='username webauthn' to the username input field so the browser can annotate the autofill dropdown with passkey suggestions.
  2. Check for conditional mediation support: call PublicKeyCredential.isConditionalMediationAvailable() and only proceed if it returns true.
  3. Call navigator.credentials.get({ publicKey: { challenge, rpId, userVerification }, mediation: 'conditional' }) on page load — this call does not show a modal; it resolves when the user selects a passkey from the autofill UI.
  4. Abort the conditional get before showing a traditional password form submit or if the user manually triggers a full-modal passkey prompt; use an AbortController signal.
  5. On resolution, perform the full server-side assertion verification — userHandle returned in the assertion identifies the user, eliminating the need for a username field.

Known gotchas

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