class StorePasskey

Traits

Methods

void
dispatchIfListening(string $eventClass, Closure $event)

Dispatch the given event if listeners are registered.

__invoke(Authenticatable $user, string $name, PublicKeyCredential $credential, PublicKeyCredentialCreationOptions $options)

Validate and store a passkey for the user.

AuthenticatorAttestationResponse
getResponse(PublicKeyCredential $credential)

Get the authenticator attestation response from the credential.

CredentialRecord
validate(AuthenticatorAttestationResponse $response, PublicKeyCredentialCreationOptions $options)

Validate the credential and return the source.

string
hostFromOptions(PublicKeyCredentialCreationOptions $options)

Get the relying party ID stored in the registration options.

createPasskey(PasskeyUser $user, string $name, CredentialRecord $source)

Create the passkey record for the user.

Details

in DispatchesEvents at line 16
protected void dispatchIfListening(string $eventClass, Closure $event)

Dispatch the given event if listeners are registered.

Parameters

string $eventClass
Closure $event

Return Value

void

at line 31
Passkey __invoke(Authenticatable $user, string $name, PublicKeyCredential $credential, PublicKeyCredentialCreationOptions $options)

Validate and store a passkey for the user.

Parameters

Authenticatable $user
string $name
PublicKeyCredential $credential
PublicKeyCredentialCreationOptions $options

Return Value

Passkey

Exceptions

InvalidPasskeyException

at line 60
protected AuthenticatorAttestationResponse getResponse(PublicKeyCredential $credential)

Get the authenticator attestation response from the credential.

Parameters

PublicKeyCredential $credential

Return Value

AuthenticatorAttestationResponse

Exceptions

InvalidPasskeyException

at line 72
protected CredentialRecord validate(AuthenticatorAttestationResponse $response, PublicKeyCredentialCreationOptions $options)

Validate the credential and return the source.

Parameters

AuthenticatorAttestationResponse $response
PublicKeyCredentialCreationOptions $options

Return Value

CredentialRecord

at line 86
protected string hostFromOptions(PublicKeyCredentialCreationOptions $options)

Get the relying party ID stored in the registration options.

Parameters

PublicKeyCredentialCreationOptions $options

Return Value

string

at line 100
Passkey createPasskey(PasskeyUser $user, string $name, CredentialRecord $source)

Create the passkey record for the user.

Parameters

PasskeyUser $user
string $name
CredentialRecord $source

Return Value

Passkey

Exceptions

InvalidPasskeyException