Skip to main content

WebAuthn

Namespace: Wisej.Ext.WebAuthn

Assembly: Wisej.Ext.WebAuthn

Provides methods for creating and retrieving credentials from the client following the Web Authorization API standards.

public class WebAuthn

Methods

Static memberCreateAsync(challenge, rp, user, publicKeyCredentialParameters, authenticatorSelection, timeout, attestation)

Creates new credentials for the client.

ParameterTypeDescription
challengeStringRandom string for validating the request.
rpRelyingPartyRelaying Party (rp), the organization responsible for registering and authenticating the user.
userPublicKeyCredentialUserEntityInformation about the user currently registering.
publicKeyCredentialParametersPublicKeyCredentialParameters[]Array describing what public key types are acceptable to the server.
authenticatorSelectionAuthenticatorSelectionCriteria"platform" (Windows Hello) vs "cross-platform" (Yubikey) required.
timeoutInt32The time in milliseconds that the user has to respond to a prompt for registration.
attestationAttestationConveyancePreferenceallows servers to indicate how important the attestation data is to this registration event.

Returns: Task<CredentialsResponse>. The client's credentials.

Static memberGetAsync(challenge, allowCredentials, timeout)

Gets the requested credentials from the client.

ParameterTypeDescription
challengeStringRandom string for validating the request.
allowCredentialsPublicKeyCredentialDescriptorWhich credential the server would like the user to authenticate with.
timeoutInt32The time in milliseconds that the user has to respond to a prompt for registration.

Returns: Task<CredentialsResponse>.

Static memberIsUserVerifyingPlatformAuthenticatorAvailableAsync()

Checks whether the client device has a user-verifying platform authenticator available for use.

Returns: Task<Boolean>. True if the device has a user-verifying platform authenticator.

Static memberValidate(publicKey, authenticatorDataBase64, clientDataBase64, signature)

Validates the given attestation against the provided public key.

ParameterTypeDescription
publicKeyPublicKeyThe public key generated during registration.
authenticatorDataBase64String"platform" (Windows Hello) vs "cross-platform" (Yubikey) required.
clientDataBase64StringClient data base64 encoded.
signatureByte[]Authentication signature.

Returns: Boolean. The success of the validation.

Throws: