Passkey
Wisej.NET 4.2.0+
The Passkey component lets users sign in to a Wisej.NET application with a passkey instead of a password. It registers passkeys for accounts your application has already signed in, signs users in with them, and lists, renames and removes them from an account page. Every answer the browser sends back is verified on the server before anything is stored or anyone is signed in.
It is a non-visual component: drop it on a page or form and it appears in the designer's component tray. Choose it when you want phishing-resistant sign-in that needs no identity provider and no shared secret. To sign users in through Google, Microsoft Entra ID, GitHub or another provider, use OAuthClient instead; the two work well together.
For a complete list of properties, methods, and events, see the API documentation.
What a passkey is
A passkey is a WebAuthn discoverable credential: a key pair created by an authenticator, either the one built into the user's device (Windows Hello, Touch ID, Face ID, an Android screen lock) or a security key, often synced across the user's devices by their password manager. The private key never leaves the authenticator. Your application stores only the public key and an opaque credential id. To sign in, the server sends a random challenge, the authenticator signs it after the user unlocks it with a fingerprint, face, PIN or device password, and the server checks the signature against the stored public key.
For a .NET developer the consequences are simple. There is no password to hash, leak or reset, and nothing in your database lets an attacker sign in. A passkey is bound to your domain (the relying party), so a look-alike phishing site cannot use it. "Discoverable" means the authenticator also stores the account it belongs to, so the user can sign in without typing a user name: the browser offers the passkeys it holds for your domain and the user picks one.
What the component does
Passkey runs both WebAuthn ceremonies, registration and authentication, end to end:
- It builds the options the browser needs, with a fresh random challenge for every ceremony.
- It verifies everything the browser returns on the server: the challenge, the origin, the relying party id hash, the user-presence and user-verification flags, the algorithm and the key, the signature, the signature counter, and the account the credential belongs to.
- It keeps credentials in an
IPasskeyCredentialStorethat you implement over your own database, and commits changes to it with concurrency checks. - It publishes the signed-in user as a
PasskeyIdentityon itsIdentityproperty and, when you allow it, onApplication.User.
Each ceremony runs entirely inside one awaited server call. No challenge is stored anywhere, not in the session, a cookie or the database: the challenge lives only as long as the call that is waiting for the browser's answer. A ceremony that outlives its server process, because of a restart or an application pool recycle, fails before anything is persisted.
Registration, step by step:
- The component resolves the store and checks
RelyingPartyIdandAllowedOrigins. A problem fails the call before the user sees a prompt. - It asks the store for the account's user handle, a 64-byte random value it creates the first time.
- It reads the account's existing passkeys, so the browser does not create a second one on an authenticator that already has one.
- The browser shows its prompt and the authenticator creates the key pair.
- The component verifies the answer and inserts the new credential into the store.
CredentialRegisteredis raised, then the task completes.
Sign-in, step by step:
- Same configuration and store checks. When you name the account, the component also reads its passkeys and fails at once if it has none.
- The browser shows its prompt and the authenticator signs the challenge.
- The component looks up the credential in the store and checks that it belongs to the expected account.
- It verifies the signature and every flag against the stored key and the component's settings.
Authenticatingis raised: your application checks the account and may veto.- The new signature counter and flags are committed to the store.
- The principal is assigned to
Application.User(if allowed), the session id is refreshed,Authenticatedis raised, then the task completes.
Nothing is assigned before the commit in step 6 succeeds.
Setup
Register a credential store
Wisej.NET has no account database, so the component cannot decide where passkeys live. Implement IPasskeyCredentialStore over your own storage and register it with Application.Services before the first page uses the component, typically in the static Program constructor:
static Program()
{
var connectionString = ConfigurationManager.ConnectionStrings["Passkeys"].ConnectionString;
// One shared instance serves every session: see the Passkey Credential Store page.
Application.Services.AddService<IPasskeyCredentialStore>(
new SqlPasskeyCredentialStore(connectionString));
}
SqlPasskeyCredentialStore is application code. Passkey Credential Store explains the contract every implementation must keep and gives a complete SQL Server implementation you can adapt. See Dependency Injection for how services are registered and resolved.
When no store is registered, every operation fails with PasskeyError.StoreUnavailable before a prompt is shown.
Drop the component and set the relying party
Add a Passkey component to the page or form, then set these properties in the designer or in code:
| Property | What it is | Default |
|---|---|---|
RelyingPartyId | The domain the passkeys are scoped to, such as example.com. | Empty: the host of the current origin. |
RelyingPartyName | The name the browser shows while a passkey is created. | Empty: the relying party id. |
AllowedOrigins | The exact origins that may complete a ceremony, such as https://app.example.com. | Empty: the current origin only. |
public SignInPage()
{
InitializeComponent();
this.passkey1.RelyingPartyId = "example.com";
this.passkey1.RelyingPartyName = "Example Corp";
this.passkey1.AllowedOrigins = new[] { "https://app.example.com" };
}
Left empty, both RelyingPartyId and AllowedOrigins fall back to the origin the browser opened the application at. That is convenient for development, where you run on https://localhost with whatever port Visual Studio picks, but it is not safe in production: the default origin is what the session's client claims, not something the server checks, so a client can name another origin of the same host, such as another port, and every port of that host shares the passkeys.
Set AllowedOrigins to the exact origins your application is served at. Each entry is a scheme, host and optional port with no path, query or fragment, and must be https unless the host is localhost. Setting RelyingPartyId requires AllowedOrigins: with an empty list the operation fails with PasskeyError.Configuration.
Rules the component checks at the start of every operation, failing with PasskeyError.Configuration before any prompt when one is broken:
RelyingPartyIdmust be a valid domain equal to the host of every allowed origin, or a registrable suffix of it.example.comserveshttps://app.example.comandhttps://example.com. An IP address is refused. A public suffix such ascomis refused by the browser, which also surfaces asPasskeyError.Configuration.- An internationalized domain name is written in its
xn--form. - Every allowed origin's host must equal
RelyingPartyIdor end in it.
PasskeyAuthenticationFailedEventArgs.Detail names the property or check that failed.
Set RelyingPartyId explicitly when the application runs behind a reverse proxy that rewrites the host, when it is reachable under several host names, or when several hosts share one store. The default is computed from the request, and behind a proxy that may not be the name the user typed.
Choose the value once. Every credential, user handle and store call is scoped by the effective relying party id, so changing it after passkeys exist strands them: they still exist on users' devices but no longer match.
Registering a passkey
Register a passkey only for a user your application has already signed in and authorized, from an account-settings page. The component cannot tell whether the caller may add a passkey to an account. Whoever completes the prompt binds a passkey to the account you name, so calling RegisterAsync from an anonymous sign-up screen, or with an id typed into the page, lets anyone add their passkey to any account.
RegisterAsync takes a PasskeyUser and an optional credential name:
PasskeyUser.UserIdis your application's own stable, opaque account id. It is never shown. It must not begin or end with white space and is at most 256 characters. Use the id your account table is keyed by, not an e-mail address that can change.PasskeyUser.Nameis the account name the browser and the user's password manager show next to the passkey, usually the sign-in name or e-mail address.PasskeyUser.DisplayNameis a friendly name shown beside it; null falls back toName.- The credential name, such as "Work laptop" or "YubiKey 5", is what your account page lists. At most 256 characters; null or empty stores none, and the user can rename it later.
The WebAuthn user handle is none of these. It is 64 random bytes the component asks the store to keep for the account, never derived from a name or address.
public partial class AccountPage : Page
{
private CancellationTokenSource registration;
private async void buttonAddPasskey_Click(object sender, EventArgs e)
{
// Application code: the account your application signed in.
var account = AccountService.Current;
var user = new PasskeyUser(account.Id, account.Email, account.FullName);
this.registration = new CancellationTokenSource();
try
{
var result = await this.passkey1.RegisterAsync(
user, this.textBoxPasskeyName.Text, this.registration.Token);
AlertBox.Show("Passkey added.");
await RefreshPasskeysAsync();
}
catch (OperationCanceledException)
{
// Dismissed, timed out, or canceled: nothing to report.
}
catch (PasskeyException ex) when (ex.Reason == PasskeyError.CredentialExists)
{
AlertBox.Show("This device already has a passkey for your account.");
}
catch (PasskeyException)
{
// Reported to the user by the AuthenticationFailed handler.
}
}
}
Give the name text box a MaxLength of 256: a longer name throws ArgumentException from RegisterAsync itself, before a task exists.
The task completes with a PasskeyRegistrationResult. Its Credential is a snapshot of the record exactly as it was stored; editing it changes nothing. Credential.Discoverable tells you whether the passkey can be used for sign-in without a user name, when the browser reported it. CredentialRegistered is raised with the same result just before the task completes, which is the place to refresh a list of passkeys if you prefer events to awaiting.
Registration signs nobody in: Identity, IsAuthenticated and Application.User are not touched.
The authenticator creates the passkey before the component stores it. Once the store has inserted the credential, the registration completes and raises CredentialRegistered even if you canceled the token, called SignOut, started another ceremony or disposed the component in the meantime: the passkey exists on the device and in the store, and it can sign the user in. If the user's sign-in ends while a registration prompt is open, cancel the token you passed to RegisterAsync, or dispose the component, so the open prompt cannot bind a passkey to that account. SignOut on the same component cancels it for you.
Signing in
Without a user name
AuthenticateAsync() is the usual sign-in. The browser lets the user pick any passkey they hold for your relying party, the store finds the account from the credential id, and the component verifies the assertion. Only discoverable credentials can answer, which is every passkey registered with the default ResidentKey setting.
For a known account
AuthenticateAsync(userId) signs in a specific account: the browser is told which of that account's credentials are acceptable, and the credential the authenticator used must belong to userId, or the sign-in fails with PasskeyError.CredentialMismatch. An account with no passkeys fails at once with PasskeyError.UnknownCredential and no prompt. It never falls back to sign-in without a user name.
Whoever supplies userId learns whether that account has a passkey: an account with one gets a prompt, an account without one fails at once, and the account's credential ids are sent to the browser. Showing the same message for both outcomes does not hide this. On a page an anonymous visitor can reach, use AuthenticateAsync() without an account, or pass an account id only after another step has identified the user. Never pass a name the visitor typed.
The sign-in page
public partial class SignInPage : Page
{
private async void SignInPage_Load(object sender, EventArgs e)
{
try
{
var capabilities = await this.passkey1.GetCapabilitiesAsync();
this.buttonPasskey.Visible = capabilities.IsSupported;
}
catch (PasskeyException)
{
this.buttonPasskey.Visible = false;
}
}
private async void buttonPasskey_Click(object sender, EventArgs e)
{
try
{
await this.passkey1.AuthenticateAsync();
}
catch (OperationCanceledException)
{
// The user dismissed the prompt, or it timed out.
}
catch (PasskeyException)
{
// Reported by passkey1_AuthenticationFailed.
}
}
// Raised after the assertion is verified and before anything is committed.
private void passkey1_Authenticating(object sender, PasskeyAuthenticatingEventArgs e)
{
// Application code: look the account up by the id the store returned.
var account = AccountService.FindById(e.UserId);
if (account == null || account.IsDisabled)
{
e.Cancel = true;
e.Reason = "Account not found or disabled.";
return;
}
e.Identity.AddClaim(new Claim(ClaimTypes.Email, account.Email));
e.Principal = new PasskeyPrincipal(e.Identity, account.Roles);
}
private void passkey1_Authenticated(object sender, PasskeyAuthenticatedEventArgs e)
{
// A SignOut may already have cleared the sign-in by the time this runs.
if (!this.passkey1.IsAuthenticated)
return;
new MainPage().Show();
}
private void passkey1_AuthenticationFailed(object sender, PasskeyAuthenticationFailedEventArgs e)
{
if (e.Reason == PasskeyError.Cancelled || e.Reason == PasskeyError.Timeout)
return;
// Safe, localized text that names nothing.
this.labelError.Text = e.Message;
}
}
Claim and ClaimTypes come from System.Security.Claims.
Await the task or handle the events, or both: Authenticated or AuthenticationFailed is raised first, and the task settles after it. Always await; never call .Result or .Wait() on these tasks. The component finishes its work inside the session, and blocking the session's thread on it deadlocks.
The Authenticating event
A passkey proves control of a key bound to an account id, and nothing else. It says nothing about whether the account still exists, is enabled, or what it may do. Authenticating is where your application decides that, after the signature has been verified and before the store commit or any assignment:
e.UserIdis the account id the credential is bound to, as the store returned it. Bind every decision to it, never to a display name.e.Identityis thePasskeyIdentitythat was built: authentication type"Passkey", a name-identifier claim and a name claim both equal to the user id, andUserVerified. Add your own claims to it here.e.Principalis the principal to assign. It defaults to aPasskeyPrincipalwrapping the identity; assignnew PasskeyPrincipal(e.Identity, roles)to add role claims, or your own principal type. Null is not allowed.e.Credentialis the stored credential before this sign-in's state is committed, for per-credential policy. Editing it changes nothing.e.Cancel = truevetoes the sign-in: nothing is committed or assigned, and the attempt fails withPasskeyError.Rejected.e.ReasonbecomesDetailon the failure, for your logs; the user sees the standard message.e.SetApplicationUserdecides whether the principal becomesApplication.User. See below.
The handler is synchronous. Load what you need with ordinary synchronous calls; do not block on the component's tasks.
Vetoing discards this attempt only. It does not end a sign-in already in effect: a handler that rejects a user who has just been disabled calls SignOut itself.
SetApplicationUser
SetApplicationUser is pre-filled true, or false when Application.User already holds an authenticated principal this component did not set, such as the user of Windows or cookie authentication or of an OAuthClient, so a passkey sign-in never silently replaces another sign-in. Set it yourself either way: true to replace that principal knowingly, false to verify a passkey without touching the signed-in user. The identity is stored on the component's Identity either way.
Under Windows or cookie authentication, set it explicitly. The pre-fill reads Application.User before the first await of the call, and the host principal is visible there only while a browser request runs on that thread or over a WebSocket connection.
The result
The task completes with a PasskeyAuthenticationResult, the same object PasskeyAuthenticatedEventArgs.Result carries:
| Property | What it holds |
|---|---|
UserId | The account id the credential is bound to. |
Identity | The PasskeyIdentity. Identity.UserVerified says whether the user was verified with PIN, biometrics or device unlock; Identity.CredentialId which passkey was used; Identity.AuthenticatedAt when. |
Principal | The principal that was assigned, or would have been. |
IsApplicationUser | Whether this component assigned Application.User. When false, authorize against UserId or Principal, not Application.User. |
Credential | A snapshot of the credential, with this sign-in's counter, backup state and last-used time. |
The result describes the sign-in when it was published. A SignOut that ran afterwards may already have cleared it: read IsAuthenticated on the component before recording application state.
On a successful sign-in the component refreshes the session id, which protects against session fixation.
Authenticated, AuthenticationFailed and CredentialRegistered are raised outside any browser request. With WebSocket that makes no difference. An application that runs without WebSocket must set pollingInterval in its configuration, or the changes a handler makes reach the browser only at the user's next interaction.
Failures
Every unsuccessful registration or sign-in, whatever the reason, raises AuthenticationFailed and then settles the task:
- Canceled for
PasskeyError.Cancelled(the user dismissed the prompt, your token was canceled, a newer ceremony replaced this one,SignOutwas called, the component was disposed) andPasskeyError.Timeout. Awaiting throws anOperationCanceledException. - Faulted with a
PasskeyExceptionfor every other reason.ex.Reasonis thePasskeyError,ex.Operationsays whether it was a registration or a sign-in, andex.Detailcarries the developer detail.
PasskeyAuthenticationFailedEventArgs carries the same Operation, Reason, Detail and the scrubbed Exception, plus:
Message, a safe, localized message for the user, which never contains a credential id, a user handle, a key or a user id. Show this, notDetailorPasskeyException.Message.Credential, set only forCounterRegression,StoreConflictandRejected. Those failures come after the credential's own signature verified, so the credential named was really used. Every failure a client can cause without the private key names no credential, so that someone who has seen a credential id cannot lead your application into disabling another user's passkey. Act onReason, not on whetherCredentialis set.
When the session has ended by the time a ceremony finishes, the task settles and no event is raised, except AuthenticationFailed for the three failures that name a credential, which is still raised, with no session current, so you can flag the credential. That handler cannot reach the ended session's user interface or Application.User.
The management methods (GetCredentialsAsync, RenameCredentialAsync, DeleteCredentialAsync, GetCapabilitiesAsync) raise no event; they fault their task with a PasskeyException.
Checking support
GetCapabilitiesAsync asks the browser what it can do, without a prompt and without touching the store, so you can decide whether to show a "Sign in with a passkey" button. It is bounded by a fixed ten seconds, not by Timeout.
PasskeyCapabilities property | Meaning |
|---|---|
IsSupported | The page can run WebAuthn ceremonies at all. False means every ceremony fails with PasskeyError.NotSupported. |
SecureContext | The page is a secure context (https, or localhost). |
UserVerifyingPlatformAuthenticator | The device has a built-in authenticator that can verify the user, such as Windows Hello or Touch ID; null when unknown. |
ConditionalMediation | The browser could offer passkeys in a field's autofill; a hint only, since the component does not offer that ceremony. |
JsonHelpers | The browser has the WebAuthn JSON helpers; false does not weaken anything. |
ClientCapabilities | The browser's own capability record, key by key, or null when the browser does not provide one. |
These are hints for the user interface, never a security decision: every ceremony is verified on the server whatever the browser claimed here.
Managing passkeys on an account page
An account page lists the user's passkeys and lets them rename or remove one:
| Method | What it does |
|---|---|
GetCredentialsAsync(userId) | Returns the account's PasskeyCredential records, an empty array when it has none. |
RenameCredentialAsync(userId, credentialId, name) | Renames one; null or white space clears the name. Returns false when the credential does not exist or belongs to another account. |
DeleteCredentialAsync(userId, credentialId) | Removes one from the store. Returns false when it does not exist or belongs to another account. |
These methods act on whatever account they are given. Pass the signed-in user's own id as your application established it at sign-in (after a passkey sign-in, PasskeyIdentity.UserId), or an account the signed-in user is authorized to administer. Never pass an id the browser supplies: a query string, a text box, a hidden field or a cookie. The component makes no ownership check of its own. It passes the account to the store, which must compare user ids exactly; see Passkey Credential Store.
private async Task RefreshPasskeysAsync()
{
var accountId = AccountService.Current.Id; // application code
var credentials = await this.passkey1.GetCredentialsAsync(accountId);
this.listViewPasskeys.Items.Clear();
foreach (var credential in credentials)
{
var item = new ListViewItem(new[]
{
credential.Name ?? "Unnamed passkey",
credential.CreatedAt.ToString("yyyy-MM-dd"),
credential.LastUsedAt.HasValue ? credential.LastUsedAt.Value.ToString("yyyy-MM-dd") : "Never",
credential.BackedUp ? "Synced" : "This device only"
});
item.Tag = credential.CredentialId;
this.listViewPasskeys.Items.Add(item);
}
}
private async void buttonRemovePasskey_Click(object sender, EventArgs e)
{
if (this.listViewPasskeys.SelectedItems.Count == 0)
return;
var credentialId = (byte[])this.listViewPasskeys.SelectedItems[0].Tag;
try
{
if (await this.passkey1.DeleteCredentialAsync(AccountService.Current.Id, credentialId))
{
AlertBox.Show("Passkey removed. Delete it from your device or password manager too.");
await RefreshPasskeysAsync();
}
}
catch (PasskeyException ex)
{
AlertBox.Show("The passkey could not be removed (" + ex.Reason + ").");
}
}
Things to get right on this page:
- Show the name, not the id. The credential id and user handle are privacy-sensitive identifiers. Do not display, log or serialize records wholesale; an audit line carries at most a short prefix of the credential id.
- Treat
NameandTransportsas user-supplied text. The browser chose the transports and the user chose the name. Wisej.NET encodes text by default; keep it that way and do not show these withAllowHtml. - Removing a passkey does not remove it from the device. It stays in the user's authenticator or password manager, where it no longer works. Tell the user to delete it there too.
- The last passkey is yours to protect. The component cannot see passwords, OAuth sign-ins or recovery codes, and never refuses to remove an account's last passkey. Decide whether the account keeps another way to sign in before you call
DeleteCredentialAsync. - Re-authenticate for sensitive changes. For renaming or removing a passkey, the caller is expected to have authorized the account and, for a security-sensitive setting, re-authenticated the user recently. The component cannot.
Credentials registered without user verification are listed with UserVerified false; see UserVerification below.
Options
| Property | Values | Default | Applies to |
|---|---|---|---|
UserVerification | Required, Preferred, Discouraged | Required | Both ceremonies |
ResidentKey | Required, Preferred, Discouraged | Required | Registration |
AuthenticatorAttachment | Any, Platform, CrossPlatform | Any | Registration |
Timeout | 10,000 to 600,000 ms | 300,000 ms (five minutes) | Both ceremonies |
UserVerification decides whether the authenticator must verify the user with a PIN, fingerprint, face or device unlock, rather than just confirm that someone touched it. Required, the default, enforces it on the server: an answer without verification fails with PasskeyError.UserVerificationRequired. Keep it, because a passkey establishes the user's primary identity. With Preferred or Discouraged the ceremony succeeds without verification, and PasskeyIdentity.UserVerified tells you what happened.
A credential registered without user verification never counts as verified, even when a later sign-in reports it. If you later switch to Required, those passkeys can no longer sign in. Their users register a new passkey; remove the old one with DeleteCredentialAsync (GetCredentialsAsync lists it with UserVerified false). Under Required, registration leaves such a passkey out of the exclude list, so the same authenticator can create the replacement.
ResidentKey decides whether a new passkey must be discoverable. Required, the default, is what makes it a passkey: the user can sign in without typing an account name. A credential created under Discouraged can only be used through AuthenticateAsync(userId); sign-in without a user name never finds it.
AuthenticatorAttachment restricts which authenticators may create a new passkey: Platform only the device's own (Windows Hello, Touch ID, Face ID, Android), CrossPlatform only a security key or another device through the hybrid (QR code) flow, and Any both. Sign-in always accepts whatever authenticator holds the credential.
Timeout is how long the browser may take to answer. The component's own timer owns it and reports PasskeyError.Timeout; any later answer is ignored. Keep it below the application's idle session timeout: while the operating system's passkey prompt is open the page sees no user activity, and a session that expires first ends the application before the component can report anything.
Sign-out and component lifetime
SignOut signs the user out locally. It clears Identity and, when Application.User is still the exact principal this component assigned, replaces it with an unauthenticated principal, so Application.IsAuthenticated becomes false. It refreshes the session id when the component had a signed-in user. It cancels a ceremony in flight on the same component. There is no remote session to end and no event: a passkey is a key, not a session at a provider. It is safe to call when nobody is signed in.
Two rules follow from "the exact principal this component assigned":
- Sign out on the component that signed the user in.
SignOuton anotherPasskeyinstance does nothing, and neither does it on this one after it has been disposed. - Disposing does not sign out. Disposing the component, or the page that hosts it, leaves
Application.Useras it is, and afterwards noPasskeycan sign that principal out.
So either keep the component that signs users in alive for as long as they may sign out, for example on the main page or another long-lived container, or sign out yourself by assigning an unauthenticated principal:
// Never assign null: under Windows or cookie authentication the property
// falls back to the host's principal and the user stays signed in.
Application.User = new ClaimsPrincipal(new ClaimsIdentity());
Application.RefreshSessionId();
SignOut never touches a principal something else assigned: host authentication, an OAuthClient, or an Authenticating handler that set SetApplicationUser to false.
SignOut must run on a thread of the session the user signed in to; on any other thread it throws InvalidOperationException and clears nothing.
Using it with password or OAuth sign-in
Passkeys rarely stand alone at first: users already have accounts, signed in with a password or an identity provider. A common arrangement:
- The user signs in the way they always have, with your login form or an OAuthClient.
- Their account page offers "Add a passkey", which calls
RegisterAsyncwith your application's own account id for that user. - Next time, the sign-in page offers "Sign in with a passkey" next to the other options.
Authenticatingmapse.UserIdback to the same account and loads its roles.
Use one account id across all sign-in methods: the id your account table is keyed by. If your accounts come only from an identity provider, use a stable id derived from the provider's subject identifier, not the e-mail address, which can change or be reassigned.
When a user is already signed in through another method and a passkey sign-in runs, SetApplicationUser is pre-filled false and the other principal stays on Application.User. Sign-out, likewise, is per method: Passkey.SignOut clears only the principal the Passkey component assigned. When users can sign in more than one way, sign out by assigning an unauthenticated principal as shown above, or call SignOut on each component that may have signed the user in.
Errors
PasskeyError | When | What to do |
|---|---|---|
NotSupported | The browser has no WebAuthn support, the page is not a secure context, or no authenticator meets the resident-key or user-verification requirement. | Hide passkey options after checking GetCapabilitiesAsync. |
Cancelled | The user dismissed the prompt or no usable credential was found, your token was canceled, a newer ceremony replaced this one, SignOut ran, or the component was disposed. The task is canceled. | Nothing; let the user try again. |
Timeout | No answer within Timeout. The task is canceled. | Let the user try again. |
Configuration | RelyingPartyId or an AllowedOrigins entry is invalid or inconsistent, the origin cannot be determined, the browser rejected the options, or the store returned a record that breaks its contract. | Fix the configuration or the store; Detail names the check. |
StoreUnavailable | No IPasskeyCredentialStore is registered, or resolving it threw. | Register the store. |
StoreFailed | A store method threw. The scrubbed exception is attached. | An operational failure: log it and retry. |
InvalidResponse | The browser's answer is malformed or exceeds a limit. | Treat as a failed attempt; Detail names what failed to parse. |
InvalidSignature | The signature does not verify against the stored key. | Treat as a failed attempt. |
ChallengeMismatch | The answer is for another challenge: replayed, stale or foreign. | Treat as a failed attempt. |
OriginMismatch | The origin is not in AllowedOrigins, or the ceremony ran in a cross-origin frame. | Check AllowedOrigins; passkeys do not work in a frame embedded on another origin. |
RelyingPartyMismatch | The credential was created for another relying party id. | Check that RelyingPartyId has not changed. |
UserPresenceRequired | The authenticator did not report user presence. | Treat as a failed attempt. |
UserVerificationRequired | UserVerification is Required and the user was not verified, or the credential was registered without verification. | Ask the user to register a new passkey. |
UnsupportedAlgorithm | The key is neither ES256 nor RS256. | The authenticator cannot be used. |
UnsupportedAttestationFormat | The attestation is not "none". | The authenticator cannot be used. |
CredentialExists | The authenticator already holds a passkey for this account, or the credential id is already stored. | Tell the user this device is already registered. |
UnknownCredential | The credential is not in the store, the named account has no passkeys, or the credential was deleted during the sign-in. | Offer another sign-in method; the user may need to delete a stale passkey from the device. |
CredentialMismatch | The credential belongs to another account than the one named, the user handle differs, or the backup eligibility changed. | Treat as a failed attempt. |
CounterRegression | The signature counter did not increase: a possible cloned key, a malfunction, or two sign-ins that crossed. Credential is set. | Flag the credential and re-verify the user; disabling it is your risk decision. |
StoreConflict | The stored record changed during the sign-in. Credential is set. | Not a risk signal: the user tries again. |
Rejected | Your Authenticating handler set Cancel. Credential is set; Detail is your Reason. | As your handler decided. |
Unknown | Any other exception, including one thrown by an event handler. | Check Exception. |
Security notes
- Register only for a signed-in, authorized user, from an account page. The component cannot check who may add a passkey to an account.
- Pass the signed-in account to every management call, never an id from the browser.
- Set
AllowedOriginsin production, andRelyingPartyIdbehind a proxy, on a host with aliases, or when several hosts share a store. - Keep
UserVerificationatRequiredunless you have a reason not to, and decide in your own policy what an unverified sign-in is worth if you change it. - Authorize in
Authenticating. A valid passkey says nothing about whether the account is enabled. - Do not log identifiers. Credential ids, user handles and raw registration data are privacy-sensitive.
PasskeyException.MessageandPasskeyAuthenticationFailedEventArgs.Messagenever contain them; your logs should not either. - Never block on the tasks.
.Resultand.Wait()deadlock under the session lock. - Plan sign-out with the component's lifetime in mind. Disposing does not sign out.
What is not supported
The component is a careful, server-verified WebAuthn implementation for signing users in to your application. It is not a general FIDO server:
- It is not a FIDO-certified server.
- Attestation "none" only. Direct, indirect and enterprise attestation, packed self-attestation included, are refused. The authenticator's AAGUID is recorded but is advisory: without attestation it is not verified provenance.
- No FIDO Metadata Service lookups, so no policy based on authenticator models.
- ES256 and RS256 only. EdDSA and other algorithms are not offered.
- No conditional mediation, the passkey suggestions in a user-name field's autofill.
PasskeyCapabilities.ConditionalMediationis only a hint. - No related origins.
AllowedOriginsis an exact list. - No cross-origin frames. A ceremony in a frame embedded on another origin fails with
OriginMismatch. - No import helper yet. The component reads records marked
PasskeyCredentialEvidence.ImportedLegacy, such as credentials from the olderWisej.Ext.WebAuthnextension, but this version offers no helper that creates them. - One ceremony at a time per component. Starting another cancels the one in progress.
- No account recovery. Recovery when a user loses every passkey, and keeping another sign-in method available, are your application's design.