HttpContext
The ASP.NET Core object holding everything about the current HTTP request and response, including the user, headers, path and request services.
In more detail
A new one is created for every request and discarded when the response is complete. Middleware and endpoints read the request from it and write the response to it; authentication puts the user's claims on it.
Related terms
- middleware — Code that sits between an incoming request and the handler that answers it, doing a shared job such as logging, authentication or rate limiting.
- ClaimsPrincipal — The .NET object representing the current user, holding one or more identities and their claims.
Taught in
- The ASP.NET Core Middleware Pipeline — Modern .NET Core, C# & Enterprise Microservices
- Authentication: JWTs and Claims — Modern .NET Core, C# & Enterprise Microservices