ClaimsPrincipal
The .NET object representing the current user, holding one or more identities and their claims.
In more detail
Authentication creates it and stores it on HttpContext.User; authorization reads it. Identity.IsAuthenticated reports whether a credential was validated.
Related terms
- claim — One statement inside a token, as a name and value, such as sub (subject), exp (expiry), iss (issuer), aud (audience) or scope.
- authentication — Establishing who a request represents, for example by checking a password, a session cookie or a signed token.
- HttpContext — The ASP.NET Core object holding everything about the current HTTP request and response, including the user, headers, path and request services.
Taught in
- Authentication: JWTs and Claims — Modern .NET Core, C# & Enterprise Microservices
- Role-Based and Policy-Based Authorization — Modern .NET Core, C# & Enterprise Microservices