Ramblings on IT and Security

How FIDO2 works, a technical deep dive

Earlier this year, I completed my bachelor thesis in Cybersecurity, diving into one of the most exciting developments in the world of authentication (well, that’s my personal opinion anyways), FIDO2 and Passkeys. My research focused on how passwordless authentication can reshape the way we secure digital identities, not only from a technical point of view, but also in terms of user experience, adoption , and the shift in mental models required to move beyond passwords.

This blog post builds on that research and aims to provide a technical deep dive into how FIDO2 actually works under the hood. While the promise of “passwordless and phishing-resistant” sounds great on paper, I wanted to truly understand, and now explain, what makes FIDO2 and Passkeys secure, very user friendly, and future-proof.

We’ll start with a look at the cryptographic foundation that powers FIDO2, asymmetric encryption. From there, we’ll walk through the two core flows, registration and authentication, and show how these interactions keep your credentials safe, even if an attacker is trying their best to trick you. One of those very common tricks is using a toolkit named Evilginx, a fairly easy to use tool to steal all your credentials, even when you’re using MFA with number matching. Want to see it in action? Scroll down below and see the evil magic.

If you’ve ever wondered what happens behind the scenes when you log in with a Passkey, or why FIDO2 is being adopted by tech giants like Apple, Google, and Microsoft, this post is for you.

Asymmetric encryption

At the heart of FIDO2 lies asymmetric cryptography, a system that uses two mathematically linked keys: a private key and a public key.

  • The private key is securely stored on your device and never leaves it.
  • The public key is shared with the online service during registration.

A simple analogy: Lock and the key

Imagine you have a special kind of lock and a matching key. But this lock is a little unusual, you can only lock it with one key (the private key), and only unlock it with the other (the public key). You keep the private key hidden in your pocket, but you hand out the public key to anyone who wants to check if a message really came from you.

Now, if you lock a message using your private key (by signing it), anyone can try to unlock it using your public key. If it works, they know two things:

  1. The message hasn’t been changed.
  2. It really came from you, because only your private key could have created that valid “lock.”

That’s essentially how FIDO2 works. You sign something with your private key, and the server verifies it using your public key. No one else can fake your signature unless they have your private key and since that key never leaves your device, it’s extremely hard to steal.

Nothing new

Asymmetric encryption isn’t new. In fact, it has been a cornerstone of digital security since the late 1970s, when RSA (Rivest-Shamir-Adleman) was introduced. The principles behind RSA, large prime number factorization and modular arithmetic, still underpin much of our secure internet infrastructure today.

Protocols like TLS (for HTTPS), PGP (for email encryption), and SSH (for secure remote login) all rely on public-private key cryptography. What FIDO2 does differently is not inventing a new cryptographic system, but rather applying existing, proven technology in a way that improves user experience and eliminates shared secrets, like passwords.

Demo Time! Digital signature verification

To show how this works in practice, here’s a simplified version of the cryptographic validation process that happens during a FIDO2 authentication request.

This PowerShell script does three things:

  1. Loads a public key.
  2. Loads a signed message and its signature.
  3. Verifies the signature using SHA-256 hashing and PKCS#1 v1.5 padding.
# Create a new RSA Key Pair (2048-bit)
$rsa = [System.Security.Cryptography.RSACryptoServiceProvider]::new(2048)

# Export the private and public keys (optional as XML)
$privateKey = $rsa.ToXmlString($true)
$publicKey = $rsa.ToXmlString($false)

# Example data
$data = "FIDO2 is the Future"
$bytes = [System.Text.Encoding]::UTF8.GetBytes($data)

# Sign the data (SHA256 hash + RSA)
$signature = $rsa.SignData($bytes, [System.Security.Cryptography.HashAlgorithmName]::SHA256, [System.Security.Cryptography.RSASignaturePadding]::Pkcs1)

# New RSA instance with the publieke key
$rsaVerify = [System.Security.Cryptography.RSACryptoServiceProvider]::new()
$rsaVerify.FromXmlString($publicKey)

# Verify the signature
$isValid = $rsaVerify.VerifyData($bytes, "SHA256", $signature)


