Abstract Class: BaseAuthFIDO2RouteMongo
Defined in: src/routes/mongo/BaseAuthFIDO2RouteMongo.ts:8
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 BaseAuthFIDO2RouteMongo():
BaseAuthFIDO2RouteMongo
Returns
BaseAuthFIDO2RouteMongo
Inherited from
BaseAuthFIDO2Route.constructor
Properties
aliasClass
protectedaliasClass:any=AliasMongo
Defined in: src/routes/mongo/BaseAuthFIDO2RouteMongo.ts:9
Overrides
aliasRepo?
protectedoptionalaliasRepo?:RepoUtils<AliasMongo>
Defined in: src/routes/BaseAuthFIDO2Route.ts:43
Inherited from
authMiddleware?
protectedoptionalauthMiddleware?:AuthMiddleware
Defined in: src/routes/BaseAuthFIDO2Route.ts:46
Inherited from
BaseAuthFIDO2Route.authMiddleware
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: src/routes/BaseAuthFIDO2Route.ts:49
Inherited from
BaseAuthFIDO2Route.defaultScopes
fido2Config
protectedfido2Config:PasskeyConfig
Defined in: src/routes/BaseAuthFIDO2Route.ts:68
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?
protectedoptionaljwtConfig?:any
Defined in: src/routes/BaseAuthFIDO2Route.ts:52
Inherited from
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: src/routes/BaseAuthFIDO2Route.ts:55
Inherited from
BaseAuthFIDO2Route.messagingUtils
rateLimiter?
protectedoptionalrateLimiter?:RateLimiter
Defined in: src/routes/BaseAuthFIDO2Route.ts:58
Inherited from
BaseAuthFIDO2Route.rateLimiter
secretClass
protectedsecretClass:any=SecretMongo
Defined in: src/routes/mongo/BaseAuthFIDO2RouteMongo.ts:10
Overrides
BaseAuthFIDO2Route.secretClass
secretRepo?
protectedoptionalsecretRepo?:RepoUtils<SecretMongo>
Defined in: src/routes/BaseAuthFIDO2Route.ts:60
Inherited from
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: src/routes/BaseAuthFIDO2Route.ts:75
Inherited from
userClass
protecteduserClass:any=UserMongo
Defined in: src/routes/mongo/BaseAuthFIDO2RouteMongo.ts:11
Overrides
userRepo?
protectedoptionaluserRepo?:RepoUtils<UserMongo>
Defined in: src/routes/BaseAuthFIDO2Route.ts:77
Inherited from
userUtils?
protectedoptionaluserUtils?:UserUtils<UserMongo,AliasMongo>
Defined in: src/routes/BaseAuthFIDO2Route.ts:79
Inherited from
Methods
authenticate()
authenticate(
user,req,res):Promise<AuthResult|undefined>
Defined in: src/routes/BaseAuthFIDO2Route.ts:147
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
req
HttpRequest
res
HttpResponse
Returns
Promise<AuthResult | undefined>
Inherited from
BaseAuthFIDO2Route.authenticate
getCredentialById()
protectedgetCredentialById(credentialId):Promise<StoredPasskeyCredential|undefined>
Defined in: src/routes/BaseAuthFIDO2Route.ts:155
Parameters
credentialId
string
Returns
Promise<StoredPasskeyCredential | undefined>
Inherited from
BaseAuthFIDO2Route.getCredentialById
getCredentials()
protectedgetCredentials(id):Promise<StoredPasskeyCredential[]>
Defined in: src/routes/BaseAuthFIDO2Route.ts:172
Parameters
id
string
Returns
Promise<StoredPasskeyCredential[]>
Inherited from
BaseAuthFIDO2Route.getCredentials
getUser()
protectedgetUser(id):Promise<JWTUser|undefined>
Defined in: src/routes/BaseAuthFIDO2Route.ts:206
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
initialize()
protectedinitialize():Promise<void>
Defined in: src/routes/BaseAuthFIDO2Route.ts:85
Called on server startup to initialize the route with any defaults.
Returns
Promise<void>
Inherited from
updateCredentialCounter()
protectedupdateCredentialCounter(credentialId,newCounter):Promise<void>
Defined in: src/routes/BaseAuthFIDO2Route.ts:213
Parameters
credentialId
string
newCounter
number
Returns
Promise<void>