Skip to main content

Abstract Class: BaseAuthMFARouteSQL

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

Extends

Constructors

Constructor

new BaseAuthMFARouteSQL(): BaseAuthMFARouteSQL

Returns

BaseAuthMFARouteSQL

Inherited from

BaseAuthMFARoute.constructor

Properties

aliasClass

protected aliasClass: any = AliasSQL

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

Overrides

BaseAuthMFARoute.aliasClass


aliasRepo?

protected optional aliasRepo?: RepoUtils<AliasSQL>

Defined in: src/routes/BaseAuthMFARoute.ts:27

Inherited from

BaseAuthMFARoute.aliasRepo


authMiddleware?

protected optional authMiddleware?: AuthMiddleware

Defined in: src/routes/BaseAuthMFARoute.ts:30

Inherited from

BaseAuthMFARoute.authMiddleware


jwtConfig?

protected optional jwtConfig?: any

Defined in: src/routes/BaseAuthMFARoute.ts:33

Inherited from

BaseAuthMFARoute.jwtConfig


messagingUtils?

protected optional messagingUtils?: MessagingUtils

Defined in: src/routes/BaseAuthMFARoute.ts:39

Inherited from

BaseAuthMFARoute.messagingUtils


objectFactory?

protected optional objectFactory?: ObjectFactory

Defined in: src/routes/BaseAuthMFARoute.ts:36

Inherited from

BaseAuthMFARoute.objectFactory


secretClass

protected secretClass: any = SecretSQL

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

Overrides

BaseAuthMFARoute.secretClass


secretRepo?

protected optional secretRepo?: RepoUtils<SecretSQL>

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

Inherited from

BaseAuthMFARoute.secretRepo


template

protected template: string = "login-otp"

Defined in: src/routes/BaseAuthMFARoute.ts:44

The name of the messaging template to use for sending notifications.

Inherited from

BaseAuthMFARoute.template


userClass

protected userClass: any = UserSQL

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

Overrides

BaseAuthMFARoute.userClass


userRepo?

protected optional userRepo?: RepoUtils<UserSQL>

Defined in: src/routes/BaseAuthMFARoute.ts:46

Inherited from

BaseAuthMFARoute.userRepo


userUtils?

protected optional userUtils?: UserUtils<UserSQL, AliasSQL>

Defined in: src/routes/BaseAuthMFARoute.ts:48

Inherited from

BaseAuthMFARoute.userUtils

Methods

authenticate()

authenticate(user): Promise<AuthResult | undefined>

Defined in: src/routes/BaseAuthMFARoute.ts:114

Authenticates the user using HTTP MFA and returns a JSON Web Token access token to be used with future API requests.

Parameters

user

JWTUser

Returns

Promise<AuthResult | undefined>

Inherited from

BaseAuthMFARoute.authenticate


convertAliasToMethod()

protected convertAliasToMethod(alias, obfuscate?): MFAMethod | undefined

Defined in: src/routes/BaseAuthMFARoute.ts:122

Parameters

alias

Alias

obfuscate?

boolean

Returns

MFAMethod | undefined

Inherited from

BaseAuthMFARoute.convertAliasToMethod


convertSecretToMethod()

protected convertSecretToMethod(secret): MFAMethod | undefined

Defined in: src/routes/BaseAuthMFARoute.ts:149

Parameters

secret

SecretSQL

Returns

MFAMethod | undefined

Inherited from

BaseAuthMFARoute.convertSecretToMethod


getMethod()

protected getMethod(id): Promise<MFAMethod | undefined>

Defined in: src/routes/BaseAuthMFARoute.ts:172

Retrieves the user's secondary authentication method for a given id.

Parameters

id

string

The unique id of the secondary auth method to retrieve.

Returns

Promise<MFAMethod | undefined>

Inherited from

BaseAuthMFARoute.getMethod


getMethods()

protected getMethods(uid): Promise<MFAMethod[]>

Defined in: src/routes/BaseAuthMFARoute.ts:202

Retrieves the list of secondary authentication methods for the user with the given id. This list is sent to the user and so should be obfuscated where reasonable so as to limit discovery when a password has been compromised.

Parameters

uid

string

The unique identifier of the user.

Returns

Promise<MFAMethod[]>

Inherited from

BaseAuthMFARoute.getMethods


getUser()

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

Defined in: src/routes/BaseAuthMFARoute.ts:252

Retrieves the user with the given unique id.

Parameters

uid

string

The unique id of the user to retrieve.

Returns

Promise<JWTUser | undefined>

The user if found, otherwise undefined.

Inherited from

BaseAuthMFARoute.getUser


initialize()

protected initialize(): Promise<void>

Defined in: src/routes/BaseAuthMFARoute.ts:54

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

Returns

Promise<void>

Inherited from

BaseAuthMFARoute.initialize


notifyContact()

protected notifyContact(contact, totp): Promise<void>

Defined in: src/routes/BaseAuthMFARoute.ts:259

Parameters

contact

OTPContact

totp

string

Returns

Promise<void>

Inherited from

BaseAuthMFARoute.notifyContact


obfuscateAlias()

protected obfuscateAlias(alias, type): string

Defined in: src/routes/BaseAuthMFARoute.ts:286

Obfuscates the given alias and returns the obfuscated value.

Parameters

alias

string

type

AliasType

Returns

string

Inherited from

BaseAuthMFARoute.obfuscateAlias


verify()

protected verify(name, password): Promise<JWTUser | undefined>

Defined in: src/routes/BaseAuthMFARoute.ts:304

Parameters

name

string

password

string

Returns

Promise<JWTUser | undefined>

Inherited from

BaseAuthMFARoute.verify