Skip to main content
Version: 4.2

PasskeyAuthenticatingEventArgs

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.2.0.0)

Provides data for the Authenticating event: the authorization decision point, after the assertion has been verified and before anything is committed or assigned. WebAuthn proves control of a credential bound to an opaque account; it says nothing about whether the account is enabled or what it may do, so this is where the application checks the account, loads claims and roles onto Identity — a ClaimsIdentity — and replaces Principal with new PasskeyPrincipal(e.Identity, roles) or its own type. Vetoing with Cancel discards this attempt only — nothing is committed to the store, nothing is assigned — and does not end a sign-in already in effect: a handler that rejects a user who has just been disabled calls SignOut itself. Runs inside the session, after verification and before the store commit; with an asynchronous store it runs outside any browser request, like the Authenticated event.

4.2.0+
public class PasskeyAuthenticatingEventArgs : CancelEventArgs

Properties​

Instance member Credential​

PasskeyCredential: Returns the stored credential the assertion was verified against, before this ceremony's state is committed: its SignCount, BackedUp and LastUsedAt are the previous values. Read it to apply per-credential policy; editing it changes nothing.

Instance member Identity​

PasskeyIdentity: Returns the identity that was built: authentication type "Passkey", a name identifier claim and a name claim equal to UserId, and UserVerified saying whether the authenticator verified the user in this ceremony with a credential whose user verification is established. Add, remove or remap claims here.

Instance member Principal​

IPrincipal: Returns or sets the principal to assign. Defaults to a new PasskeyPrincipal wrapping Identity. Assign new PasskeyPrincipal(e.Identity, roles) to add role claims, or another principal type. The same object is delivered on Principal and, when SetApplicationUser is true, becomes User. Null is not allowed: to refuse the account set Cancel, and to leave User alone set SetApplicationUser to false.

Throws:

Instance member Reason​

String: Returns or sets the text surfaced as Detail when Cancel is true. Developer detail; the user sees the catalogue message for Rejected.

Instance member SetApplicationUser​

Boolean: Returns or sets whether User is assigned. Pre-filled true, or false when an already authenticated principal this component did not set would be overwritten (the component logs why). A handler may set it either way: back to true to replace that principal knowingly, or to false to verify a passkey without touching the signed-in user. If a different authenticated principal appears after this event while the store commit is awaited, the component preserves it regardless of this value. The identity is still stored on Identity. Under host (Windows or cookie) authentication set it explicitly: the pre-fill reads User on the thread that called AuthenticateAsync, before its first await, and sees the host principal only while a browser request runs on that thread or on a WebSocket connection.

Instance member UserId​

String: Returns the application user id the credential is bound to, as the store returned it. Authentication and authorization decisions bind to this and never to a display name.

Used By​

NameDescription
PasskeyAuthenticatingEventHandlerRepresents the method that handles the Authenticating event.
4.2.0+