This checklist is for developers adding passkeys or hardware security keys to a web application. It assumes you will use a maintained WebAuthn library on the server, such as SimpleWebAuthn (TypeScript), python-fido2 or java-webauthn-server, rather than parsing CBOR yourself. You can try every option below in the WebAuthn Playground.
1. Choose the relying party ID once
The RP ID is the domain a credential belongs to, and it cannot be changed later without re-enrolling every user.
- Use your registrable domain (
example.com) if sign-in may move between subdomains; use the exact host (app.example.com) to keep credentials narrow. - The page’s origin must be the RP ID or a subdomain of it, served over HTTPS.
- If you run several domains, prefer one central sign-in site. Related Origin Requests, a
/.well-known/webauthnfile listing allowed origins, lets other domains use your RP ID in browsers that support it, but plan a fallback for those that do not.
See relying party IDs and domains for how this site scopes its test credentials.
2. Make every challenge single-use
- Generate at least 16 random bytes on the server for each ceremony.
- Store it with the session, an expiry of a few minutes and the ceremony type (registration or authentication).
- Delete it when the response arrives, before you verify, so a failed attempt cannot be retried with the same challenge.
- Verify the exact origin, RP ID hash and challenge in every response. Your library does this if you pass the expected values; do not skip them in staging.
3. Decide what user verification means for you
User presence (a touch) and user verification (a PIN or biometric) are different. UV explained.
preferredis a sensible default for consumer sign-in.- Use
requiredfor admin, finance or step-up actions, and enforce it on the server by checking the UV flag. The request option alone is not a control. - Record whether UV happened with each sign-in; it is useful evidence for audits.
4. Store only what you need
A credential record needs the credential ID, public key, signature counter, user handle, transports, backup flags and timestamps. Public keys are not secrets, so a leaked credential table cannot be used to sign in, but keep it as protected as any user data.
- Use a random user handle (up to 64 bytes) that is not an email address or account number. It is stored on the authenticator and returned in discoverable sign-ins.
- Allow several credentials per account, and show users a list they can name and remove.
5. Support discoverable and non-discoverable sign-in
- Discoverable (username-less) sign-in: request
residentKey: 'required'or'preferred'at registration and use an emptyallowCredentialslist. Read the account from the returned user handle. - Autofill: conditional mediation lets the browser offer passkeys in the username field. Feature-detect it and keep a normal button as a fallback.
- Second-factor use: after a password, pass the user’s credential IDs in
allowCredentials. Security keys with limited storage work best this way.
6. Treat the signature counter as a hint
Many authenticators, including synced passkeys, always report 0. If a counter that was increasing goes backwards, flag the credential for review rather than silently accepting it.
7. Use attestation only when you will act on it
- For consumer apps, request
attestation: 'none'. Asking for more adds prompts and privacy questions and gives you nothing you will use. - For enterprise policies such as “only approved hardware keys”, request
directattestation, validate it against the FIDO Metadata Service, and decide in advance what happens when a model is not on your list. - The AAGUID alone is self-reported unless the attestation is verified. What attestation can and cannot tell you.
8. Plan recovery before launch
Most account-takeover risk moves to recovery once passkeys are in place.
- Encourage a second passkey or a backup security key during enrolment.
- Make recovery at least as strong as the sign-in it replaces. An emailed link that resets a passkey account undoes the protection.
- For staff, use a verified reset by an administrator, not self-service. Recovering from a lost key.
9. Keep providers in sync with the Signal API
When a user deletes a passkey on your site, the passkey provider may keep offering it. The WebAuthn Signal API lets you tell supporting providers which credentials no longer exist (signalUnknownCredential), which are still accepted (signalAllAcceptedCredentials) and when a user’s name changed (signalCurrentUserDetails). Feature-detect each method and treat it as best effort.
10. Test with real authenticators
Test at least one synced passkey (phone or password manager), one platform authenticator and one hardware key, on two operating systems. Include: a cancelled prompt, a timeout, registering the same key twice, a key without a PIN when UV is required, and sign-in from a second device. Our Security Key Tester and Passkey Checker help confirm what each device supports.
Where to go deeper
Yubico’s developer site, the W3C specification and passkeys.dev cover each topic in detail; they are listed in the references below. For developer features of newer hardware, such as the PRF extension used for passkey-based encryption, try the PRF option in the WebAuthn Playground.