final class WebAuthn

This class provides a static interface to the webauthn-lib package, handling serialization, deserialization, and validation of WebAuthn ceremonies.

Methods

static string
toJson(mixed $data)

Serialize data to JSON.

static array
toBrowserArray(mixed $data)

Serialize data to a browser-facing array, omitting null values.

static object
fromJson(string $json, string $class)

Deserialize JSON to a specific class.

static AuthenticatorAttestationResponseValidator
attestationValidator()

Create the attestation response validator for registration ceremonies.

static AuthenticatorAssertionResponseValidator
assertionValidator()

Create the assertion response validator for verification ceremonies.

static void
configureCeremonyStepManagerFactoryUsing(callable|null $callback)

Configure the ceremony step manager factory.

static void
flushState()

Flush all static state.

Details

at line 53
static string toJson(mixed $data)

Serialize data to JSON.

Parameters

mixed $data

Return Value

string

at line 63
static array toBrowserArray(mixed $data)

Serialize data to a browser-facing array, omitting null values.

Parameters

mixed $data

Return Value

array

at line 84
static object fromJson(string $json, string $class)

Deserialize JSON to a specific class.

Parameters

string $json
string $class

Return Value

object

at line 98
static AuthenticatorAttestationResponseValidator attestationValidator()

Create the attestation response validator for registration ceremonies.

Return Value

AuthenticatorAttestationResponseValidator

at line 110
static AuthenticatorAssertionResponseValidator assertionValidator()

Create the assertion response validator for verification ceremonies.

Return Value

AuthenticatorAssertionResponseValidator

at line 126
static void configureCeremonyStepManagerFactoryUsing(callable|null $callback)

Configure the ceremony step manager factory.

Boot-only. The callback persists in static state for the worker lifetime and affects every subsequent WebAuthn ceremony.

Parameters

callable|null $callback

Return Value

void

at line 203
static void flushState()

Flush all static state.

Return Value

void