FusionAuth / fusionauth-example-go-jwt

JWT manipulation in golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go JWT Examples

This code uses the go jwt library: https://github.com/golang-jwt/jwt and runs through a couple of different scenarios.

  • 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
  • decoding a JWT with the 'hmac' algorithm and the wrong key
  • re-issuing an 'rsa' signed JWT with an 'hmac' algorithm

To install

go run <file>

Environment

Tested on go 1.15.7 and 1.21.1

About

JWT manipulation in golang

License:Apache License 2.0


Languages

Language:Go 100.0%