Skip to main content

Command Palette

Search for a command to run...

Impersonation in a .Net core application with Identity Server 4

Published
1 min read
Impersonation in a .Net core application with Identity Server 4
V

Web architect cum developer working in the .NET ecosystem with Azure and having completed many successful projects and products mainly Syncfusion Data Platform - Bold BI and Bold Reports.

Skilled in Full stack web development involving ASP.Net Core MVC, Web API, SQL, jQuery, Scss, Webhooks, Azure, DevOps, TDD, and Agile development.

Implemented a robust and flexible permission management system for an enterprise server application which is the base for Syncfusion's Data Platform - boldbi.com and Syncfusion Report Platform - boldreports.com

Identity Server 4 does not provide native impersonation support which I needed for one of my projects. I have implemented one on top of it.

Here is the sample project I did on GitHub.

https://github.com/venbacodes/ImpersonationSample-IdentityServer4

This is a sample application to show a way to implement impersonation when using Identity Server.

Key Points

  1. Authorization policy has been set up to restrict impersonation to users with specific roles.
  2. Admin users' email is added as a claim while impersonating so that it can be used while ending the impersonation.
  3. Logic is simple as authenticating with the victim users' email for impersonation with additional claims to track the impersonation and the impersonating user.

More from this blog

V

Venky Writes

14 posts

Web architect cum developer working in the .NET ecosystem with Azure and having completed many successful projects and products mainly Syncfusion Data Platform - Bold BI and Bold Reports.