@bestcodetools/jwt-cli
v0.1.2
Published
Downloads
175
Maintainers
Readme
@bestcodetools/jwt-cli
Usage
jwt <command> [options]
Commands:
generate
Generate a token
jwt sign --secret=secret --data='{"name": "John Doe"}'
on Windows Command Prompt:
jwt sign --secret=secret "--data={""name:"": ""John Doe""}"
You can also set some optional parameters like algorithm (default is none), subject, issuer, expiresIn; for example:
- --algorithm=H256
- --expires-in "1 day"
- --subject=login
- --issuer=myapp
- --allow-insecure-key-sizes
- --allow-invalid-asymmetric-key-types
parse
Parse a token
jwt parse --token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
verify
Verify a token
jwt verify --secret=secret --token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