So the application this is used in is sitting behind an Nginx proxy with embedded Lua script that validates JSON Web Tokens and extracts the token properties into headers of the form:
JWT-Claim: [email protected]
JWT-Claim: subType=Platinum
This means no actual verification is required in the .NET code, but we still want to create a ClaimsPrincipal
for the HttpContext
.
The extension method shown above means that in the Startup.Configure
method, we just have to call:
public void Configure(IApplicationBuilder app)
{
// ...
app.UseHeaderClaims();
// ...
}