Class: BaseImpersonationRouteMongo
Defined in: auth/src/routes/mongo/BaseImpersonationRouteMongo.ts:8
A set of routes allowing a trusted user the ability to temporarily impersonate any other user in the system without needing to explicitly log in to that user's account or know their login credentials.
This mints a (non-elevated) token for the target user with the same roles and scopes that the target user would acquire after a normal login.
Extends
Constructors
Constructor
new BaseImpersonationRouteMongo():
BaseImpersonationRouteMongo
Returns
BaseImpersonationRouteMongo
Inherited from
BaseImpersonationRoute.constructor
Properties
auditLogUtils?
protectedoptionalauditLogUtils?:AuditLogUtils
Defined in: auth/src/routes/BaseImpersonationRoute.ts:55
Inherited from
BaseImpersonationRoute.auditLogUtils
defaultScopes
protecteddefaultScopes:string[] =[]
Defined in: auth/src/routes/BaseImpersonationRoute.ts:58
Inherited from
BaseImpersonationRoute.defaultScopes
tokenUtils?
protectedoptionaltokenUtils?:TokenUtils
Defined in: auth/src/routes/BaseImpersonationRoute.ts:71
Inherited from
BaseImpersonationRoute.tokenUtils
trustedProxies
protectedtrustedProxies:string[] =[]
Defined in: auth/src/routes/BaseImpersonationRoute.ts:74
Inherited from
BaseImpersonationRoute.trustedProxies
userClass
protecteduserClass:any=UserMongo
Defined in: auth/src/routes/mongo/BaseImpersonationRouteMongo.ts:9
Overrides
BaseImpersonationRoute.userClass
userRepo?
protectedoptionaluserRepo?:RepoUtils<UserMongo>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:82
Inherited from
BaseImpersonationRoute.userRepo
Methods
impersonate()
impersonate(
body,req,res,user):Promise<AuthResult>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:129
Parameters
body
req
HttpRequest
res
HttpResponse
user
JWTUser
Returns
Promise<AuthResult>
Inherited from
BaseImpersonationRoute.impersonate
initialize()
protectedinitialize():Promise<void>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:85
Returns
Promise<void>
Inherited from
BaseImpersonationRoute.initialize
stopImpersonating()
stopImpersonating(
req,res,user):Promise<{restored:boolean; }>
Defined in: auth/src/routes/BaseImpersonationRoute.ts:192
Parameters
req
HttpRequest
res
HttpResponse
user
JWTUser
Returns
Promise<{ restored: boolean; }>