Skip to main content

AuthenticatorSelectionCriteria

Namespace: Wisej.Ext.WebAuthn

Assembly: Wisej.Ext.WebAuthn (4.1.0.0)

Manages requirements regarding authenticator attributes.

public class AuthenticatorSelectionCriteria

See #dom-authenticatorselectioncriteria-authenticatorattachment.

Constructors​

Instance member AuthenticatorSelectionCriteria(authenticatorAttachment, residentKey, requireResidentKey, userVerification)​

Creates a new instance of AuthenticatorSelectionCriteria with the given configuration.

NameTypeDescription
authenticatorAttachmentAuthenticatorAttachmentThe attachment modality: Platform (e.g. Windows Hello) or CrossPlatform (e.g. a security key).
residentKeyStringThe extent to which a client-side discoverable credential is desired: "discouraged", "preferred" or "required". Empty by default.
requireResidentKeyBooleanLegacy WebAuthn Level 1 flag; set to true only when residentKey is "required". False by default.
userVerificationResidentKeyRequirementThe Relying Party's user verification requirement. Preferred by default.

Example:

// Built-in authenticator, discoverable credential, user verification required.
var selection = new AuthenticatorSelectionCriteria(
AuthenticatorAttachment.Platform,
residentKey: "required",
requireResidentKey: true,
userVerification: ResidentKeyRequirement.Required);

CredentialsResponse response = await WebAuthn.CreateAsync(
challenge, rp, user, parameters, selection, 60000, AttestationConveyancePreference.None);

Properties​

Instance member AuthenticatorAttachment​

AuthenticatorAttachment: If this member is present, eligible authenticators are filtered to be only those authenticators attached with the specified authenticator attachment modality.

Instance member RequireResidentKey​

Boolean: This member is retained for backwards compatibility with WebAuthn Level 1 and, for historical reasons, its naming retains the deprecated “resident” terminology for discoverable credentials.

Instance member ResidentKey​

String: Specifies the extent to which the Relying Party desires to create a client-side discoverable credential.

Instance member UserVerification​

ResidentKeyRequirement: This member specifies the Relying Party's requirements regarding user verification.