Q47: How do you handle User Impersonation securely in administrative systems using JWTs?
Administrative user impersonation allows support agents to view systems as a target customer without requesting the user's password.
Secure Pattern:
- Require the admin to perform step-up MFA before requesting impersonation.
- Auth server issues an Impersonation Token containing explicit actor claims (
actclaim per RFC 8693). - Payload includes
sub: "user_123"(target customer) alongsideact: { "sub": "admin_456" }(actual administrator). - Audit logging systems record both the target user ID and the acting administrator ID for compliance logging.
Key Takeaways
Use RFC 8693 Actor (
act) claims to distinguish the acting admin from the target subject user.Always log impersonated actions in audit databases for security compliance tracking.