https://github.com/tbaud0n/go-jwt-auth-service
Simple Golang HTTP server to generate/validate JWT tokens
https://github.com/tbaud0n/go-jwt-auth-service
docker-image go golang jwt jwt-authentication jwt-bearer-tokens jwt-server jwt-tokens service
Last synced: 5 months ago
JSON representation
Simple Golang HTTP server to generate/validate JWT tokens
- Host: GitHub
- URL: https://github.com/tbaud0n/go-jwt-auth-service
- Owner: tbaud0n
- Created: 2019-01-08T13:30:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-14T14:25:36.000Z (over 7 years ago)
- Last Synced: 2024-11-15T04:41:11.461Z (over 1 year ago)
- Topics: docker-image, go, golang, jwt, jwt-authentication, jwt-bearer-tokens, jwt-server, jwt-tokens, service
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/tbaud0n/go-jwt-auth-service)
# go-jwt-auth-service
Simple JWT service to generate/validate JWT tokens
## Configuration
The service is configurable via command line flags or by environment variables.
**JWT_PORT | -port** : The HTTP port the service listen to
**JWT_ISSUER | -issuer** : The issuer set in the generated tokens
**JWT_KEY | -key** : The key used to sign/check the token
**JWT_DURATION | -duration** : Validity duration (in second) of the generated tokens
**JWT_AUDIENCE | -audience** : The audience set in the generated tokens
## Usage
The `Makefile` can execute the build and run operations or you can execute it manually.
### Command line
Build the binary : `go build -o jwtservice ./...`
Run the service : `jwtservice -key YOUR_KEY -port PORT_TO_LISTEN -issuer YOUR_ISSUER`
### Docker
Generate the docker image : `docker build -t jwtservice .`
Run the docker image : `docker run --rm -p PORT_TO_LISTEN:PORT_TO_LISTEN -e JWT_PORT=PORT_TO_LISTEN -e JWT_KEY=YOUR_JWT_KEY -e JWT_DURATION=TOKEN_DURATION -e JWT_ISSUER=TOKEN_ISSUER jwtservice`