PublicKeyCredentialDescriptor
Namespace: Wisej.Ext.WebAuthn
Assembly: Wisej.Ext.WebAuthn (4.1.0.0)
Identifies the credential to be retrieved from the client.
- C#
- VB.NET
public class PublicKeyCredentialDescriptor
Public Class PublicKeyCredentialDescriptor
See #dictdef-publickeycredentialdescriptor.
Constructors
PublicKeyCredentialDescriptor()
Creates a new instance of PublicKeyCredentialDescriptor.
Example:
var descriptor = new PublicKeyCredentialDescriptor
{
Id = storedCredentialID,
Transports = new[] { AuthenticatorTransport.Internal }
};
PublicKeyCredentialDescriptor(id, type, transports)
Creates a new instance of PublicKeyCredentialDescriptor with the given configuration.
| Name | Type | Description |
|---|---|---|
| id | String | The base64 credential ID, as returned in CredentialID upon registration. |
| type | String | The type of credential to retrieve. Defaults to "public-key". |
| transports | AuthenticatorTransport[] | 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
Id
String: The credential ID.
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.
Type
String: The type of credential to retrieve.