# Results
if ($isValid) {
    Write-Host "The signature is valid and is signed with the correct private key." -ForegroundColor Green
} else {
    Write-Host "The signature is not valid!" -ForegroundColor Red
}

Padding? Say what now?

You might wonder, what is PKCS#1 padding, and why does it matter?

When encrypting or signing data using RSA, we don’t just apply the private key directly to the raw bytes. Instead, the data is first padded using a specific scheme to ensure:

  • Consistent and safe structure
  • Protection against certain cryptographic attacks (like chosen plaintext attacks)
  • Compatibility with expected input sizes

Think of padding like placing a message into a standard-sized envelope, no matter how short the content inside, the outer format always looks the same. This prevents attackers from guessing or manipulating the message structure.

FIDO2 implementations commonly use RSASSA-PKCS1-v1_5 or RSASSA-PSS padding for signature operations. In our demo, we used Pkcs1, which is widely supported and standard for many applications, including legacy systems. Newer systems may prefer PSS, which offers slightly stronger theoretical security, but PKCS#1 is still considered safe and effective.

Technical note on ECDSA and Quantum resistance?

While the PowerShell demo above uses RSA, many FIDO2 authenticators in the real world use ECDSA (Elliptic Curve Digital Signature Algorithm), especially on mobile devices and security keys. ECDSA provides the same cryptographic principles as RSA but with:

  • Smaller key sizes
  • Faster performance
  • Lower computational and memory overhead

For example, a 256-bit ECDSA key offers roughly the same security as a 3072-bit RSA key.

However, ECDSA is not quantum-resistant. Just like RSA, it’s vulnerable to Shor’s algorithm, which could break it if large-scale quantum computers become viable. This has led to increasing interest in post-quantum cryptography, including new algorithms like Dilithium and Falcon, which are under review by NIST and FIDO Alliance for potential future use.

FIDO2 does allow for pluggable algorithms, so in the future, post-quantum Passkeys may become a reality, but today’s deployments are still based on classical cryptography.

FIDO2 flow explained

Before we dive into the flow itself, it’s important to understand that FIDO2 is built on two core protocols:

WebAuthn vs. CTAP – Who does what?

  • WebAuthn (Web Authentication API)
    This is the browser-side protocol defined by the W3C. It allows web applications to trigger authentication or registration events via JavaScript. WebAuthn handles the communication between the browser (or OS) and the web service, sending challenges, receiving responses, and passing data securely.
  • CTAP (Client-to-Authenticator Protocol)
    This is the device-side protocol developed by the FIDO Alliance. It defines how the browser or OS talks to the authenticator device, like a security key, smartphone, or built-in module like Windows Hello.

Think of it this way:

  • WebAuthn = from the browser to the website
  • CTAP = from the browser to the authenticator

Together, they form the FIDO2 standard. Whether you’re using a USB key or biometric unlock, these protocols ensure secure, phishing-resistant communication from your finger tips to the cloud and yes I mean this quite literally.

So how does a Passkey actually get created and registered? Let’s break down the FIDO2 registration process step by step, using the image below as a reference:

Step-by-step walkthrough

The following walkthrough describes the FIDO2 registration process, during which a new credential is created and associated with a user account. This process is also known as credential creation. Authentication using an existing credential follows a different sequence, which we will explore later.

1. User navigates to a website

The journey begins when a user opens a FIDO2-enabled website, for example, office.com. The browser establishes a secure HTTPS connection. When the user initiates the registration of a new FIDO2 credential, the website starts the registration process.

2. Redirect to the Identity Provider (IdP)

Depending on the application architecture, the user may be redirected to an Identity Provider (IdP), such as Microsoft Entra ID (login.microsoftonline.com). In this example, Microsoft Entra ID acts as the Relying Party (RP) for the WebAuthn registration process. The RP is responsible for managing the registration and associating the new credential with the user’s account.

3. WebAuthn registration challenge is issued

