Skip to main content

Class: FIDO2StrategyOptions

Defined in: auth/src/auth/FIDO2Strategy.ts:15

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

Constructors​

Constructor​

new FIDO2StrategyOptions(config): FIDO2StrategyOptions

Defined in: auth/src/auth/FIDO2Strategy.ts:21

Parameters​

config​

PasskeyConfig

Returns​

FIDO2StrategyOptions

Properties​

config​

config: PasskeyConfig

Defined in: auth/src/auth/FIDO2Strategy.ts:19

The relying party configuration to use for this strategy.

Methods​

checkRateLimit()?​

optional checkRateLimit(identifier, req): Promise<void>

Defined in: auth/src/auth/FIDO2Strategy.ts:31

Optional hook invoked with the claimed identifier before a challenge is issued or an assertion is verified. Implementations should throw to reject the request once a caller-defined attempt threshold has been exceeded (see RateLimiter). A no-op when not provided.

Parameters​

identifier​

string

req​

HttpRequest

Returns​

Promise<void>


getCredentialById()​

getCredentialById(credentialId): Promise<StoredPasskeyCredential | undefined>

Defined in: auth/src/auth/FIDO2Strategy.ts:37

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: auth/src/auth/FIDO2Strategy.ts:47

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: auth/src/auth/FIDO2Strategy.ts:65

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: auth/src/auth/FIDO2Strategy.ts:56

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>