Abstract Class: BaseAuthBasicRoute<U, S, A>
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:52
Authenticates a user via HTTP Basic (RFC 7617) against their stored password/app-password secrets.
This is the route a downstream service with no interactive UI - e.g. a mail server validating a legacy
mail client's credentials against this authorization server - would call.
An account with requireMFA set cannot complete a real password login here (Basic auth has no way to
prompt for a second factor), UNLESS the submitted value matches one of the account's own app-password
secrets (see SecretType.APP_PASSWORD, BaseSecretRoute.validateAppPasswordCreate()). That bypass is
the entire point of app passwords: a standing, individually-revocable, high-entropy credential the user
explicitly creates for one Basic-auth-only client that can't do MFA, so enabling that one client doesn't
require disabling MFA for the account as a whole. A real password remains subject to requireMFA here
exactly as before - the bypass only ever applies to an app-password secret.
Extended by
Type Parameters
U
U extends User
S
S extends Secret
A
A extends Alias
Constructors
Constructor
new BaseAuthBasicRoute<
U,S,A>():BaseAuthBasicRoute<U,S,A>
Returns
BaseAuthBasicRoute<U, S, A>
Properties
aliasClass
abstractprotectedaliasClass:any
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:53
appPasswordEnabled
protectedappPasswordEnabled:boolean=true
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:69
Set to false to disable the app-password bypass below deployment-wide. An already-created app
password stops authenticating (falling through to the normal requireMFA/password checks, which
then reject it since it isn't a password-type secret) but is not deleted - re-enabling this
restores it exactly as it was. See BaseSecretRoute.appPasswordEnabled, which independently gates
creating new app passwords - the two are meant to be kept in sync, but this route reads its own
copy of the config so authentication doesn't depend on BaseSecretRoute being mounted.
auditLogUtils?
protectedoptionalauditLogUtils?:AuditLogUtils
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:72
authMiddleware?
protectedoptionalauthMiddleware?:AuthMiddleware
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:75
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:78
jwtConfig?
protectedoptionaljwtConfig?:any
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:81
logger
protectedlogger:any
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:84
passwordConfig
protectedpasswordConfig:PasswordConfig
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:87
rateLimiter?
protectedoptionalrateLimiter?:RateLimiter
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:90
secretClass
abstractprotectedsecretClass:any
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:54
secretRepo?
protectedoptionalsecretRepo?:RepoUtils<S>
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:92
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:95
trustedProxies
protectedtrustedProxies:string[] =[]
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:98
userClass
abstractprotecteduserClass:any
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:55
userUtils?
protectedoptionaluserUtils?:UserUtils<U,A>
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:100
Methods
authenticate()
authenticate(
user,req,res):Promise<AuthResult|undefined>
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:286
Authenticates the user using HTTP Basic 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>
initialize()
protectedinitialize():Promise<void>
Defined in: auth/src/routes/BaseAuthBasicRoute.ts:106
Called on server startup to initialize the route with any defaults.
Returns
Promise<void>