Overview
Thewebauthn sub-client manages FIDO2/WebAuthn passkey credentials for your end-users. You can generate registration options, verify registration responses, list credentials, and delete them.
webauthn.registerOptions()
Generate WebAuthn registration options for a principal. Returns aPublicKeyCredentialCreationOptions-compatible object that you pass to navigator.credentials.create() in the browser.
Parameters
Response: WebAuthnRegisterOptions
webauthn.registerVerify()
Verify a WebAuthn registration response from the browser. On success, the credential is stored and associated with the principal.Parameters
The WebAuthn attestation response from
navigator.credentials.create(). Must include id, rawId, type, and response (with clientDataJSON and attestationObject).Response: WebAuthnCredential
webauthn.listCredentials()
List all WebAuthn credentials registered for a principal.Parameters
Response: WebAuthnCredential[]
Returns an array of WebAuthnCredential objects.
webauthn.deleteCredential()
Delete a WebAuthn credential by its ID. The credential is immediately invalidated.Parameters
Response
Returnsvoid. The credential is immediately removed and can no longer be used for authentication.