ClaimsPrincipal
ClaimsPrincipal is a .NET security class representing a principal through one or more identities and their associated claims.
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
- Represents the current request user so application code can inspect user information and behave accordingly.
- How deep it goes
- Defines principals and claims, then traces sign-in, cookie restoration, and custom-claim use without detailing ClaimsPrincipal internals.
- Examples
- Uses an anonymous request, email-and-password sign-in, and a FullName claim added during registration and read in a Razor template.
- What you can do after
- Apply it via ASP.NET Core Identity to add a user claim and read it from the current principal.
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 →
Related concepts
- middlewareproduced by · Middleware is an intermediate software component or layer that processes or mediates requests, messages, or operations between other components, often adding behavior or controlling their flow.
- SignInManager<T>produced by · SignInManager<T> is an ASP.NET Core Identity service that manages sign-in, sign-out, and related authentication operations for user accounts.
- principalimplements · A principal is a security identity representing an entity, such as a person, application, service, machine, or process, in an authentication or authorization system.
- AuthenticationMiddlewareproduced by · AuthenticationMiddleware is ASP.NET Core middleware that authenticates the user associated with an HTTP request.
- claimhas part · A claim is an assertion or formal demand concerning a subject, fact, right, or loss.
- HttpContextequivalent to · HttpContext is the ASP.NET Core object representing the information, state, and features associated with a single HTTP request and its response.
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.

