Hello I am working on JWT token and trying to claim role using razor view using Asp .net core. For that I tried to use the following code.
@{
var jwtHandler = new JwtSecurityTokenHandler();
var tokenContent = jwtHandler.ReadToken(tokenModel.Result) as JwtSecurityToken;
var role = tokenContent.Claims.First(claim => claim.Type == "Role").Value;
var email = tokenContent.Claims.First(claim => claim.Type == "email").Value;
}
I am getting this error:
the type or namespace name 'jwtsecuritytokenhandler' could not be found
How can I claim role using razor view?