The usual process for handling a JWT token as authentication in ASP.NET is:
- Get the token from the request and make sure it is valid.
- , , , .
, , , . , JWT , , .
, OWIN , OWIN , .
, , , ASP.NET Web API (OWIN) :
, :
[HttpGet]
[Authorize]
[Route("claims")]
public object Claims()
{
var claimsIdentity = User.Identity as ClaimsIdentity;
return claimsIdentity.Claims.Select(c =>
new
{
Type = c.Type,
Value = c.Value
});
}
User.Identity, , . , , JWT, API.