Web Authentication (WebAuthn) is a W3C standard that enables passwordless authentication using public key cryptography. Passkeys are FIDO2 credentials that replace passwords with cryptographic key pairs, providing phishing-resistant authentication through biometrics, PINs, or security keys. Built on the Credential Management API, WebAuthn creates strong, device-bound credentials that are never transmitted to servers, fundamentally transforming how users authenticate on the web. The private key remains secure on the user's device while the public key is stored on the server, making credential theft and replay attacks nearly impossible.
What This Cheat Sheet Covers
This topic spans 16 focused tables and 125 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core WebAuthn API Methods
WebAuthn provides two primary API methods for credential lifecycle management. The navigator.credentials.create() method registers new passkeys during account creation or credential addition, while navigator.credentials.get() authenticates users with existing passkeys. Both methods return promises and trigger browser UI for user interaction with authenticators.
| Method | Example | Description |
|---|---|---|
const credential = await navigator.credentials.create({ publicKey: options}); | Creates a new passkey by generating a public/private key pair on the authenticator and returning a PublicKeyCredential containing the public key and attestation data for server storage. | |
const assertion = await navigator.credentials.get({ publicKey: options}); | Authenticates a user with an existing passkey by prompting for user verification and returning a signed assertion that proves possession of the private key. | |
const available = await PublicKeyCredential. isUserVerifyingPlatformAuthenticatorAvailable(); | Checks if the device has a built-in platform authenticator (like Touch ID or Windows Hello) capable of user verification before attempting passkey operations. | |
const caps = await PublicKeyCredential. getClientCapabilities(); | Returns browser capabilities including support for conditional UI, platform authenticators, and hybrid transport for cross-device authentication. |