Skip to main content

Class: PasskeyStrategyOptions

Defined in: src/auth/PasskeyStrategy.ts:14

Describes the configuration options that can be used to initialize PasskeyStrategy.

Constructors

Constructor

new PasskeyStrategyOptions(config): PasskeyStrategyOptions

Defined in: src/auth/PasskeyStrategy.ts:20

Parameters

config

PasskeyConfig

Returns

PasskeyStrategyOptions

Properties

config

config: PasskeyConfig

Defined in: src/auth/PasskeyStrategy.ts:18

The relying party configuration to use for this strategy.

Methods

getCredentialById()

getCredentialById(credentialId): Promise<StoredPasskeyCredential | undefined>

Defined in: src/auth/PasskeyStrategy.ts:29

Retrieves a previously-registered credential by its ID. Returns undefined if no credential with that ID is known. NOTE: You must override this function when using this strategy.

Parameters

credentialId

string

Returns

Promise<StoredPasskeyCredential | undefined>


getCredentials()

getCredentials(id): Promise<StoredPasskeyCredential[]>

Defined in: src/auth/PasskeyStrategy.ts:39

Retrieves all credentials registered for the given user. Used to build the allowCredentials list when a login ceremony is started with a known user hint. NOTE: You must override this function when using this strategy.

Parameters

id

string

The unique identifier of the user or alias.

Returns

Promise<StoredPasskeyCredential[]>


getUser()

getUser(uid): Promise<JWTUser | undefined>

Defined in: src/auth/PasskeyStrategy.ts:57

Retrieves the user data for the given unique identifier after authentication has completed successfully. NOTE: You must override this function when using this strategy.

Parameters

uid

string

Returns

Promise<JWTUser | undefined>


updateCredentialCounter()

updateCredentialCounter(credentialId, newCounter): Promise<void>

Defined in: src/auth/PasskeyStrategy.ts:48

Persists the updated signature counter for the given credential after a successful authentication. Must be called on every successful login to guard against cloned authenticators. NOTE: You must override this function when using this strategy.

Parameters

credentialId

string

newCounter

number

Returns

Promise<void>