Part of auth service for generating and refreshing access (JWT) and refresh (RT) token pair.
JWT config: algorithm SHA512
RT config: algorithm SHA256 (valid base64 string)
- GET /token - get token pair (JWT, RT) by guid query parameter (requires data in MongoDB)
- POST /refresh - refresh token pair (JWT, RT) by refresh token and guid (also requires data in MongoDB)
- go.mongodb.org/mongo-driver/mongo
- golang.org/x/crypto/bcrypt
- github.com/golang-jwt/jwt
- github.com/joho/godotenv
- Run MongoDB, create database and table, add some data into table.
- Set env variables according
.env.example
in.env
file. - Install required packages
- Run the app.