Class ImpersonationController

Assembly: redb.Identity.Management.dll

N7-3 — admin impersonation overlay. Forwards to direct-vm://identity-manage-impersonation.

Routes are mounted under /admin/impersonate; the granular scope guard
(see GranularScopeGuardProcessor) requires the identity:impersonate
scope (or master identity:manage) on the caller's bearer token.


This endpoint does NOT mint a token. It validates the target user exists, then writes
an audit event recording the admin's sub and the impersonated user id. The BFF
maintains the actual impersonation state (session cookie) and routes subsequent admin
calls accordingly.

[Route("admin/impersonate")]
public class ImpersonationController : IdentityControllerBase

Inheritance

Object→RedbController→IdentityControllerBase→ImpersonationController

Inherited Members

Methods

Start(string, StartImpersonationRequest?)

Start an impersonation session. userId in the path is the target user id;

[HttpPost("start/{userId}")]
public Task<object?> Start(string userId, StartImpersonationRequest? body = null)

Stop(string)

Stop an active impersonation session. userId in the path is the target user id

[HttpPost("stop/{userId}")]
public Task<object?> Stop(string userId)