A password login asks a person to remember and submit a shared secret. A passkey uses a cryptographic key pair instead: the authenticator protects the private key, while the website stores the matching public key. During sign-in, the authenticator signs a fresh challenge and the server verifies the signature.

On the web, passkeys are implemented through the Web Authentication API (WebAuthn). The browser talks to an authenticator such as a phone, laptop security component or hardware security key. The website's backend remains responsible for issuing challenges, verifying responses and associating credentials with the correct account.

What a passkey does - and does not do

A passkey is a discoverable WebAuthn credential. It is scoped to a relying party identifier (RP ID), normally the website's domain, which helps prevent a credential created for one site from being used to authenticate to an impostor domain. The private key is not sent to the website; the server keeps the public key and credential metadata.

This changes the credential-theft problem. A database leak should not reveal users' passkey private keys, and users do not reuse a passkey across unrelated sites. But passkeys do not make an application automatically secure: a compromised account-recovery flow, weak session handling or an authorization bug can still expose accounts and data.

Important distinction

WebAuthn is the browser API and protocol surface. Passkeys are discoverable WebAuthn credentials designed for passwordless sign-in. A biometric prompt is not itself the passkey; it is one possible local user-verification method used by the authenticator.

The two ceremonies your application needs

1. Registration: create and store a credential

  1. The user signs in to an existing account and chooses to add a passkey. Do not let an unauthenticated visitor attach a new credential to an arbitrary account.
  2. The backend generates a cryptographically random, short-lived challenge and creates registration options containing the RP ID, user identity, supported algorithms and authenticator preferences.
  3. The browser calls navigator.credentials.create(). The authenticator creates the key pair and returns a credential response.
  4. The browser sends that response to the backend. A maintained WebAuthn server library verifies the challenge, expected origin, RP ID hash, credential data and signature/attestation requirements.
  5. After successful verification, store the credential ID, public key, user handle, sign-counter metadata where relevant, transports and backup flags. Enforce credential-ID uniqueness.

For passkeys, registration should request a discoverable credential: set residentKey to required (and the legacy requireResidentKey compatibility value where your library requires it). Discoverable credentials let the authenticator identify the account during a username-less sign-in.

2. Authentication: verify a signed challenge

  1. The backend creates a new, unpredictable challenge for this login attempt, binds it to the expected RP ID, origin and session context, and stores it with a short expiry.
  2. The browser calls navigator.credentials.get(). For username-less sign-in, the request can omit allowCredentials so the authenticator can offer available discoverable passkeys.
  3. The authenticator verifies the user locally when requested, then signs the challenge with the private key.
  4. The backend verifies the signature against the stored public key and checks the challenge, origin, RP ID hash, user-presence flag and any required user-verification flag.
  5. Only after all checks pass should the application create its normal authenticated session.

Never accept a successful-looking browser response as proof by itself. The backend must verify the cryptographic assertion and consume the challenge once so it cannot be replayed.

Backend checks that are not optional

The browser API does not replace server-side security. Treat the following as a release checklist, not optional hardening:

  • Fresh challenges: generate them with a cryptographically secure random source, make them single-use, bind them to the ceremony and expire them quickly.
  • Exact origin policy: compare the returned origin against an explicit allowlist. Do not accept arbitrary subdomains or derive trust from client-provided values.
  • RP ID validation: verify the RP ID hash and keep the configured RP ID consistent with the production domain. WebAuthn requires a secure context; use HTTPS in production.
  • Signature verification: verify the assertion using the public key stored for that credential. Also validate the credential belongs to the account being authenticated.
  • User verification policy: distinguish user presence from user verification. If policy requires PIN/biometric verification, request it and verify the returned UV flag.
  • Credential lifecycle: require recent authentication before adding or removing credentials, notify users about changes and revoke removed credentials immediately.

Use a maintained server-side implementation such as SimpleWebAuthn for JavaScript/TypeScript or an established library for your backend language. Do not hand-roll WebAuthn parsing or cryptographic verification. The OWASP Passkey Security Cheat Sheet provides a useful review checklist.

Account recovery is part of authentication

A passkey-only login can become a lockout system if the user loses their only authenticator. The WebAuthn specification recommends allowing multiple credentials for one account. Encourage users to register a second passkey on another device or a compatible roaming security key, and explain how synced passkeys depend on the user's credential-provider account.

Do not assume every passkey is backed up. WebAuthn exposes backup-eligibility and backup-state flags; they describe whether a credential can be backed up and whether it is currently backed up. They are not a substitute for user verification, and they should not be interpreted as proof of which provider stores the credential.

Recovery must be at least as carefully designed as sign-in. Use a separately protected recovery code, another registered authenticator or an identity process appropriate to the risk of the account. Avoid letting a weak email-only recovery path silently bypass a stronger passkey policy. After recovery, notify the user, review active sessions and revoke credentials that may be compromised.

A sensible rollout plan for a real product

  1. Start as an additional sign-in method. Let existing users add a passkey after a normal authenticated login. Keep the current login and recovery routes available while you learn from real usage.
  2. Build credential management. Show friendly device labels and registration dates, allow renaming and removal, and make the consequences of deleting the last credential clear.
  3. Test real device combinations. Test current browsers, iOS and Android, desktop platform authenticators, security keys, cross-device sign-in, synced credentials and the case where a user has no available passkey.
  4. Monitor failures without collecting secrets. Record ceremony outcomes and useful error categories, but do not log raw challenges, full credential responses, private data or unnecessary credential identifiers.
  5. Promote passwordless use gradually. Consider removing passwords only after recovery, backup credentials, support processes and account-takeover monitoring have been tested.

For static websites hosted on GitHub Pages, the browser can display a passkey interface, but a secure implementation still needs a trusted backend to create challenges, store public keys and verify assertions. A static HTML page alone cannot safely implement a complete passkey login. That backend can be a serverless function or an authentication provider with WebAuthn support.

The practical takeaway

Passkeys reduce phishing and password-reuse risks when they are implemented correctly, but the hard work is not the biometric prompt. It is the server-side verification, credential-to-account binding, session creation and recovery design around it. Build those controls first, use a maintained WebAuthn library, and roll passkeys out as an additional method before making them the only way into an account.

Primary references and further reading

Reviewed by the Raazim Tech editorial desk. Technical guidance checked against the linked standards and security references on December 1, 2026.