Skip to main content

Class: BaseImpersonationRouteSQL

Defined in: auth/src/routes/sql/BaseImpersonationRouteSQL.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 BaseImpersonationRouteSQL(): BaseImpersonationRouteSQL

Returns​

BaseImpersonationRouteSQL

Inherited from​

BaseImpersonationRoute.constructor

Properties​

auditLogUtils?​

protected optional auditLogUtils?: AuditLogUtils

Defined in: auth/src/routes/BaseImpersonationRoute.ts:55

Inherited from​

BaseImpersonationRoute.auditLogUtils


defaultScopes​

protected defaultScopes: string[] = []

Defined in: auth/src/routes/BaseImpersonationRoute.ts:58

Inherited from​

BaseImpersonationRoute.defaultScopes


tokenUtils?​

protected optional tokenUtils?: TokenUtils

Defined in: auth/src/routes/BaseImpersonationRoute.ts:71

Inherited from​

BaseImpersonationRoute.tokenUtils


trustedProxies​

protected trustedProxies: string[] = []

Defined in: auth/src/routes/BaseImpersonationRoute.ts:74

Inherited from​

BaseImpersonationRoute.trustedProxies


userClass​

protected userClass: any = UserSQL

Defined in: auth/src/routes/sql/BaseImpersonationRouteSQL.ts:9

Overrides​

BaseImpersonationRoute.userClass


userRepo?​

protected optional userRepo?: RepoUtils<UserSQL>

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​

ImpersonateInput

req​

HttpRequest

res​

HttpResponse

user​

JWTUser

Returns​

Promise<AuthResult>

Inherited from​

BaseImpersonationRoute.impersonate


initialize()​

protected initialize(): 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; }>

Inherited from​

BaseImpersonationRoute.stopImpersonating