AuthenticatorSelectionCriteria
Namespace: Wisej.Ext.WebAuthn
Assembly: Wisej.Ext.WebAuthn (4.1.0.0)
Manages requirements regarding authenticator attributes.
- C#
- VB.NET
public class AuthenticatorSelectionCriteria
Public Class AuthenticatorSelectionCriteria
See #dom-authenticatorselectioncriteria-authenticatorattachment.
Constructors
AuthenticatorSelectionCriteria(authenticatorAttachment, residentKey, requireResidentKey, userVerification)
Creates a new instance of AuthenticatorSelectionCriteria with the given configuration.
| Name | Type | Description |
|---|---|---|
| authenticatorAttachment | AuthenticatorAttachment | The attachment modality: Platform (e.g. Windows Hello) or CrossPlatform (e.g. a security key). |
| residentKey | String | The extent to which a client-side discoverable credential is desired: "discouraged", "preferred" or "required". Empty by default. |
| requireResidentKey | Boolean | Legacy WebAuthn Level 1 flag; set to true only when residentKey is "required". False by default. |
| userVerification | ResidentKeyRequirement | The 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
AuthenticatorAttachment
AuthenticatorAttachment: If this member is present, eligible authenticators are filtered to be only those authenticators attached with the specified authenticator attachment modality.
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.
ResidentKey
String: Specifies the extent to which the Relying Party desires to create a client-side discoverable credential.
UserVerification
ResidentKeyRequirement: This member specifies the Relying Party's requirements regarding user verification.