Connect a JWT to the User property in the Controller
问题 I have a Web API .NET Core 3.0 Service. It gets a header that contains a JWT with claims. I added the following to ConfigureServices in Startup.cs to map my JWT to the .NET Core Authentication system: services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) .AddJwtBearer(configureOptions => { configureOptions.Events = new JwtBearerEvents() { OnMessageReceived = context => { context.Token = context.HttpContext.Request.Headers["X-JWT-Assertion"]; return Task.CompletedTask; } }; }); I