Abstract Class: BaseAuthMFARoute<U, S, A>
Defined in: src/routes/BaseAuthMFARoute.ts:22
Extended by
Type Parameters
U
U extends User
S
S extends Secret
A
A extends Alias
Constructors
Constructor
new BaseAuthMFARoute<
U,S,A>():BaseAuthMFARoute<U,S,A>
Returns
BaseAuthMFARoute<U, S, A>
Properties
aliasClass
abstractprotectedaliasClass:any
Defined in: src/routes/BaseAuthMFARoute.ts:23
aliasRepo?
protectedoptionalaliasRepo?:RepoUtils<A>
Defined in: src/routes/BaseAuthMFARoute.ts:27
authMiddleware?
protectedoptionalauthMiddleware?:AuthMiddleware
Defined in: src/routes/BaseAuthMFARoute.ts:30
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: src/routes/BaseAuthMFARoute.ts:33
messagingUtils?
protectedoptionalmessagingUtils?:MessagingUtils
Defined in: src/routes/BaseAuthMFARoute.ts:39
objectFactory?
protectedoptionalobjectFactory?:ObjectFactory
Defined in: src/routes/BaseAuthMFARoute.ts:36
secretClass
abstractprotectedsecretClass:any
Defined in: src/routes/BaseAuthMFARoute.ts:24
secretRepo?
protectedoptionalsecretRepo?:RepoUtils<S>
Defined in: src/routes/BaseAuthMFARoute.ts:41
template
protectedtemplate:string="login-otp"
Defined in: src/routes/BaseAuthMFARoute.ts:44
The name of the messaging template to use for sending notifications.
userClass
abstractprotecteduserClass:any
Defined in: src/routes/BaseAuthMFARoute.ts:25
userRepo?
protectedoptionaluserRepo?:RepoUtils<U>
Defined in: src/routes/BaseAuthMFARoute.ts:46
userUtils?
protectedoptionaluserUtils?:UserUtils<U,A>
Defined in: src/routes/BaseAuthMFARoute.ts:48
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>
convertAliasToMethod()
protectedconvertAliasToMethod(alias,obfuscate?):MFAMethod|undefined
Defined in: src/routes/BaseAuthMFARoute.ts:122
Parameters
alias
obfuscate?
boolean
Returns
MFAMethod | undefined
convertSecretToMethod()
protectedconvertSecretToMethod(secret):MFAMethod|undefined
Defined in: src/routes/BaseAuthMFARoute.ts:149
Parameters
secret
S
Returns
MFAMethod | undefined
getMethod()
protectedgetMethod(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>
getMethods()
protectedgetMethods(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[]>
getUser()
protectedgetUser(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.
initialize()
protectedinitialize():Promise<void>
Defined in: src/routes/BaseAuthMFARoute.ts:54
Called on server startup to initialize the route with any defaults.
Returns
Promise<void>
notifyContact()
protectednotifyContact(contact,totp):Promise<void>
Defined in: src/routes/BaseAuthMFARoute.ts:259
Parameters
contact
totp
string
Returns
Promise<void>
obfuscateAlias()
protectedobfuscateAlias(alias,type):string
Defined in: src/routes/BaseAuthMFARoute.ts:286
Obfuscates the given alias and returns the obfuscated value.
Parameters
alias
string
type
Returns
string
verify()
protectedverify(name,password):Promise<JWTUser|undefined>
Defined in: src/routes/BaseAuthMFARoute.ts:304
Parameters
name
string
password
string
Returns
Promise<JWTUser | undefined>