Skip to content

Multi-factor authentication and passkeys: what to implement in your application

B2Bnetwork team · · 6 min

Security

In brief

Multi-factor authentication (MFA) requires at least two different factors: something you know, something you have or something you are. The strongest options are passkeys and FIDO2 security keys, because the key works only with the domain it was created for, so a fake site cannot capture it. SMS codes, authenticator app codes and push notifications beat a password alone but do not protect against phishing. In a new application, offer passkeys as the primary method, one backup method and a secure account recovery process.

Factors and assurance levels

NIST SP 800-63B, in its 2025 revision, defines three authentication assurance levels (AAL). AAL1 allows a single factor, AAL2 requires two, and AAL3 requires phishing-resistant authentication with a key that cannot be exported. For AAL2 the document is explicit: the verifier must offer at least one phishing-resistant option.

The password rules changed as well. A password used as the only factor must be at least 15 characters, and at least 8 when it is part of MFA. NIST prohibits composition rules (uppercase, digit, special character) and periodic password changes without evidence of compromise. Instead, the application checks new passwords against a list of common, expected and breached values.

Comparing methods

MethodPhishing-resistantTypical riskWhere it makes sense
Passwordnobreach, guessing, phishingonly with a second factor
SMS codenocode interception, number takeover (SIM swap)backup method when nothing else is available
Authenticator app code (TOTP)nocode typed into a fake sitea good second factor for staff and customers
Push notificationnoapproval out of habit after a flood of requestswith code entry, not a bare “approve”
Synced passkeyyestakeover of the account that syncs the keysapplication customers, most employees
FIDO2 security keyyeslosing the keyadministrators, privileged accounts

NIST SP 800-63-4 treats the public telephone network (SMS and voice calls) as a restricted channel: you may use it, but the application must offer another method and consider risk signals such as a recent SIM change. Email is not allowed as a channel for one-time authentication codes. For push notifications, NIST no longer accepts a bare “approve” button, because attackers send requests until someone approves just to make them stop. The user must transfer a code between the sign-in screen and the phone.

Passkeys: how they work and why they stop phishing

A passkey is a credential based on the FIDO2 standards: WebAuthn (the W3C specification for browsers) and CTAP (communication with a security key or phone). At registration, the device creates a key pair. The public key goes to the server, and the private key stays with the user. At sign-in, the server sends a challenge and the device signs it once unlocked with a fingerprint, face or PIN.

Phishing resistance comes from the key being bound to the domain. The browser will not use a key created for the bank's real domain on “bank-login.example”. The server stores no shared secret, so a database breach gives the attacker nothing to sign in with.

The FIDO Alliance distinguishes two kinds of passkeys:

  • synced: copied across the user's devices through the cloud service of the platform or password manager provider, convenient and resilient to a lost phone;
  • device-bound: never leave a single device, such as a security key, and give the highest assurance.

NIST allows synced keys up to AAL2. For AAL3, for example for administrators of critical systems, you need a key that cannot be exported.

How to implement MFA in an application

  1. Inventory the sign-in paths. Web form, mobile app, API, sign-in through an identity provider. MFA on the website does not help if an old API still accepts a password alone.
  2. Passkeys as the primary method. Registration after sign-in, an offer at the next sign-in, and support for several keys per account.
  3. Backup method. An authenticator app or recovery codes. SMS only when there is no other option.
  4. Account recovery. This is the weakest link: the attacker does not break the passkey, they call the help desk. NIST requires notifying the user of every account recovery. Changing the phone number or adding a new factor are operations that require reauthentication.
  5. Risk-based MFA. Step-up authentication for sensitive operations: changing payment details, a new device, a data export.
  6. Testing. MFA bypass through another path, code reuse, no attempt limit, reset without verification. The OWASP MFA cheat sheet collects common implementation mistakes.

When users sign in through an external identity provider, MFA is enforced on the provider's side and the application checks the token for the authentication method used. Details are in the article on OAuth 2.0 and OpenID Connect. For employees, MFA is part of broader identity and access management, and its effectiveness is also checked by social engineering tests.

What to check in a security test

A sign-in test covers more than the code screen. Check whether a session after the first factor already gives access to parts of the API, whether the code has a short lifetime and an attempt limit, whether changing the phone number or email address requires reauthentication, and whether the help desk verifies the person before a reset. An example of such a scope is described in the case of testing an insurer's portal and app.

Questions and answers

Is an SMS code still secure MFA?

An SMS code is better than a password alone, but it does not protect against phishing, and a phone number can be hijacked through a SIM swap. NIST SP 800-63B treats SMS as a restricted method: acceptable when the application also offers other methods and takes risk signals into account. In new applications, keep SMS as a backup method, not the primary one.

How is a passkey different from a password?

A password is a shared secret: you and the server both know it, so it can leak from a database or be typed into a fake site. A passkey is a cryptographic key pair. The server knows only the public key, while the private key stays on the device and works only with the domain it was created for. The user unlocks it with the device's fingerprint, face or PIN.

What happens if a user loses the phone that holds their passkey?

A synced passkey is available on the user's other devices linked to the same provider account, so losing a phone usually does not block sign-in. To be safe, allow several passkeys per account and keep a secure recovery path, such as recovery codes saved at registration. Security keys are worth registering in pairs.

Do passwords need to be changed every 90 days?

No. NIST SP 800-63B prohibits forced periodic password changes and requires a change only when there is evidence the password was compromised. Instead of rotation, check passwords against lists of breached values, require adequate length and add a second factor, preferably a phishing-resistant one.

What it looks like in a project

Want to check your application's security? Talk to an engineer.

Let's talk

Read more: Security