A very simple way of implementing JWT Authentication in a REST API using Go
go get -u github.com/john-deng/jwt-demo
openssl genrsa -out config/app.rsa 1024
openssl rsa -in config/app.rsa -pubout > config/app.rsa.pub
go run main.go
curl -H """Authorization: Bearer $(curl -d '{"username":"johndeng","password":"p@ssword"}' -H "Content-Type: application/json" -X POST http://localhost:3001/login 2>/dev/null | jq -r '.token')""" http://localhost:3001/ping