WebAuthn vs passkey: what each name means, and what your server stores

Four names for one sign-in. Here is which part each one names, and what reaches your server.

On this page
  1. WebAuthn vs passkey: the short answer
  2. What WebAuthn is
  3. What FIDO2 and CTAP add
  4. What makes a credential a passkey
  5. Synced and device-bound passkeys
  6. User presence and user verification
  7. Attestation, and why most sites skip it
  8. Passkey autofill: conditional UI
  9. What your server stores
  10. Register and sign in with a passkey in Go
  11. FAQ
  12. Key takeaways

WebAuthn vs passkey: the short answer

WebAuthn and passkeys aren’t competing technologies. WebAuthn is an API, and a passkey is a kind of credential that the API creates.

  • WebAuthn (Web Authentication) is a W3C standard. It defines the browser API that your page calls, navigator.credentials.create() and navigator.credentials.get(), and the checks your server runs on what comes back (W3C WebAuthn Level 3).
  • CTAP (Client to Authenticator Protocol) is a FIDO Alliance standard. The browser or operating system uses it to talk to the authenticator: a security key over USB or NFC, or a phone over Bluetooth.
  • FIDO2 is the name for the pair. The FIDO Alliance calls the standards behind passkeys “commonly known as FIDO2 (WebAuthn and CTAP)” (FIDO Alliance).
  • A passkey is the credential itself: a key pair that the authenticator can find without your server naming it. WebAuthn Level 3 lists “passkey” as another name for a discoverable credential.

Pick a name to see which part of a sign-in it covers:

Pick a name to see which part of a sign-in it covers

WebAuthn is the W3C browser API your page calls, navigator.credentials.create() and get(), plus the checks your server runs on the response.

CTAP is the FIDO Alliance protocol between the browser or operating system and the authenticator, over USB, NFC, Bluetooth, or a phone. Your server never speaks it.

FIDO2 is the name for the pair: WebAuthn plus CTAP, end to end.

A passkey is not a protocol. It is the credential itself: a discoverable key pair the authenticator keeps, often synced by a password manager.

Your server, the browser, and the authenticator that holds the passkey. WebAuthn covers the first two, CTAP the last two, and FIDO2 all three.

So “are passkeys WebAuthn?” has a precise answer: on the web, every passkey is a WebAuthn credential, but not every WebAuthn credential is a passkey. A security key registered as a second factor, which the server must name before the key can use it, is a WebAuthn credential that isn’t discoverable, and so isn’t a passkey.

What WebAuthn is

WebAuthn is a W3C Recommendation. Level 3 was published on 25 August 2026, succeeding Level 2 from 2021 (W3C). It defines two ceremonies:

  1. Registration. Your server sends options with a random challenge. The page calls navigator.credentials.create(). The authenticator makes a key pair for your site, keeps the private key, and returns the public key, signed data, and a credential ID. Your server checks the response and stores the public key.
  2. Authentication. Your server sends a fresh challenge. The page calls navigator.credentials.get(). The authenticator signs the challenge with the private key, and your server checks the signature against the stored public key.

The browser puts the page’s origin into the signed data, and the authenticator scopes each key to a relying party ID, your registrable domain, such as example.com. A look-alike domain gets no signature for your site, because the browser won’t use your site’s keys there. This is why WebAuthn credentials resist phishing: the person can’t hand the credential to the wrong site, even by mistake.

Your server never sees a secret. It stores a public key, which is useless to anyone who steals your database.

What FIDO2 and CTAP add

CTAP is the wire protocol between the client (the browser or the operating system) and the authenticator. The FIDO Alliance publishes it: CTAP 2.3 became a Proposed Standard on 26 February 2026 (FIDO Alliance specifications).

You don’t implement CTAP in a web app. The FIDO Alliance says so directly: authenticators and client platforms implement CTAP, not relying parties (FIDO Alliance). Your server speaks WebAuthn’s JSON to the page, and the browser handles everything below it. CTAP explains the transports you see in a credential, such as usb, nfc, ble, hybrid (a phone that scans a QR code), and internal (the device’s own authenticator).

