https://github.com/orrc/jwt-generator-docker
A simple command-line utility to encode JSON Web Tokens (JWT).
https://github.com/orrc/jwt-generator-docker
cli-app command-line-tool docker-image json-web-token jwt
Last synced: 10 months ago
JSON representation
A simple command-line utility to encode JSON Web Tokens (JWT).
- Host: GitHub
- URL: https://github.com/orrc/jwt-generator-docker
- Owner: orrc
- License: unlicense
- Created: 2020-05-28T13:24:03.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-11T11:37:44.000Z (about 6 years ago)
- Last Synced: 2025-09-07T21:02:31.906Z (10 months ago)
- Topics: cli-app, command-line-tool, docker-image, json-web-token, jwt
- Language: Shell
- Homepage: https://hub.docker.com/r/orrc/jwt-generator
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jwt-generator
A simple command-line utility to encode JSON Web Tokens (JWT).
## Usage
The Docker container takes two parameters:
- the secret used for signing the token
- the JSON payload
The JSON payload can be provided as an argument:
```sh
docker run --rm orrc/jwt-generator my-shared-secret '{"foo": "bar", "num": 1234}'
```
Or it can be piped in:
```sh
echo '{"foo": "bar", "num": 1234}' | docker run --rm -i orrc/jwt-generator my-shared-secret
```
The JWT is printed to stdout, followed by a newline.
## Credits
This is just a convenient wrapper around a handy [Bash script][0] created by [@williamhaley][1], including some [shell magic][2] by Filipe Fortes.
[0]:https://willhaley.com/blog/generate-jwt-with-bash/
[1]:https://github.com/williamhaley
[2]:https://fortes.com/2019/bash-script-args-and-stdin/