The RP generates a WebAuthn registration request and sends it to the browser. This request contains several important elements:

  • Relying Party ID (RP ID): Usually the effective domain of the website performing the registration. The authenticator uses the SHA-256 hash of this identifier (rpIdHash) to bind the credential to the RP. This binding is an important part of FIDO2’s phishing resistance.
  • User Identifier (User Handle): A unique, opaque identifier assigned by the RP to the user’s account. Unlike a username or email address, this identifier must not contain personally identifiable information. Its length can vary but must not exceed 64 bytes.
  • Challenge: A cryptographically random value generated by the RP. It ensures that the registration response corresponds to the current registration request and helps prevent replay attacks.
  • Public Key Credential Parameters: The cryptographic algorithms supported by the RP, such as ECDSA or RSA.
  • Authenticator Selection Criteria: Optional requirements specifying the desired authenticator characteristics, including whether a discoverable credential or User Verification is required.

The browser receives these parameters through the WebAuthn API and prepares the registration request.

4. User interacts with their authenticator

The browser communicates with the selected authenticator. This could be a USB security key, a smartphone, or a platform authenticator such as Windows Hello. For external security keys, communication typically takes place through the Client to Authenticator Protocol (CTAP), using transports such as USB, NFC, or Bluetooth.

Platform authenticators may communicate through operating system interfaces rather than directly exposing CTAP to the browser.

5. User Presence and User Verification

Before creating the credential, the authenticator may require the user to perform a local action. FIDO2 distinguishes between two mechanisms:

  • User Presence (UP): Confirms that a user is physically interacting with the authenticator, for example, by touching a security key.
  • User Verification (UV): Verifies the user locally through a PIN, biometric authentication, or another supported verification mechanism.

User Presence and User Verification are separate concepts. A physical touch does not necessarily verify the user’s identity. The RP can specify whether User Verification is required during registration.

6. Key pair generation and secure storage

The authenticator generates a new asymmetric key pair associated with the Relying Party. The private key remains protected by the authenticator and is never shared with the RP. The corresponding public key will be returned to the RP during registration. The authenticator also creates a Credential ID, which identifies the newly generated credential. How the credential information is stored depends on the credential type:

  • Discoverable credentials (formerly resident credentials): The authenticator stores the credential information, including the private key or protected key material, Credential ID, RP association, and User ID (User Handle). This allows the authenticator to discover credentials associated with an RP without receiving a Credential ID beforehand. Discoverable credentials are commonly used for username-less authentication.
  • Non-discoverable credentials: The authenticator does not need to store the User ID locally. Instead, the RP provides the Credential ID during authentication, allowing the authenticator to locate or reconstruct the corresponding private key. Depending on the implementation, the Credential ID may contain encrypted credential information rather than simply referencing a locally stored private key.

An important distinction is that the Credential ID identifies a specific credential, while the User ID identifies the user account associated with that credential. For discoverable credentials, the combination of RP ID and User ID also allows the authenticator to identify an existing credential for the same account during registration. Depending on the registration operation, an existing discoverable credential may be replaced.

7. Registration response is returned to the RP

Once the credential has been created, the authenticator returns the registration result to the browser, which forwards the WebAuthn response to the RP. The response contains several important elements:

  • Credential ID: The identifier of the newly generated credential.
  • Public Key: The public portion of the asymmetric key pair.
  • Authenticator Data: Information including the RP ID hash, credential data, and flags indicating User Presence and User Verification.
  • Attestation Information: Information that may provide cryptographic evidence about the authenticator, depending on the attestation format and RP requirements.
  • Client Data: Information containing the original challenge, the origin of the registration request, and the WebAuthn operation type.

Unlike authentication, registration does not necessarily involve signing the challenge with the newly generated credential’s private key. Instead, the registration response provides the information required for the RP to validate and register the credential. Depending on the attestation format, additional cryptographic verification may be performed.

8. Registration verification by the RP

After receiving the registration response, the RP performs several validation checks:

  • Challenge validation: Verifies that the returned challenge matches the challenge originally generated by the RP.
  • Origin validation: Confirms that the registration request originated from an expected and authorized origin.
  • RP ID validation: Verifies that the RP ID hash in the authenticator data matches the expected RP ID.
  • User Presence: Confirms that the User Presence flag is set as required by WebAuthn.
  • User Verification: Checks whether User Verification was performed when required by the RP.
  • Credential validation: Verifies that the credential data, including the Credential ID and public key, is correctly formatted and acceptable.
  • Attestation validation: If attestation verification is required, the RP validates the attestation statement and determines whether the authenticator meets its security requirements.