“FIDO2” is useful when you buy hardware or read an enterprise policy. In application code, you work with WebAuthn.

What makes a credential a passkey

A credential is discoverable when the authenticator stores enough to find it without help. Then your server can call get() with an empty allowCredentials list, and the authenticator offers every credential it holds for your site. The spec puts it this way: the relying party “does not necessarily need to first identify the user” (W3C WebAuthn Level 3, terminology).

That is the passkey experience: no username field, no password, one prompt. For the authenticator to return the account, it stores a user handle with the key: an opaque value of at most 64 bytes, which “MUST NOT contain personally identifying information” (same source). The authenticator returns it in response.userHandle, and your server looks up the account by it.

To ask for a discoverable credential, set authenticatorSelection.residentKey to "required" in the creation options. “Resident key” is the old name; the spec marks it deprecated but keeps it in the API.

Native apps create the same credentials through platform APIs, such as Android’s Credential Manager on Android 9 and later (Google for Developers).

Synced and device-bound passkeys

The FIDO Alliance names two kinds of passkey (FIDO Alliance):

  • Synced passkeys copy the private key to the person’s other devices through a cloud service. Apple syncs them in iCloud Keychain, which is end-to-end encrypted (Apple). Google Password Manager syncs them across Android and Chrome, also end-to-end encrypted (Google for Developers). On Windows 11, passkeys saved with Windows Hello stay on the device, and plugin providers such as Microsoft Password Manager sync theirs (Microsoft Learn).
  • Device-bound passkeys never leave one authenticator, such as a FIDO security key.

Your server can tell which kind it has. The authenticator data carries two flag bits defined in WebAuthn Level 3, section 6.1:

  • BE (backup eligible), bit 3. The authenticator may sync this credential. It is set when the credential is created and never changes.
  • BS (backup state), bit 4. The credential is synced at this moment. It can change over time.
Question Synced passkey Device-bound passkey
BE flag 1 0
Survives a lost phone Yes, from the cloud keychain No: register a second key or keep recovery codes
Where the private key lives Every device in the person’s account, and the provider’s encrypted backup One authenticator
Signature counter Can’t detect clones: the key is meant to be on several devices A value that goes backwards suggests a cloned key
Typical use Consumer sign-in Workforce and high-assurance accounts

The signature counter is the subtle row. The spec says its purpose is “to aid Relying Parties in detecting cloned authenticators” (section 6.1.1). A synced passkey is a copy by design, so treat a counter problem on a backup-eligible credential as a signal to log, not a reason to lock the person out.

User presence and user verification

Every WebAuthn response carries two more flags:

  • UP (user present), bit 0. Someone touched the key or tapped a button.
  • UV (user verified), bit 2. The authenticator checked who that someone is, with a fingerprint, a face, or a device PIN. The check happens on the device, and the biometric never reaches your server (Microsoft Learn).

When you set userVerification: "required" and your server confirms the UV flag, one passkey prompt proves two factors: something the person has (the device with the key) and something they are or know (the biometric or PIN). The spec lists the check among the authentication steps: when user verification is required, “verify that the UV bit of the flags in authData is set.”

The default is "preferred", which lets the authenticator skip verification. Then a passkey proves possession only. If you treat passkey sign-in as multi-factor, require verification, and check the flag on your server, not only in the options.

Attestation, and why most sites skip it

Attestation is a signed statement from the authenticator’s maker about the authenticator’s model. WebAuthn defines it as evidence “to provide verifiable evidence as to the origin of an authenticator and the data it emits.” The model is named by an AAGUID, a 128-bit identifier.

