Authentication · · 7 min read
Passkeys, without the hand-waving
By the Argenium team
Passwords fail for two reasons. They are secrets the server has to store, and they are secrets a person can be talked into typing somewhere else. Passkeys remove both properties, and that is the whole story. The rest is detail, but the detail is where rollouts succeed or quietly fail.
What a passkey actually is
A passkey is a public-key credential created under the WebAuthn standard. When a user registers, their authenticator generates a key pair: the private key stays with the authenticator (a platform credential manager, or a hardware security key), and your server stores only the public key and a credential ID.
That single change rewrites your breach model. A dump of your credential table contains public keys. There is nothing to crack, nothing to replay and nothing worth stuffing into another site’s login form.
Why it can’t be phished
Every passkey is scoped to a relying party ID, which is your domain. The browser, not the user, decides which credentials to offer, and it will only offer yours on your domain. On app-examp1e.com there is simply nothing to select.
The more sophisticated attack is a real-time proxy that sits between the user and your site and relays everything. It fails too, because the browser writes the origin it is actually on into the data the authenticator signs. Your server sees a valid signature over the wrong origin and rejects it. One-time codes offer no such protection: a proxy can relay a code as easily as a password.
The ceremony, briefly
Registration and sign-in are both challenge–response exchanges. For sign-in, your server issues a random, single-use challenge; the authenticator signs it together with the origin and some flags; your server checks the result against the stored public key. Verification is where implementations go wrong, so be strict:
- The challenge is one you issued, for this session, and has not been used before.
- The origin matches your expected origin exactly, not by prefix or substring.
- The relying party ID hash in the authenticator data matches your domain.
- The flags show user presence, and user verification if your policy requires it.
- The signature verifies against the public key stored for that credential ID.
Use a maintained server library for this. The checks are not hard, but each one you skip removes a property you were relying on.
Make it the easy path
Adoption depends on passkeys appearing where users already look. Conditional mediation lets the browser offer passkeys inside the normal username field’s autofill, so nobody has to find a separate button:
// <input name="username" autocomplete="username webauthn">
const credential = await navigator.credentials.get({
mediation: "conditional",
publicKey: {
challenge, // random, single-use, issued by your server
rpId: "example.com",
userVerification: "preferred",
},
});Pair it with an offer to create a passkey right after a successful sign-in with the old method. That is the moment the user has already proven who they are and is most likely to say yes.
Synced or device-bound
Most passkeys today are synced: the platform backs them up and makes them available on the user’s other devices. That solves the lost-phone problem, and it also means the security of the passkey now includes the security of that platform account. For most consumer and SaaS sign-ins this is a good trade.
For administrators and other high-assurance roles, consider requiring device-bound credentials such as hardware security keys. The authenticator data carries backup-eligible and backed-up flags, so you can tell the two apart and set policy per role. One practical consequence: synced passkeys commonly report a signature counter of zero, so do not treat a zero counter as evidence of a cloned key.
Rolling out without breaking anything
- Add, don’t replace. Keep the existing method while passkey coverage grows, and measure the share of sign-ins that use one.
- Allow more than one. Let users register several passkeys and show each by name, device and last use, so they can clean up.
- Don’t downgrade silently. An account protected by a passkey should not quietly fall back to an SMS code.
- Plan for shared and managed devices. Kiosks, family tablets and locked-down corporate machines all behave differently.