Skip to main content

PublicKeyCredentialDescriptor

Namespace: Wisej.Ext.WebAuthn

Assembly: Wisej.Ext.WebAuthn (4.1.0.0)

Identifies the credential to be retrieved from the client.

public class PublicKeyCredentialDescriptor

See #dictdef-publickeycredentialdescriptor.

Constructors​

Instance member PublicKeyCredentialDescriptor()​

Creates a new instance of PublicKeyCredentialDescriptor.

Example:

var descriptor = new PublicKeyCredentialDescriptor
{
Id = storedCredentialID,
Transports = new[] { AuthenticatorTransport.Internal }
};

Instance member PublicKeyCredentialDescriptor(id, type, transports)​

Creates a new instance of PublicKeyCredentialDescriptor with the given configuration.

NameTypeDescription
idStringThe base64 credential ID, as returned in CredentialID upon registration.
typeStringThe type of credential to retrieve. Defaults to "public-key".
transportsAuthenticatorTransport[]Optional hints for how the client can reach the authenticator.

Example:

// Ask the user to authenticate with the credential registered earlier.
var allowCredentials = new[]
{
new PublicKeyCredentialDescriptor(storedCredentialID)
};

CredentialsResponse response = await WebAuthn.GetAsync(challenge, allowCredentials, 60000);

Properties​

Instance member Id​

String: The credential ID.

Instance member Transports​

AuthenticatorTransport[]: This OPTIONAL member contains a hint as to how the client might communicate with the managing authenticator of the public key credential the caller is referring to.

Instance member Type​

String: The type of credential to retrieve.