The default attestation preference is "none", and for most sites that is the right choice:

  • Synced passkeys usually carry none. Google’s guide states that passkeys on Android and Apple platforms don’t support attestation as of March 2024 (web.dev).
  • An AAGUID without attestation is a hint. The same guide warns that the AAGUID “can be modified or manipulated unless attestation is attached with a valid signature.” Use it to label a passkey “iCloud Keychain” in the person’s list, not to make a security decision.

Request "direct" or "enterprise" attestation when a policy requires specific hardware, such as only FIPS-certified security keys for administrators. Then you also need the FIDO Metadata Service to check the statement against the maker’s root certificates.

Passkey autofill: conditional UI

A sign-in page has to serve people with and without passkeys. Conditional mediation, often called conditional UI or passkey autofill, puts passkeys in the browser’s autofill list on the username field instead of opening a modal prompt:

  1. Mark the field with autocomplete="username webauthn". The spec requires webauthn to come after the last ordinary token.
  2. Check PublicKeyCredential.isConditionalMediationAvailable().
  3. Call navigator.credentials.get() with mediation: "conditional" when the page loads. The promise waits until the person picks a passkey from autofill.
  4. Before you start any other ceremony, such as a “Sign in with a passkey” button, abort the pending request with its AbortController. Otherwise the second call fails.

The browser APIs around passkeys arrived at different times. These are the first versions with each feature, from MDN’s browser compatibility data on 23 November 2026 (MDN):

Feature Chrome and Edge Firefox Safari
Passkey autofill 108 119 16
JSON helpers 129 119 18.4
Capabilities check 133 135 17.4
Signal API 132 No 26
Hints 128 No No

Autofill is detected by isConditionalMediationAvailable(). The JSON helpers are parseCreationOptionsFromJSON(), parseRequestOptionsFromJSON(), and toJSON(). The capabilities check is getClientCapabilities(). The Signal API, such as signalUnknownCredential(), tells the password manager that a passkey was removed. Hints are the hints option, such as "security-key", in creation and request options.

Chrome’s own documentation confirms autofill from Chrome 108 (Chrome for Developers). Autofill also depends on the operating system and the password manager, so test isConditionalMediationAvailable() at run time instead of the version.

What your server stores

WebAuthn Level 3 lists what a relying party stores for each credential, the credential record:

Field What it is Why you need it
id The credential ID, up to 1,023 bytes Finds the record at sign-in
publicKey The public key, in COSE format Checks every signature
signCount The last signature counter Detects cloned device-bound keys
transports From getTransports() at registration Tells the browser how to reach the key later
uvInitialized Whether the UV flag has ever been set Says whether the UV flag counts as a factor
backupEligible, backupState The BE and BS flags Tell synced from device-bound passkeys

The attestation object and the client data from registration are optional. Store them only if you plan to re-check attestation later.

Two more things live on the server but outside the record:

  • The user handle. Make it random, not your user ID or an email address, and keep a table from handle to account.
  • The challenge. Store each challenge on the server, use it once, and expire it in minutes. A challenge that a client can replay, or that lives only in a cookie the client controls, undoes the protocol’s freshness guarantee.

Register and sign in with a passkey in Go

The passkey package in tensile-auth runs both ceremonies on go-webauthn. It takes positions on each choice above:

  • Every passkey is discoverable, and every ceremony requires user verification. The options set residentKey: "required" and userVerification: "required", and the server rejects a response without the UV flag, so a passkey alone counts as multi-factor.
  • Attestation is "none". The library stores the BE and BS flags for each passkey instead.
  • Sign-in takes no username. BeginLogin names no account, so its response never reveals whether an account exists.
  • Challenges live on the server. Each ceremony is stored by the SHA-256 of its challenge, used once, and expires after 5 minutes by default.
  • User handles are 64 random bytes, never the user ID.
  • Clones are handled by kind. When a device-bound passkey’s counter goes backwards, sign-in is refused by default and the event is recorded as passkey_clone_suspected. A synced passkey is only flagged.

This server registers a person and signs them in. It compiles against the library’s main branch on 23 November 2026, and a test drives it through a virtual authenticator:

package main

import (
	"crypto/rand"
	"io"
	"log"
	"net/http"
	"time"

	auth "tensile.tools/auth"
	"tensile.tools/auth/authhttp"
	"tensile.tools/auth/memstore"
	"tensile.tools/auth/passkey"
)

func main() {
	h, err := newHandler("localhost", "http://localhost:8080")
	if err != nil {
		log.Fatal(err)
	}
	srv := &http.Server{Addr: "localhost:8080", Handler: h, ReadHeaderTimeout: 10 * time.Second}
	log.Fatal(srv.ListenAndServe())
}

// newHandler serves registration and sign-in for one relying party.
func newHandler(rpID, origin string) (http.Handler, error) {
	store := memstore.New() // use pgstore or sqlitestore in production
	svc, err := auth.New(store)
	if err != nil {
		return nil, err
	}
	pk, err := passkey.New(svc, store, passkey.Config{
		RPID:    rpID,             // the registrable domain
		RPName:  "Example",        // shown by some authenticators
		Origins: []string{origin}, // exact origins allowed to run ceremonies
	})
	if err != nil {
		return nil, err
	}

	mux := http.NewServeMux()

	// Registration, step 1: options for navigator.credentials.create().
	mux.HandleFunc("POST /register/begin", func(w http.ResponseWriter, r *http.Request) {
		user := auth.UserID("u_" + rand.Text()) // your users table's ID
		binding := rand.Text()                  // ties the ceremony to this browser
		name := r.FormValue("name")
		opts, err := pk.BeginFirstRegistration(r.Context(), user,
			passkey.User{Name: name, DisplayName: name, Label: "First passkey"}, binding)
		if err != nil {
			http.Error(w, "can't start registration", http.StatusBadRequest)
			return
		}
		http.SetCookie(w, &http.Cookie{Name: "__Host-reg", Value: binding, Path: "/",
			MaxAge: 300, Secure: true, HttpOnly: true, SameSite: http.SameSiteStrictMode})
		writeJSON(w, opts)
	})

	// Registration, step 2: verify the new credential, store it, sign in.
	mux.HandleFunc("POST /register/finish", func(w http.ResponseWriter, r *http.Request) {
		ck, err := r.Cookie("__Host-reg")
		if err != nil {
			http.Error(w, "start again", http.StatusBadRequest)
			return
		}
		body, _ := io.ReadAll(http.MaxBytesReader(w, r.Body, 64<<10))
		_, proof, err := pk.FinishRegistration(r.Context(), ck.Value, body)
		if err != nil {
			http.Error(w, "that didn't work", http.StatusUnauthorized)
			return
		}
		startSession(w, r, svc, proof)
	})

	// Sign-in, step 1: options for navigator.credentials.get(). No username.
	mux.HandleFunc("POST /signin/begin", func(w http.ResponseWriter, r *http.Request) {
		opts, err := pk.BeginLogin(r.Context(), passkey.LoginOptions{
			Conditional: r.URL.Query().Has("autofill"), // mediation: "conditional"
		})
		if err != nil {
			http.Error(w, "can't start sign-in", http.StatusTooManyRequests)
			return
		}
		writeJSON(w, opts)
	})

	// Sign-in, step 2: check the signature against the stored public key.
	mux.HandleFunc("POST /signin/finish", func(w http.ResponseWriter, r *http.Request) {
		body, _ := io.ReadAll(http.MaxBytesReader(w, r.Body, 64<<10))
		proof, err := pk.FinishLogin(r.Context(), body)
		if err != nil {
			http.Error(w, "that didn't work", http.StatusUnauthorized)
			return
		}
		startSession(w, r, svc, proof)
	})

	// The middleware reads the session cookie and refuses cross-site requests.
	return authhttp.Middleware(svc)(mux), nil
}

