preamble: almost all code for JWT stuff was taken from appleyboy's repository
If you are planning to use private/public keys, you should generate it first. There is example of generting RS512 keys below:
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS512.key
openssl rsa -in jwtRS512.key -pubout -outform PEM -out jwtRS512.key.pub
If you want to re-build *.pb.go files
protoc -I . ./*.proto --go_out=./ --go-grpc_out=./ --go-grpc_opt=paths=source_relative --experimental_allow_proto3_optional
Whole example for server-side is here
How to run server-side:
go run .
Whole example for client-side is here
How to run client-side:
go run .
If you have troubles or questions please open an issue. PRs are welcome!
- github.com/golang-jwt/jwt - License is MIT
- gRPC and protobuf for doing "'client-server'" application - grpc. License is Apache-2.0
You can check it here