If these checks succeed, the RP accepts the newly created credential and associates it with the user’s account.

9. Credential is stored by the RP

The RP stores the information required to recognize and validate future authentication requests. This typically includes:

  • Credential ID: Used to identify the registered credential.
  • Public Key: Used to verify digital signatures during future authentication attempts.
  • User Account Association: Links the credential to the corresponding user account.
  • Signature Counter: When supported, this value can help detect certain scenarios involving cloned authenticators.
  • Additional Metadata: Depending on the implementation, information about the authenticator, supported capabilities, or registration details may also be retained.

The RP never receives or stores the credential’s private key. This completes the FIDO2 registration process.

From this point forward, the registered credential can be used for authentication. During authentication, the authenticator proves possession of the corresponding private key by signing authentication data bound to a fresh challenge, allowing the RP to verify the response using the stored public key.

Discoverable vs. Non-discoverable Credentials

You might wonder why an authenticator needs to store a User ID when the Credential ID already identifies the correct credential. Good question! The answer depends on the type of credential being used.

Non-discoverable credentials

During authentication, the Relying Party provides a list of acceptable Credential IDs. The authenticator uses these identifiers to locate or reconstruct the corresponding private keys. There is no requirement to store the User ID locally.

Discoverable credentials (formerly resident credentials)

With discoverable credentials, the authenticator can find credentials associated with an RP without receiving a Credential ID beforehand. This enables username-less authentication. In this scenario, the authenticator stores the User ID alongside the credential information. Once the user selects an account and authenticates, the authenticator can return the User ID to the RP, allowing it to identify the correct account. The User ID also plays a role during registration. When creating a discoverable credential, an authenticator can use the combination of RP ID and User ID to identify and replace an existing discoverable credential for the same account.

What about storage limitations?

The User ID has a variable length, but WebAuthn limits it to a maximum of 64 bytes. This provides a defined upper boundary for implementations with limited storage capacity. So, is the User ID actually stored? For discoverable credentials, yes. For non-discoverable credentials, local storage of the User ID is not required. The distinction is important because the Credential ID identifies a credential, while the User ID identifies the account associated with it.

Authentication, same dance, different steps

Once a user is registered, logging in with a Passkey follows the same WebAuthn and CTAP flow, with a few key differences:

  • No new key pair is generated.
    Instead, the authenticator looks up the stored key pair based on the hashed RP ID and credential ID.
  • A new challenge (nonce) is sent by the RP, just like during registration.
  • The private key is used to sign this challenge, proving that the user still possesses the correct authenticator and has performed a user verification step (like entering a PIN or touching a sensor).
  • The signature and credential ID are returned to the RP, which then uses the previously stored public key to verify the signature.

This proves the user is who they claim to be, without requiring a password, and without revealing the private key at any point. In essence, the authentication flow reuses the same trust model established during registration, creating a user friendly and phishing-resistant login experience.

Logging in with a QR code (Cross-Device Authentication)

One of the most user-friendly features of passkeys is the ability to log in on a device that doesn’t have your Passkey, by using a device that does, like your phone. This is where QR code-based login comes into play.

Let’s say you want to log into a website on a desktop computer, but your Passkey is stored on your mobile phone. Instead of typing a password or syncing credentials, the website displays a QR code. Here’s what happens behind the scenes:

  1. You scan the QR code with your phone, which opens a deep link or browser session tied to that login request.
  2. The QR code contains either the full login challenge (a cryptographic nonce) or a reference to an active login session on the relying party (RP) server. After scanning, your phone opens a secure WebAuthn flow, either in your browser or via the OS (like iCloud Keychain or Android).
    In many implementations, your phone also establishes a short-range Bluetooth Low Energy (BLE) connection with the desktop device. This local link:
    • Ensures physical proximity between the devices, strengthening phishing resistance
    • Helps bind the mobile response to the correct login session
    • May carry the encrypted assertion response back to the desktop, depending on the architecture

      This local communication acts as a secure bridge for authentication, keeping the private key on your phone while allowing your desktop session to complete login.
  3. The phone retrieves the challenge and metadata associated with the login request. This data is tied to the relying party’s domain and protected by the same origin policy.
  4. Your phone, which holds the passkey, signs the challenge using the private key associated with the RP ID.
    • It verifies that the RP domain matches the one the passkey is bound to.
    • It performs local user verification (PIN or biometric).
    • It signs the original challenge (nonce) that was issued at the start of the login session — the same one that would have been sent to a local authenticator.
    • It sends the signed assertion, along with the credential ID, back to the RP.
  5. The relying party verifies the signature using the public key stored during registration, and if valid, the user is logged in, not on the phone, but on the desktop session that initiated the login.

