I have a access token from OAuth 2.0 which is encrypted using JwtSecurityTokenHandler.WriteToken(). After i decrypt it using JwtSecurityTokenHandler.ReadToken(), it returns me SecurityToken Object but i do not know how to loop and read the claim inside the decrypted token.
There is ways to read claim in JwtSecurityToken but unfortunately read token returns SecurityToken instead of JwtSecurityToken.
Hope someone could help.
You should be able to cast it as a JwtSecurityToken
:
var jwt = jwtSecurityTokenHandler.ReadToken(tokenString) as JwtSecurityToken;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With