I\'m trying to do a really simple implementation of JWT bearer authentication with ASP.NET Core. I return a response from a controller a bit like this:
var i
Access User.Claims
instead of ClaimsPrinciple.Current.Claims
.
From Introduction to Identity at docs.asp.net:
...inside the
HomeController.Index
action method, you can view theUser.Claims
details.
Here is the relevant source code from the MVC repository:
public ClaimsPrincipal User
{
get
{
return HttpContext?.User;
}
}