This entire process is known as cross-device authentication. It still fully adheres to the FIDO2 principles:

  • No private keys are ever transferred between devices.
  • Phishing-resistant thanks to domain-bound credentials.
  • End-to-end encrypted communication between the RP, the desktop, and the mobile authenticator.

The magic here is that the desktop device never gets access to your private key, it simply benefits from the trust established on your phone.

This feature makes passkeys truly practical in real-world scenarios, where users frequently move between devices and it shows how secure login doesn’t have to mean friction.

Try it, webauthn.io

Curious how this works in practice, or whether your device even supports FIDO2? You can test it right now using webauthn.io, a free demo site maintained by Duo Security.

The site allows you to:

  • Create a Passkey (a FIDO2 credential) in your browser
  • Register a device authenticator, like a built-in fingerprint scanner or a USB/NFC security key
  • Perform authentication using your newly created credential

It’s a safe and effective way to understand the full flow of WebAuthn and CTAP, from registration to authentication, without needing to write a single line of code.

Pro tip: If you’re using Chrome, Edge, or Safari on a modern device with biometrics, chances are you already have everything you need to test FIDO2.

Why FIDO2 is phishing-resistant (by design)

Traditional authentication systems rely on shared secrets, like passwords or one-time codes, that the user knows and the server also stores or verifies. This creates a fundamental weakness: if an attacker tricks the user into giving up that secret (e.g., through a phishing site), the attacker can log in as the user. Don’t believe me, check out my demo with Evilginx on this very topic!

No shared secrets = Nothing to steal

FIDO2 changes this game completely, with FIDO2:

  • The private key never leaves the user’s device
  • The public key is stored on the server, but is useless on its own
  • Authentication is bound to the website domain via the RP ID

This means even if an attacker creates a fake login page that looks like a legitimate service, the authenticator will not respond to the challenge — because the domain doesn’t match the RP ID it’s expecting.

Domain-bound credentials

During both registration and authentication, the authenticator validates the origin of the request using the hashed relying party ID. If the request comes from a domain it wasn’t registered with (like off1ce.com instead of office.com), it refuses to complete the action.

Phishing websites can mimic the look of a real site, but they cannot fake the origin sent by the browser to the authenticator. This is enforced at the hardware level and can’t be overridden by the user.

Example: why phishing fails against FIDO2

Let’s say a user is tricked into visiting a phishing site:

  1. The site looks like a real login page and asks for biometric authentication.
  2. The user attempts to log in with their Passkey.
  3. The authenticator sees that the request comes from login.ph1sh-site.com, not login.microsoftonline.com.
  4. It refuses to proceed. No signature is created. Nothing is sent.

Meanwhile, the attacker gains no usable credentials, because there are none to steal.

FIDO2 isn’t just harder to phish — it makes phishing fundamentally irrelevant. That’s why major tech players like Apple, Google, and Microsoft are rolling out Passkeys as the default login method in their ecosystems and so should you!

My final thoughts

The shift from passwords to Passkeys isn’t just a technological upgrade, it’s a complete rethinking of how we establish digital trust. With FIDO2, we finally have a solution that aligns security with usability, and flips the script on attackers by removing the very thing they prey on: shared secrets.

“If there’s nothing to steal, nothing can be stolen.”
— From my bachelor thesis on Passwordless Authentication, 2025

This blog post is a direct result of the extensive research I conducted for my bachelor thesis in Cybersecurity, where I explored passwordless authentication from both a technical and human perspective. The project involved deep dives into standards like FIDO2, usability studies around Passkeys, and interviews with security professionals, all with one goal: to understand how we can replace passwords without compromising on security or user experience.

