Enterprise Application Architecture with .NET Core
by Ganesan Senthilvel, Ovais Mehboob Ahmed Khan, Habib Qureshi
Claims transformation
Every cookie has an expiry time and the default cookie expiration time in ASP.NET Identity Core is 30 minutes, which is configurable. Claims transformation is a valuable feature that allows developers to add or update claims on every request. For example, if at a particular time we don't want a user to access a resource. We can add a piece of information through claims transformation and validate it through the Authorize attribute in our MVC or Web API controller or action level.
Let's go through an example in which we will add the AllowSecure claim that will be validated when the user accesses the AdminController. The claims transformation has to be added in the HTTP pipeline in the Startup class. Add the following ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access