How do I get current user in .NET Core Web API (from JWT Token)
After a lot of struggling (and a lot of tuturials, guides, etc) I managed to setup a small .NET Core REST Web API with an Auth Controller issuing JWT tokens when stored username and password are valid. The token stores the user id as sub claim. I also managed to setup the Web API to validate those tokens when a method uses the Authorize annotation. app.UseJwtBearerAuthentication(...) Now my question: How do I read the user id (stored in the subject claim) in my controllers (in a Web API)? It is basically this question ( How do I get current user in ASP .NET Core ) but I need an answer for a