Authentication
Utility functions and types for WebAuthn authentication ceremonies (signing and verification).
Functions
| Name | Description |
|---|---|
Authentication.deserializeOptions | Deserializes credential request options that can be passed to navigator.credentials.get(). |
Authentication.deserializeResponse | Deserializes a serialized authentication response. |
Authentication.getOptions | Returns the request options to sign a challenge with the Web Authentication API. |
Authentication.getSignPayload | Constructs the final digest that was signed and computed by the authenticator. This payload includes the cryptographic challenge, as well as authenticator metadata (authenticatorData + clientDataJSON). This value can be also used with raw P256 verification (such as P256.verify or WebCryptoP256.verify). |
Authentication.serializeOptions | Serializes credential request options into a JSON-serializable format, converting BufferSource fields to base64url strings. |
Authentication.serializeResponse | Serializes an authentication response into a JSON-serializable format, converting BufferSource fields to base64url strings and the signature to a hex string. |
Authentication.sign | Signs a challenge using a stored WebAuthn P256 Credential. If no Credential is provided, a prompt will be displayed for the user to select an existing Credential that was previously registered. |
Authentication.verify | Verifies a signature using the Credential's public key and the challenge which was signed. |
Errors
| Name | Description |
|---|---|
Authentication.SignFailedError | Thrown when a WebAuthn P256 credential request fails. |
Types
| Name | Description |
|---|---|
Authentication.Response | Response from a WebAuthn authentication ceremony. |

