A sample go service for authenticating client requests
- Go
- Postgres
- Redis
- Docker and docker-compose
- Deps
BASE_URL localhost:8080/auth-gateway
- Register
GET {BASE_URL}/register
This endpoint registers a client service and gives it a secret to identify it during authentication
- Authorize
GET {BASE_URL}/authorize
This endpoint gives a client service a JWT token for authentication
- Validate Token
GET {BASE_URL}/validate
This endpoint validates a JWT token then authorises a client service
- Rotate Keys
GET {BASE_URL}/rotate
This endpoint rotates encryption keys used to generate JWT tokens
- Client service registers with the authentication service, details stored in the database and secret key is granted
- Using the secret key a client service requests for an authentication token, generated from an encryption key stored in cache
- Client service requests for validation of authentication token
- Encryption keys rotated through a cron every 24hrs, the cron triggers generation of new key and deletes any keys older than 48 hrs
make {ROOT_DIR}/start