Skip to main content

Abstract Class: BaseAuthFIDO2RouteSQL

Defined in: src/routes/sql/BaseAuthFIDO2RouteSQL.ts:7

Authenticates users via a registered FIDO2 hardware security key (e.g. a YubiKey) using WebAuthn/CTAP2. See BaseAuthPasskeyRoute for the software/synced-credential ("Passkey") counterpart of this route — both share the same underlying WebAuthn ceremony, but look up credentials stored as SecretType.FIDO2 rather than SecretType.PASSKEY.

Extends

Constructors

Constructor

new BaseAuthFIDO2RouteSQL(): BaseAuthFIDO2RouteSQL

Returns

BaseAuthFIDO2RouteSQL

Inherited from

BaseAuthFIDO2Route.constructor

Properties

aliasClass

protected aliasClass: any = AliasSQL

Defined in: src/routes/sql/BaseAuthFIDO2RouteSQL.ts:8

Overrides

BaseAuthFIDO2Route.aliasClass


aliasRepo?

protected optional aliasRepo?: RepoUtils<AliasSQL>

Defined in: src/routes/BaseAuthFIDO2Route.ts:29

Inherited from

BaseAuthFIDO2Route.aliasRepo


authMiddleware?

protected optional authMiddleware?: AuthMiddleware

Defined in: src/routes/BaseAuthFIDO2Route.ts:32

Inherited from

BaseAuthFIDO2Route.authMiddleware


fido2Config

protected fido2Config: PasskeyConfig

Defined in: src/routes/BaseAuthFIDO2Route.ts:51

The relying party configuration to use for this FIDO2 strategy. Kept separate from the Passkey strategy's configuration since a hardware key deployment commonly wants a different authenticatorAttachment/residentKey policy (see BaseSecretRoute.fido2Config).

Inherited from

BaseAuthFIDO2Route.fido2Config


jwtConfig?

protected optional jwtConfig?: any

Defined in: src/routes/BaseAuthFIDO2Route.ts:35

Inherited from

BaseAuthFIDO2Route.jwtConfig


messagingUtils?

protected optional messagingUtils?: MessagingUtils

Defined in: src/routes/BaseAuthFIDO2Route.ts:41

Inherited from

BaseAuthFIDO2Route.messagingUtils


objectFactory?

protected optional objectFactory?: ObjectFactory

Defined in: src/routes/BaseAuthFIDO2Route.ts:38

Inherited from

BaseAuthFIDO2Route.objectFactory


secretClass

protected secretClass: any = SecretSQL

Defined in: src/routes/sql/BaseAuthFIDO2RouteSQL.ts:9

Overrides

BaseAuthFIDO2Route.secretClass


secretRepo?

protected optional secretRepo?: RepoUtils<SecretSQL>

Defined in: src/routes/BaseAuthFIDO2Route.ts:43

Inherited from

BaseAuthFIDO2Route.secretRepo


userClass

protected userClass: any = UserSQL

Defined in: src/routes/sql/BaseAuthFIDO2RouteSQL.ts:10

Overrides

BaseAuthFIDO2Route.userClass


userRepo?

protected optional userRepo?: RepoUtils<UserSQL>

Defined in: src/routes/BaseAuthFIDO2Route.ts:57

Inherited from

BaseAuthFIDO2Route.userRepo


userUtils?

protected optional userUtils?: UserUtils<UserSQL, AliasSQL>

Defined in: src/routes/BaseAuthFIDO2Route.ts:59

Inherited from

BaseAuthFIDO2Route.userUtils

Methods

authenticate()

authenticate(user): Promise<AuthResult | undefined>

Defined in: src/routes/BaseAuthFIDO2Route.ts:125

Authenticates the user using a FIDO2 hardware security key and returns a JSON Web Token access token to be used with future API requests.

Parameters

user

JWTUser

Returns

Promise<AuthResult | undefined>

Inherited from

BaseAuthFIDO2Route.authenticate


getCredentialById()

protected getCredentialById(credentialId): Promise<StoredPasskeyCredential | undefined>

Defined in: src/routes/BaseAuthFIDO2Route.ts:133

Parameters

credentialId

string

Returns

Promise<StoredPasskeyCredential | undefined>

Inherited from

BaseAuthFIDO2Route.getCredentialById


getCredentials()

protected getCredentials(id): Promise<StoredPasskeyCredential[]>

Defined in: src/routes/BaseAuthFIDO2Route.ts:141

Parameters

id

string

Returns

Promise<StoredPasskeyCredential[]>

Inherited from

BaseAuthFIDO2Route.getCredentials


getUser()

protected getUser(id): Promise<JWTUser | undefined>

Defined in: src/routes/BaseAuthFIDO2Route.ts:171

Retrieve the user associated with a given uid or alias.

Parameters

id

string

The unqique id of the user or alias to lookup.

Returns

Promise<JWTUser | undefined>

Inherited from

BaseAuthFIDO2Route.getUser


initialize()

protected initialize(): Promise<void>

Defined in: src/routes/BaseAuthFIDO2Route.ts:65

Called on server startup to initialize the route with any defaults.

Returns

Promise<void>

Inherited from

BaseAuthFIDO2Route.initialize


updateCredentialCounter()

protected updateCredentialCounter(credentialId, newCounter): Promise<void>

Defined in: src/routes/BaseAuthFIDO2Route.ts:178

Parameters

credentialId

string

newCounter

number

Returns

Promise<void>

Inherited from

BaseAuthFIDO2Route.updateCredentialCounter