https://github.com/telefonica/jwt-bulk-generator
Script to generate JWT tokens and store them in a csv file
https://github.com/telefonica/jwt-bulk-generator
Last synced: 9 months ago
JSON representation
Script to generate JWT tokens and store them in a csv file
- Host: GitHub
- URL: https://github.com/telefonica/jwt-bulk-generator
- Owner: Telefonica
- License: apache-2.0
- Created: 2015-10-08T11:09:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-08T16:43:40.000Z (over 10 years ago)
- Last Synced: 2025-07-03T12:06:12.749Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 145 KB
- Stars: 2
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jwt-bulk-generator
This is a script to generate [JWTs](http://jwt.io/) and store them in a file. Each JWT is stored in a new line within the file.
## Installation
Prerequisites:
* Node JS 0.10.26 or higher.
* Tools: git and npm.
```sh
git clone https://github.com/TDAF/jwt-bulk-generator.git
cd jwt-bulk-generator
npm install
```
## Running
```sh
node lib/jwt-bulk-generator.js -n 1000 -p examples/payload.json -k examples/key.json -o jwts.csv -e 250000 --prefix "tel:+34"
```
Script options are the following:
```sh
Options:
-n, --number Number of JWTs to generate
-p, --payloadFile File where the input token payload is stored
-k, --keyFile File where the key is stored
-o, --outputFile File where the generated tokens will be stored
-e, --expiration Expiration for the JWTs, in seconds from now
--prefix Prefix for phone numbers in jwt (e.g. tel:+34)
[defecto: "tel:+34"]
```
## Using templates
See working examples at the examples directory. Note that the script will substitute, for each token, the appearance of ```{{{uuid}}}``` with a freshly generated uuid.v4() and ```{{{phone}}}``` with a freshly generated 9 digits-long phone number.