Sharing this knowledge publicly has been important to me, not just to document what I’ve learned, but to help others understand how FIDO2 works under the hood, and why it’s a real game-changer for digital identity.

As always, I hope this was informative, if you have any question, reach out to me and let me know your thoughts!

References

W3C WebAuthn-specificatie
https://www.w3.org/TR/webauthn-3/

13 Comments

  1. t

    good work

  2. Dr Mohsen

    I recently read your blog post, “How FIDO2 works, a technical deep dive,” and I must commend you on the exceptional clarity and depth with which you explained the intricacies of FIDO2 and Passkeys. Your analogy of the lock and key to elucidate asymmetric encryption was particularly effective in making complex concepts accessible. Additionally, the inclusion of a PowerShell script to demonstrate digital signature verification provided a practical perspective that enhances understanding.

    Given your expertise, I would be very interested in reading more articles that delve into the practical implementation of passwordless authentication in various organizational contexts, perhaps including case studies or best practices.

  3. Craig

    Love it, thanks.
    I tried out the Powershell demo example. It doesn’t really demonstrate the example you mention above because the private key never gets involved. You sign the sample text (aka the nonce) using the public key and verify that the resulting value matches another hash of the nonce using the public key again. I’d love to see an encrypt and decrypt using the in there. I tried messing about with Base64 values of the bytes but didn’t get far. Maybe I’m missing something…

    • Michael Waterman

      Hi Craig,

      Thanks for reading and the reply!

      During my research I understood that this line uses the private key to sign the data:
      $signature = $rsa.SignData($bytes, [System.Security.Cryptography.HashAlgorithmName]::SHA256, [System.Security.Cryptography.RSASignaturePadding]::Pkcs1)

      A few lines down the road I use the following to verify:
      $rsaVerify = [System.Security.Cryptography.RSACryptoServiceProvider]::new()
      $rsaVerify.FromXmlString($publicKey) # Alleen de publieke sleutel!

      Would love your view on it as well! Thanks

  4. Badal Bhushan

    One input, CTAP2 serves as the communication protocol between a user’s device and external (roaming) authenticators, such as USB or NFC security keys. In contrast, when using built-in platform authenticators like Windows Hello or macOS Touch ID, the browser leverages the WebAuthn API to interface with the operating system’s native authentication capabilities. Although CTAP might be utilized under the hood, it remains hidden from web applications and relying parties, as it’s handled by the OS and browser.

    • Michael Waterman

      Thanks for the additional info! Where did you read this?

  5. John

    > Phishing websites can mimic the look of a real site, but they cannot fake the origin sent by the browser to the authenticator. This is enforced at the hardware level and can’t be overridden by the user.

    So the RP ID is not something that is built into the challenge by the RP, rather it is put there by the user’s browser? Does this also mean that if the browser was pwned, the RP ID could be tampered with, and be spoofed to match a legitimate RP while the challenge comes from a phishing site?

    • Michael Waterman

      The Relying Party ID (RP ID) is not provided by the RP (the server) directly in the challenge. Instead, it’s derived by the browser when it initiates a WebAuthn request. Specifically, the browser determines the RP ID from the origin (domain) of the current page and includes it in the request sent to the authenticator.

      However, and this is crucial, the authenticator (hardware key, TPM, etc.) doesn’t just trust what the browser says blindly. During registration, the authenticator binds the credential to the RP ID and stores it internally. Later, during authentication, it verifies that the RP ID in the new request exactly matches the RP ID it originally registered for.
      If it doesn’t match (for example, if a phishing site at evil-login.com tries to use a credential for login.microsoft.com), the authenticator refuses to sign the challenge.

      So yes, the RP ID is passed to the authenticator by the browser, but it is validated inside the authenticator against the stored one. This means a phishing site cannot simply “pretend” to be the real one, even if it tricks the user visually.

  6. David W

    I think John has a valid point. The man in the middle attack protection relies on the browser having validated the identity of the web site, and reporting that identity correctly to the authenticator.

    The browser is software, and if the machine on which it is running is compromised, could pass the genuine site’s RP ID to the authenticator. (When John says the challenge from the phisher, it actually has to be a challenge from the genuine site for which the phisher is acting as man in the middle.)

    If you do have that degree of compromise to the browser, the browser could directly access the real site, but fake the user interface behaviour, so you really have bigger problems.

    Identifying the site relies on proper implementation of TLS (more accurately PKI), and my impression is that convenience often results in that not being done as well as it could be, e.g. sharing a certificate between multiple sites only related by having a common web server machine, in a shared data centre, or browsers, by default, trusting a mix of CAs, some with weak authentication of their customers, and some even in, potentially, hostile countries. Also there being a sufficient number of sites with faulty certificates that people learn to override warnings.

    There is also at least one authenticator design that re-derives keys on the fly, from the RP ID and a master key, so will generate a response for any RP ID, although the response will only be acceptable to that RP ID.

    • Michael Waterman

      You’re absolutely right that WebAuthn assumes a minimally trustworthy client platform. If the browser or OS is fully compromised, an attacker can proxy real TLS sessions, fake UI, and relay genuine challenges. At that point, the user no longer controls the endpoint, and no browser-based authentication scheme can provide meaningful guarantees.

      That doesn’t weaken FIDO2’s phishing resistance, it defines its trust boundary. WebAuthn is designed to stop remote attackers, fake sites, and credential replay. It is not designed to survive a hostile OS or a malicious browser. At that point it’s no longer you that controls the machine.

      If an attacker controls the browser, they don’t need to break WebAuthn, they already won. The authenticator is behaving correctly, but the trust anchor (the client platform) is gone. They can simply piggy bag over your sessions anyways.

      This is why real-world deployments rely on defense in depth, things like secure boot, OS hardening, patching, EDR, browser isolation, device compliance, and risk-based access controls. FIDO2 removes an entire class of attacks and raises the bar significantly, but it does not, and cannot, replace endpoint security.

  7. DevToolsFan

    Great deep dive on FIDO2! If you’re looking for a practical way to test whether your devices and favorite websites support WebAuthn/FIDO2 and want to generate a strong fallback password for legacy systems, the Passkey Generator tool from ToolGrid is helpful. It runs entirely in your browser, checks passkey compatibility and uses the Web Crypto API to create a random fallback password. See: https://www.toolgrid.io/clusters/dev-utilities/generators/passkey-generator

  8. Gabor

    This is the best FIDO2 explanation I found. THANK YOU.

    I do not understand one thing: What is the point storing the “user ID”. It is never used. Its lenght can vary which in a tiny embedded systems is a major issue, while the RP ID and crendential ID are used thereafter and their lenght are pre-determined.

    Could this “user ID” be supposition or is it, indeed, stored?

    I know this is not a critical piece, but it is something I got hung up on.

    Thank you for the replies.

    Gabor

    • Michael Waterman

      Hi Gabor,

      First of all, thank you for the kind words! I’m glad you found the article useful.

      And that’s actually a very good question. You’re right that the Credential ID is sufficient to identify a credential during a traditional FIDO2 authentication flow. So why store a separate User ID? The answer lies primarily in the difference between discoverable and non-discoverable credentials. With non-discoverable credentials, the RP provides the Credential ID during authentication, allowing the authenticator to locate the corresponding private key. In this scenario, the User ID doesn’t necessarily need to be stored on the authenticator. However, with discoverable credentials (commonly used for username-less authentication), things work differently. The authenticator needs to identify which accounts are available for a particular RP without receiving a Credential ID beforehand.

      This is where the User ID, technically called the User Handle, becomes important. It allows the authenticator to return the account identifier to the RP. There’s another interesting detail: the User ID also helps the authenticator determine whether an existing discoverable credential should be replaced when registering a new one for the same account. Regarding your concern about storage: the User ID is indeed variable in length, but WebAuthn limits it to a maximum of 64 bytes. So while it introduces some storage overhead, the upper limit is defined.

      One correction to my original article: I described the User ID as an email address or UPN. That’s not entirely accurate. According to the WebAuthn specification, the User ID should be an opaque identifier and must not contain personally identifiable information. I’ll update the article to clarify that distinction.

      Thanks again for raising this. It’s exactly these kinds of questions that make technical discussions valuable!

      Michael

Leave a Reply

Your email address will not be published. Required fields are marked *

© 2026 Michael Waterman

Theme by Anders Noren — Up ↑