liveBook · Manning

ClaimsPrincipal

ClaimsPrincipal is a .NET security class representing a principal through one or more identities and their associated claims.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

ClaimsPrincipal is a .NET security object that represents an authenticated user through a collection of claims and identities.

How it is used
Uses the request principal to identify the current user and support user-dependent behavior.
How deep it goes
Explains claims, request access, cookie authentication, and Identity-backed customization through a registration example.
Examples
Uses a FullName claim added during registration and read from a Razor page.
What you can do after
Apply it via ASP.NET Core Identity to add user claims and retrieve their values in Razor.

Read how ASP.NET Core in Action, 3e explains ClaimsPrincipal →

Building Web APIs with ASP.NET Core

ClaimsPrincipal is a .NET identity object representing a user or caller through one or more claims-based identities.

How it is used
Supports policy-based authorization by exposing the current user's claims to assertion checks.
How deep it goes
Explains claim inspection and value transformation, but stops short of implementing custom requirements and authorization handlers.
Examples
Uses moderator and mobile-phone claims plus a date-of-birth claim to demonstrate policy checks.
What you can do after
Apply it via ASP.NET Core authorization policies to inspect claims and restrict controllers, actions, or Minimal API methods.

Read how Building Web APIs with ASP.NET Core explains ClaimsPrincipal →

Also covered in

Related concepts

Questions about ClaimsPrincipal

What is ClaimsPrincipal?

ClaimsPrincipal is a .NET security class representing a principal through one or more identities and their associated claims.

Which Manning books explain ClaimsPrincipal?

ASP.NET Core in Action, 3e and Building Web APIs with ASP.NET Core.

What are the parts of ClaimsPrincipal?

ClaimsPrincipal includes claim.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.