WebauthnStamper
Introduction
The @turnkey/webauthn-stamper
package is used for stamping requests made to Turnkey’s API with WebAuthn credentials, but specifically for use with passkeys.
For more information on passkeys and WebAuthn refer to this section.
Installing
To get started install the @turnkey/webauthn-stamper
client.
Initializing
The WebauthnStamper
class is a utility designed to facilitate the process of creating a digital stamp using WebAuthn credentials. This stamp is essential for authenticating requests made to a web server or API that utilizes WebAuthn for secure, passwordless authentication. You can initialize a new WebauthnStamper
using the WebauthnStamper constructor:
constructor(config: TWebauthnStamperConfig): WebauthnStamper
Parameters
An object containing configuration settings for the stamper.
The RPID (“Relying Party ID”) for your origin. For an origin named https://www.example.com
, the RPID is typically example.com
. If you’re testing on localhost, the RPID should be localhost
.
The time in milliseconds before the stamp request times out. Defaults to 300000 milliseconds (5 minutes) if not specified.
Specifies the user verification requirements. Can be set to values like required
, preferred
, or discouraged
. Defaults to preferred
if not provided.
An array of credential descriptors specifying the credentials to be allowed during authentication. This is optional and defaults to an empty array.
Types
TWebauthnStamperConfig
UserVerificationRequirement
Refer to our guide on using passkeys for more information on this type and its usage.
PublicKeyCredentialDescriptor
Refer to our guide on using passkeys for more information on this type and its usage.
Example
Methods
stamp: (input: string) => Promise<TStamp>
Creates a digital stamp, which includes the public key, signature scheme, and a signature based on WebAuthn credentials.
Parameters
The Turnkey activity request, or query to be sent to Turnkey’s API.
Types
TStamp
Was this page helpful?