I want to inspect a jwt token just to peak on the content. I don't have the private key to validate it, but I still want to explore the content. When I try using System.IdentityModel.Tokens.Jwt
I don't get the claims as expected. I can see the token and payload on jwt.io, but not when I try in code. The code I have use is this:
var handler = new JwtSecurityTokenHandler();
var jsonToken = handler.ReadJwtToken(token);
Console.WriteLine("Claims: " + jsonToken.Claims.Count());
jsonToken.Claims.ToList().ForEach(c => Console.WriteLine("==> C: " + c.ToString()));
For the token I have it return 0 claims. I would expect to be able to access the payload of the token the same way as I see it on jwt.io, but can't figure out how. What am I doing wrong.