// startSession turns a passkey proof into a session cookie.
func startSession(w http.ResponseWriter, r *http.Request, svc *auth.Service, proof auth.Proof) {
	tok, p, err := svc.StartSession(r.Context(), proof.User, auth.StartOptions{Proofs: []auth.Proof{proof}})
	if err != nil {
		http.Error(w, "can't start a session", http.StatusInternalServerError)
		return
	}
	authhttp.SetCookie(w, tok, p.ExpiresAt)
	w.WriteHeader(http.StatusNoContent)
}

func writeJSON(w http.ResponseWriter, b []byte) {
	w.Header().Set("Content-Type", "application/json")
	_, _ = w.Write(b)
}

BeginFirstRegistration returns these options, shortened here. Every choice from the earlier sections shows up in them:

{"publicKey": {
  "rp": {"name": "Example", "id": "localhost"},
  "user": {"name": "alice@example.com", "displayName": "alice@example.com", "id": "ZRj4CHSb…"},
  "challenge": "59i7vqFw…",
  "pubKeyCredParams": [{"type": "public-key", "alg": -7}, {"type": "public-key", "alg": -257}, …],
  "timeout": 300000,
  "authenticatorSelection": {"requireResidentKey": true, "residentKey": "required", "userVerification": "required"},
  "attestation": "none",
  "extensions": {"credProps": true, "prf": {}}
}}

BeginLogin with Conditional set returns only a challenge, the relying party ID, "userVerification": "required", and "mediation": "conditional", with no allowCredentials. That empty list is what makes the sign-in discoverable.

The page needs a few lines for each ceremony. With the JSON helpers from the support table, registration looks like this:

const res = await fetch("/register/begin", { method: "POST", body: new URLSearchParams({ name }) });
const { publicKey } = await res.json();
const cred = await navigator.credentials.create({
  publicKey: PublicKeyCredential.parseCreationOptionsFromJSON(publicKey),
});
await fetch("/register/finish", { method: "POST", body: JSON.stringify(cred.toJSON()) });

Sign-in is the same shape with parseRequestOptionsFromJSON() and navigator.credentials.get().

If you don’t want to write the routes, authroutes.Mount registers sign-up, sign-in, step-up, adding a passkey, and sign-out in one call, and serves a browser client that handles autofill, aborts it before other ceremonies, and falls back when toJSON() is missing. The quickstart shows it in one Go file.

FAQ

Are passkeys WebAuthn?

On the web, yes. A passkey is a discoverable WebAuthn credential, created with navigator.credentials.create() and used with navigator.credentials.get(). Native apps reach the same credentials through platform APIs.

Is WebAuthn the same as FIDO2?

No. WebAuthn is one half of FIDO2: the browser API, from the W3C. CTAP, from the FIDO Alliance, is the other half, between the browser and the authenticator.

Is a security key a passkey?

It can hold passkeys. A credential on a security key is a device-bound passkey when it is discoverable. A key registered only as a second factor holds a credential your server must name first, which isn’t a passkey.

Do I need attestation?

Usually not. Most synced passkeys don’t provide it. Request it only when a policy requires specific authenticator models.

Does a passkey protect the session after sign-in?

No. A passkey protects the sign-in. A stolen session cookie still works until it expires. To bind the session to the device too, see Device Bound Session Credentials in Go.

Key takeaways

  • WebAuthn is the W3C browser API. CTAP is the FIDO protocol to the authenticator. FIDO2 is both.
  • A passkey is a discoverable WebAuthn credential. Synced passkeys copy across devices; device-bound passkeys don’t, and the BE flag tells them apart.
  • Require user verification and check the UV flag on the server if a passkey counts as multi-factor.
  • Use attestation "none" unless a policy names specific hardware.
  • Your server stores a public key, a credential ID, a counter, flags, and a random user handle. It stores no secret.

Try it

Give your coding agent this line to add passkey sign-in to your Go app:

Add sign-in with tensile-auth. Read https://auth.tensile.tools/llms.txt and follow it.