0

it's simple to read payload if JWT token with hash algorithms(hs256 f.e.):

string Payload = JwtCore.JsonWebToken.DecodeToObject(token, secretKey) as Dictionary<string, object>;

But jwtCore use only with hash algorithms, how to be with rs algorithms?

Now I have token on RS256 and also have Public key

On server I need only send token to another server for validate and to read data from payload

On site jwt.io I've just put my token with no public key and there is show me payload, how ca I do it on c# .net Core?

Igor Cova
  • 3,126
  • 4
  • 31
  • 57
  • You can read the token using `JwtSecuirtyTokenHandler`. – user1672994 Jun 18 '18 at 10:43
  • When you can read your token on jwt.io, it's probably a "normal" signed JWT (aka JWS). In this case, the algorithm is only relevant if you want to **verify** the token. **Decoding** the payload is not influenced by the signing algorithm, the payload is just a base64url encoded JSON. Or are you talking about encryted tokens (JWE)? – jps Jun 18 '18 at 10:53
  • @user1672994 Pls send some link with tutorial - how to read payload jwt token with rs256 – Igor Cova Jun 18 '18 at 11:48
  • @jps token readed normal on jwt.io without keys. It's probable mean that token isn't ecrypted. I don't need to validate token, just read some data from payload – Igor Cova Jun 18 '18 at 11:51
  • 1
    @user1672994 Thanks I found solution https://stackoverflow.com/questions/38340078/how-to-decode-jwt-token – Igor Cova Jun 18 '18 at 12:06

0 Answers0