Passwords have protected applications for decades, but they continue to be one of the weakest links in application security. Weak passwords, phishing attacks, credential stuffing, and password reuse remain common causes of security breaches. Passkeys offer a modern alternative by enabling passwordless authentication based on public-key cryptography, providing both stronger security and a better user experience.
For organizations with existing ASP.NET Core Identity applications, however, the challenge isn't enabling passkeys—it's introducing them without disrupting existing users or authentication flows. A successful migration should allow passwords and passkeys to coexist until users gradually adopt the new authentication method.
In this article, we'll build a migration strategy for adding passkey support to an ASP.NET Core Identity application while maintaining backward compatibility for existing users.
Understanding Passkeys
What Are Passkeys?
Passkeys are based on the FIDO2/WebAuthn standard. Instead of storing passwords, users authenticate using a cryptographic key pair.
The authentication process works as follows:
A public key is stored by the application.
A private key remains securely stored on the user's device.
During sign-in, the device proves possession of the private key.
No password is transmitted or stored.
This significantly reduces the risk of phishing and credential theft.
Why Add Passkeys Instead of Replacing Passwords?
Support Existing Users
Most enterprise applications already have thousands—or even millions—of registered users.
Removing password authentication overnight would:
Break existing login workflows
Increase support requests
Create unnecessary migration risks
A gradual adoption strategy allows users to register passkeys while continuing to use passwords until they're ready to switch.
Existing Authentication Architecture
A typical ASP.NET Core Identity application looks like this:
User
│
▼
Login Page
│
▼
ASP.NET Core Identity
│
▼
Identity Database
Password verification occurs through the Identity framework before granting access to protected resources.
Adding Passkey Support
Instead of replacing Identity, extend it.
Updated architecture:
User
│
┌───────────┴───────────┐
▼ ▼
Password Login Passkey Login
│ │
└───────────┬───────────┘
▼
ASP.NET Core Identity
│
▼
Identity Database
Both authentication methods share the same user account, allowing gradual migration without affecting existing users.
Configuring ASP.NET Core Identity
Identity registration remains largely unchanged.
builder.Services
.AddIdentity<ApplicationUser, IdentityRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
Why Keep Identity?
ASP.NET Core Identity already provides:
User management
Role management
Claims
Password policies
Account recovery
Two-factor authentication
Adding passkeys extends these capabilities rather than replacing them, allowing existing authentication features to continue working.
Registering a Passkey
After users authenticate using their existing password, provide an option to register a passkey.
public async Task RegisterPasskeyAsync(
ApplicationUser user)
{
// Generate WebAuthn registration challenge
// Send challenge to browser
// Store public key after verification
}
Why Register After Login?
Requiring existing authentication before passkey registration ensures that only legitimate account owners can associate new credentials with their accounts.
This also provides a seamless onboarding experience because users don't need to create a separate account.
Authenticating with a Passkey
Once registration is complete, users can authenticate without entering a password.
public async Task AuthenticatePasskeyAsync()
{
// Generate authentication challenge
// Verify signed response
// Sign in user
}
Why Separate Registration and Authentication?
Registration establishes trust by storing the public key.
Authentication verifies possession of the corresponding private key, allowing secure passwordless sign-in without transmitting secrets over the network.
End-to-End Migration Workflow
Consider an existing employee portal.
The migration process could follow these steps:
Employees continue signing in with passwords.
After successful authentication, the application offers passkey registration.
The employee creates a passkey using Windows Hello, Face ID, Touch ID, or a hardware security key.
The public key is stored alongside the existing Identity account.
Future logins allow users to choose either a password or a passkey.
Once adoption reaches organizational targets, password authentication can optionally be phased out.
This approach minimizes disruption while improving account security over time.
Managing Multiple Authentication Methods
Many organizations require more than one sign-in option.
An authentication page might offer:
Password
Passkey
External identity provider
Multi-factor authentication
Join the conversation! Your thoughts help the community grow.