class Passkeys

Constants

DEFAULT_TIMEOUT

private DEFAULT_PASSKEY_MODEL

private DEFAULT_REGISTERS_ROUTES

Methods

static string
relyingPartyId()

Get the relying party ID.

static void
resolveRelyingPartyIdUsing(callable|null $callback)

Register a callback to resolve the WebAuthn relying party ID for the current request.

static array
allowedOrigins()

Get the origins allowed to complete WebAuthn ceremonies.

static void
resolveAllowedOriginsUsing(callable|null $callback)

Register a callback to resolve WebAuthn allowed origins for the current request.

static bool
hasRequestAwareAllowedOrigins()

Determine if allowed origins are currently resolved from request-aware state.

static int
timeout()

Get the WebAuthn timeout in milliseconds.

static string
passkeyModel()

Get the passkey model class name.

static void
usePasskeyModel(string $model)

Set the passkey model class name.

static void
authorizeLoginUsing(callable|null $callback)

Register a callback to authorize passkey logins before login.

static bool
allowsLogin(Request $request, Passkey $passkey)

Determine if a passkey-verified user should be allowed to log in.

static void
redirectUsing(callable|null $callback)

Register a callback to resolve the successful login redirect path.

static string
redirectTo(Request $request)

Resolve the successful login redirect path for this request.

static string
guardName()

Get the current authentication guard name.

static StatefulGuard
guard()

Get the current stateful authentication guard.

static bool
shouldRegisterRoutes()

Determine if Passkeys routes should be registered.

static void
ignoreRoutes()

Configure Passkeys to not register its routes.

static string
migrationPath()

Get the path to the package's migrations.

static string
userHandleSecret()

Get the configured user handle secret.

static void
flushState()

Flush all static state.

Details

at line 46
static string relyingPartyId()

Get the relying party ID.

Return Value

string

at line 75
static void resolveRelyingPartyIdUsing(callable|null $callback)

Register a callback to resolve the WebAuthn relying party ID for the current request.

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 88
static array allowedOrigins()

Get the origins allowed to complete WebAuthn ceremonies.

Return Value

array

at line 120
static void resolveAllowedOriginsUsing(callable|null $callback)

Register a callback to resolve WebAuthn allowed origins for the current request.

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 131
static bool hasRequestAwareAllowedOrigins()

Determine if allowed origins are currently resolved from request-aware state.

Return Value

bool

at line 142
static int timeout()

Get the WebAuthn timeout in milliseconds.

Return Value

int

at line 158
static string passkeyModel()

Get the passkey model class name.

Return Value

string

at line 170
static void usePasskeyModel(string $model)

Set the passkey model class name.

The model class persists in static state for the worker lifetime and affects every subsequent passkey query.

Parameters

string $model

Return Value

void

at line 185
static void authorizeLoginUsing(callable|null $callback)

Register a callback to authorize passkey logins before login.

The callback persists in static state for the worker lifetime and affects every subsequent passkey login.

Parameters

callable|null $callback

Return Value

void

at line 196
static bool allowsLogin(Request $request, Passkey $passkey)

Determine if a passkey-verified user should be allowed to log in.

Parameters

Request $request
Passkey $passkey

Return Value

bool

at line 218
static void redirectUsing(callable|null $callback)

Register a callback to resolve the successful login redirect path.

The callback persists in static state for the worker lifetime and affects every subsequent successful passkey login response.

Parameters

callable|null $callback

Return Value

void

at line 229
static string redirectTo(Request $request)

Resolve the successful login redirect path for this request.

Parameters

Request $request

Return Value

string

at line 245
static string guardName()

Get the current authentication guard name.

Return Value

string

at line 255
static StatefulGuard guard()

Get the current stateful authentication guard.

Return Value

StatefulGuard

at line 271
static bool shouldRegisterRoutes()

Determine if Passkeys routes should be registered.

Return Value

bool

at line 281
static void ignoreRoutes()

Configure Passkeys to not register its routes.

The route registration flag persists in static state for the worker lifetime and affects route bootstrapping.

Return Value

void

at line 290
static string migrationPath()

Get the path to the package's migrations.

Return Value

string

at line 298
static string userHandleSecret()

Get the configured user handle secret.

Return Value

string

at line 328
static void flushState()

Flush all static state.

Return Value

void