As you saw components of the token, you may wonder how to generate sign tokens. In this topic, I will show you a handy online tool that allows us to quickly generate it. It is the jwt.io web page. For testing purposes, I recommend using it, if you do not have any alternatives. For other cases, I would suggest using a custom code that will generate tokens for you.
This site gives us two important featuers:
- JWS generation
- JWS validation
When you know what claims you want, just put them in the JWT payload data. Once you done this, put public and private key for RSA or secret key for HMAC. On the screen below you can see my custom payload and key pair. As a result encoded part is automatically regenerated. I can copy it and paste it into postman or for whatever reasons I need it.
It is even easier, as you just need to paste encoded token and provide public key for RSA or secret key for HMAC. Once you paste token header and paylaod parts will be decoded to JSON objects. So you can easily inspect the content of the token.