Read SecurityToken C # Claims

I have an access token from OAuth 2.0 which is encrypted using JwtSecurityTokenHandler.WriteToken (). After I decrypted it using JwtSecurityTokenHandler.ReadToken (), it returns a SecurityToken object to me, but I don’t know how to loop and read the application in the decrypted token.

There are ways to read the application in the JwtSecurityToken, but unfortunately the read token returns a SecurityToken instead of a JwtSecurityToken.

Hope someone can help.

+6
source share
1 answer

You should use it as a JwtSecurityToken :

 var jwt = jwtSecurityTokenHandler.ReadToken(tokenString) as JwtSecurityToken; 
+13
source

All Articles