Passkeys in web applications: passwordless login and account recovery
Passkeys enable passwordless login to a web application. The user confirms sign-in with a fingerprint, face or the PIN of their device, and instead of a password the server stores a public key. For a company with a client portal or an internal application, the main benefit is protection against phishing, not just convenience.
A “Create a passkey” button alone is not enough, though. The outcome depends on the right choice of domain, secure registration, device management and, above all, account recovery, which must not remain the weakest link. Below you will find an illustrative example, a rollout procedure, a decision table, common mistakes and a checklist.
What passkeys solve and what they do not
A passkey is a pair of cryptographic keys. The private key stays with the user’s passkey provider, that is, on a phone, a computer, in a password manager or in a hardware security key. Your application stores the public key. At sign-in, the device signs the server’s challenge only after the user confirms, usually by unlocking the device. The technical foundation is the W3C Web Authentication (WebAuthn) Level 3 standard, which has been a W3C Recommendation since 25 August 2026.
The key benefit is phishing resistance. According to the WebAuthn standard, a passkey can only be used with the same party (the RP ID, usually a domain) it was registered with. Google’s developer documentation adds that a user cannot be tricked into signing in on a deceptive site, because the browser or operating system handles the verification.
The US guideline NIST SP 800-63B states explicitly that methods where the user manually types a code, such as one-time codes from SMS or an app, are not phishing-resistant: a fraudulent site can relay the code to the real service. By contrast, it cites WebAuthn as an example of a phishing-resistant standard. The guideline imposes no obligations on a European company, but it is a well-documented reference.
Passkeys will not fix badly configured permissions after login, a stolen session or weak account recovery. If an attacker persuades your support team to “restore access” for them, cryptography will not help. That is why recovery gets its own section.
Synced and device-bound passkeys
WebAuthn distinguishes two types of credentials. Their properties directly shape how you design account recovery.
| Type | How it behaves | Consequence for the application |
|---|---|---|
| Synced passkey (multi-device credential) | The passkey provider can back it up and make it available on the user’s other devices. | Losing one device usually does not mean losing access. However, synced authenticators must not be used at the highest NIST level, AAL3. |
| Device-bound passkey (single-device credential) | It is never backed up, for example a passkey stored on a hardware security key. | According to WebAuthn, it is not resilient to device loss, so the account should have another authenticator or a recovery process. |
The application recognises the type from the BE (backup eligibility) and BS (backup state) flags in the data returned by the device. The WebAuthn standard recommends storing their latest values with the account. When BS changes from 1 to 0, the passkey is no longer backed up and the application should guide the user through verifying their other sign-in methods or adding a new one.
Example: passkeys in a distributor’s B2B portal
Illustrative example, not a real client. A distributor runs a portal at portal.example.com where customers place orders and download invoices. Staff work in the back office at admin.example.com. Today everyone signs in with a password and, for sensitive actions, with an SMS code.
The rollout could take place in three phases:
- Offer after sign-in. After signing in and verifying by e-mail, the portal offers to create a passkey. The password remains as a fallback for now.
- Passkey as the default option. The login form offers the saved passkey directly in the browser’s suggestions. Anyone without a passkey signs in the old way.
- Mandatory for administrators. Staff with access to price lists and customer data must have two registered authenticators, for example a passkey on their laptop and a hardware key kept in a safe.
If passkeys are to work on both subdomains, the distributor sets the RP ID to example.com. The web.dev guide states that with the RP ID example.com, the user can sign in on login.example.com and on other subdomains of example.com. Conversely, if the portal and the back office are separate systems with different accounts, they can have separate RP IDs.
Rollout procedure in eight steps
- Map the entry points and user groups. List every path to an account: the login form, the mobile app, forgotten password, e-mail change and support. For each group, decide whether the passkey will be optional, recommended or mandatory.
- Choose the RP ID before the first registration. According to WebAuthn, the default RP ID is the site’s domain; it can also be set to its registrable parent domain. A passkey works only with the RP ID it was created for, so after a later change users have to create it again.
- Verify the user more strongly than with a password before creating a passkey. web.dev recommends verification by e-mail or phone, for example, within a short time window and warns against password-only verification: with a leaked password, an attacker could create their own passkey. Send the list of already registered passkeys in the
excludeCredentialsparameter to avoid duplicates. - Use a proven library on the server. web.dev recommends processing the browser’s response with a server-side library rather than your own code. Store the credential ID, the public key, the user ID, the AAGUID (the passkey provider identifier you use to name the passkey), the BE and BS flags and the creation and last-used dates. Do not put personal data such as an e-mail address in
user.id. - Show the offer only where it works. The
PublicKeyCredential.getClientCapabilities()method tells you whether the device supports passkeys and offering them directly in the login form. For sensitive operations, check the UV flag, because withuserVerification: "preferred"the device may skip user verification. - Send notifications. After a passkey is added, send the user an e-mail. According to web.dev, a passkey that an attacker creates without the user’s knowledge remains usable even after a password change; the notification helps detect such access.
- Add a passkey management page. The user should see the name, creation date, last use and whether the passkey is synced, and be able to remove it immediately. NIST requires that an authenticator can be invalidated immediately after its loss or theft is reported.
- Run a pilot and evaluate it. Start with a smaller group of users. Track the registration success rate, sign-in errors, the number of account recoveries and support requests. Only then make the passkey the default option.
Account recovery: the weakest link if you do not design it
If a passkey can be bypassed with a “forgot password” link or a single SMS code, the account is only as secure as that path. NIST SP 800-63B recognises four classes of recovery: saved recovery codes, issued recovery codes, recovery contacts and repeated identity proofing. It allows any other method, for example through a support agent, only on the basis of a risk analysis and with documentation.
Several sign-in methods in advance
NIST recommends encouraging users to maintain at least two separate means of authentication and requires that multiple authenticators can be bound to an account. The best recovery is the one you never need: a second passkey on another device or a hardware key.
Recovery codes
According to NIST, a saved recovery code must contain at least 64 bits from a random generator, is stored only as a hash, its verification is limited by throttling, and after use the code is invalidated and a new one is issued. A code sent by e-mail may be valid for at most 24 hours, and by SMS or voice call for at most 10 minutes. For accounts at level AAL2, NIST requires two codes obtained through different methods, one code together with authentication by another authenticator bound to the account, or repeated identity proofing if the identity was originally proofed.
Support and notifications
According to NIST, every account recovery must trigger a notification to the user. Prepare a written procedure for support: what they verify, who approves exceptions and what is written to the audit trail. Without it, manual recovery is the place where social engineering bypasses even the best technology.
Decision table by user group
| Group | Recommended approach | Account recovery | Watch out for |
|---|---|---|---|
| Low-risk portal or e-shop customers | Passkey as an optional method alongside the existing login, offered after sign-in | A short-lived code sent by e-mail and a saved recovery code | Do not make login harder for those who do not want a passkey |
| B2B customers with access to invoices and orders | Passkey recommended, at least two sign-in methods, re-authentication for sensitive actions | Two independent recovery methods and a notification of every recovery | Shared company accounts – each person should have their own account |
| Administrators and staff with access to data | Passkey mandatory; where internal rules require it, device-bound hardware keys | A second registered key and a documented procedure through a designated person | If you require NIST level AAL3, synced passkeys are not enough |
The table expresses our recommendation, not a standard. Set the boundaries between groups according to the data and actions behind the login.
Benefits and trade-offs
- Less damage from a database breach. For accounts with a passkey, the server keeps a public key instead of a password. Google states that an attacker therefore gains far less valuable data and there is less cleanup after an incident.
- Fewer SMS codes. According to Google, passkeys can remove the need for one-time codes from SMS or an app at sign-in, which also saves SMS costs.
- Trade-off: the fallback password. As long as the password remains an alternative, phishing still works against it. The rollout should include a plan for when and for whom you remove the password.
- Trade-off: dependence on the passkey provider. Synced passkeys are managed by the user’s service, for example a cloud account or a password manager. Protecting that backup is outside your application.
- Trade-off: more operational work. Registration, device management, notifications and a new recovery procedure are added. Support needs a guide before the first questions arrive.
Common mistakes
- Creating a passkey after entering only the password, without further verification.
- Missing notification about a new passkey or an account recovery.
- Recovery with a single SMS code that bypasses passkeys and all other security.
- An RP ID chosen in a hurry, for example only for www, and changed later.
- Personal data in
user.id. - The user has nowhere to see or remove their passkeys.
- Custom signature verification instead of a proven library.
Pre-launch checklist
- The RP ID is decided and tested on all domains where users sign in.
- Verification stronger than a password takes place before passkey registration.
- The server stores the credential ID, public key, AAGUID, BE and BS flags and usage dates.
- The user receives a notification about a new passkey and about every account recovery.
- The passkey management page allows immediate removal.
- Every account with a device-bound passkey has a second authenticator or recovery.
- Recovery codes are single-use, stored as a hash and protected by throttling.
- Support has a written recovery procedure and an audit trail.
Frequently asked questions
Can we get rid of passwords completely?
Yes, but gradually. WebAuthn states that once a passkey becomes backed up (the BS flag changes from 0 to 1), the application may offer the user the option to remove their password. We recommend doing so only once the user has at least two sign-in methods and working account recovery.
What if a user loses their phone?
A synced passkey is usually available on their other devices too, so they can sign in from a laptop, for example. If misuse is suspected, they remove the passkey in the application and create a new one. A device-bound passkey is lost together with the device, which is why WebAuthn recommends that the account has another authenticator or a recovery process.
Does the application store fingerprints or face scans?
No. Unlocking with a fingerprint, face or PIN takes place on the user’s device and, according to Google, the server stores a public key. The list of data that web.dev recommends storing contains no biometric data.
Is a one-time SMS code enough as an alternative?
It does not protect against phishing: NIST does not consider one-time codes that the user types in to be phishing-resistant, because a fraudulent site can relay them. If you use SMS for account recovery, NIST limits the validity of the sent code to 10 minutes. For sensitive accounts, we recommend the passkey as the main method and SMS at most as one of the recovery paths.
How we can help
Passkeys can also be added to an existing application without rewriting the whole system. As part of custom web application development at Webiant, we design and implement registration, sign-in, passkey management and account recovery, and prepare a procedure for your support team. You will find more practical guides on our blog.
Considering passwordless login for your customer portal or internal application? Get in touch and we will work out together where to start and what to prepare.
References
- Web Authentication: An API for accessing Public Key Credentials – Level 3 – W3C, Recommendation of 25 August 2026.
- NIST Special Publication 800-63B – NIST guideline on authentication and authenticator management, part of the SP 800-63-4 revision.
- Create a passkey for passwordless logins – web.dev, updated 9 April 2026.
- Passkeys – Google for Developers.