This code uses the Ruby JWT gem: https://github.com/jwt/ruby-jwt and runs through a couple of different scenarios.
- building a JWT with the 'none' algorithm
- building a JWT with the 'hmac' algorithm
- building a JWT with the 'rsa' algorithm
- building a JWT with the 'hmac' algorithm but verifying additional claims
- decoding an invalid JWT with the 'hmac' algorithm
bundle install
ruby <file>
Tested on ruby 2.7.1.
JWTs originally built by FusionAuth.