When law firm tenants encounter complex domain issues requiring platform support engineers to assist remotely, traditional workarounds—such as asking customers for their plaintext passwords or connecting directly to production databases—introduce catastrophic data compliance liabilities and legal exposure.
BitzOrcas.Modern incorporates an industrial-grade Operator Impersonation Sandbox Architecture:
- Dual-Identity JWTs: Dispatched only after formal support ticket approval, carrying both the real
actorid(support operator) and targetsub(impersonated tenant user), with a strictly capped 15-minute lifespan; - Fail-Closed Sensitive Operation Sandbox: Stage 3 in the application pipeline (
DelegatedSessionRestrictionPipelineBehavior) automatically blocks any request marked withIDelegationSensitiveRequest(such as password changes, MFA updates, and API key generation); - Immutable Dual-Identity Auditing: Every business operation automatically records both the acting operator and the target customer context in the persistent audit envelope.
This guide details token issuance, pipeline enforcement, and audit persistence for operator impersonation.
Dual-Identity Impersonation Sequence
Step 1: Request and Issue Short-Lived Dual-Identity JWT
Platform support personnel initiate an impersonation session from the SaaS Host management console:
# 1. Provide platform admin bearer token# 2. Request a 15-minute dual-identity credential for target tenant usercurl -X POST http://localhost:6881/api/identity/impersonation/start \ -H "Authorization: Bearer YOUR_PLATFORM_ADMIN_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "targetTenantId": "lawfirm-alpha", "targetUserId": "USR-ALICE", "ticketNumber": "TICKET-2026-88902", "reason": "Investigate matter litigation stage advancement failure", "durationMinutes": 15 }'The resulting JWT carries authoritative dual-identity claims:
sub:USR-ALICE(impersonated tenant user ID)tenant:lawfirm-alpha(target tenant ID)actortype:PlatformOperator(impersonation principal type)actorid:OPS-001(actual support operator identifier for audit attribution)
Step 2: Pipeline Interception (DelegatedSessionRestrictionPipelineBehavior)
At Stage 3 of the 10-stage execution pipeline, DelegatedSessionRestrictionPipelineBehavior enforces fail-closed isolation.
Any message implementing IDelegationSensitiveRequest (such as password resets, MFA enrollment, or API token generation) is immediately rejected:
using System.Threading;using System.Threading.Tasks;using BitzOrcas.Application.Abstractions;using BitzOrcas.Domain.Results;using Mediator;
namespace BitzOrcas.Application.Pipelines;
/// <summary>/// Rejects credential, password, and MFA mutation requests when executed under an impersonated session/// </summary>/// <typeparam name="TMessage">Message type implementing the sensitive marker interface.</typeparam>/// <typeparam name="TResponse">Result response type capable of constructing failures.</typeparam>public sealed class DelegatedSessionRestrictionPipelineBehavior<TMessage, TResponse>( ICurrentUser currentUser) : IPipelineBehavior<TMessage, TResponse> where TMessage : IMessage, IDelegationSensitiveRequest where TResponse : IResult<TResponse>{ /// <summary> /// Passes standard requests, while failing closed for impersonated sessions /// </summary> public async ValueTask<TResponse> Handle( TMessage message, MessageHandlerDelegate<TMessage, TResponse> next, CancellationToken cancellationToken) { // Core security invariant: block sensitive credential changes during impersonation if (currentUser.User.IsImpersonating) { return TResponse.Failure( ApplicationErrors.Authorization.DelegatedSensitiveOperationDenied); }
return await next(message, cancellationToken); }}Step 3: Immutable Dual-Identity Audit Persistence
When permitted operations execute within an impersonated session, Stage 9 of the pipeline captures both identities in the audit log:
{ "auditId": "AUDIT-20260923-008821", "tenantId": "lawfirm-alpha", "userId": "USR-ALICE", "isImpersonated": true, "operatorId": "OPS-001", "action": "legal.matters.advance-stage", "resource": "MAT-2026-0001", "ipAddress": "192.168.1.102", "userAgent": "Mozilla/5.0 BitzOrcas/Modern OperatorConsole", "timestampUtc": "2026-09-23T04:20:00Z"}Summary
The Operator Impersonation sandbox enforces rigorous security guarantees:
- Zero Plaintext Credentials: Operators never handle customer passwords; sessions expire automatically after 15 minutes;
- Sensitive Operations Immune to Tampering:
IDelegationSensitiveRequestcontracts fail-closed at Stage 3 of the pipeline; - Complete End-to-End Attribution: Dual-identity claims span logs and database audits, ensuring all operator actions are 100% auditable.