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
- 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
- AuthenticationMiddlewareproduced by · AuthenticationMiddleware is ASP.NET Core middleware that authenticates the user associated with an HTTP request.
- claimhas part · A claim is an assertion, allegation, or request concerning a fact, attribute, right, entitlement, or proposition that may be recognized or evaluated.
- middlewareproduced by · Middleware is software that mediates communication or processing between components, often by intercepting, transforming, or coordinating operations in a pipeline.
- principalimplements · A security principal is an identity representing an entity that can be authenticated or granted permissions in a security system.
- 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.
- cookieproduces · An HTTP cookie is a small piece of data stored by a client and sent with subsequent requests within its scope, often to maintain state or preferences.
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.

