Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
jwt-generate
Advanced tools
Readme
Generate a JSON Web Token - JWT
npm install -g jwt-generate
jwt-generate <command>
Commands:
jwt-generate generate Generates a JWT.
jwt-generate decode <jwt> Decodes a JWT.
Options:
--version Show version number [boolean]
--help Show help [boolean]
jwt-generate generate
Generates a JWT. Either 'secret' or 'secretFile' must be supplied.
Options:
--version Show version number [boolean]
--help Show help [boolean]
--secret, -s JWT secret string.
--secretFile, -f File path containing the JWT Secret.
--algorithm, -a Choices: "RS256", "HS256". [string] [default: "HS256"]
--expire, --exp How long in seconds until the JWT should expire. [number]
--claims JWT claims.
jwt-generate decode <jwt>
Decodes a JWT.
Options:
--version Show version number [boolean]
--help Show help [boolean]
Generates a JWT signed with the secret 'my-secret' using the HS256 algorithm.
jwt-generate generate --secret my-secret
{
"headers": {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjAwMjYzOTIsImV4cCI6MTUyMDAyOTk5Mn0.5TkR3nHlPA2LJhe8jGxE26AnkeCkfFeVrJN5FdOUPew"
},
"jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjAwMjYzOTIsImV4cCI6MTUyMDAyOTk5Mn0.5TkR3nHlPA2LJhe8jGxE26AnkeCkfFeVrJN5FdOUPew"
}
Generates a JWT signed with private key file 'private_key.pem' using the HS256 algorithm.
jwt-generate generate --secretFile private_key.pem
{
"headers": {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjAwMjYzODAsImV4cCI6MTUyMDAyOTk4MH0.19sUG-ncAycxdosaZJDGpkeSfuugmEH_fCPRJtTsOI4"
},
"jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjAwMjYzODAsImV4cCI6MTUyMDAyOTk4MH0.19sUG-ncAycxdosaZJDGpkeSfuugmEH_fCPRJtTsOI4"
}
Generates a JWT signed with private key file 'private_key.pem' using the RS256 algorithm.
jwt-generate generate -f private_key.pem -a RS256
{
"headers": {
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE1MjAwMjYzNTIsImV4cCI6MTUyMDAyOTk1Mn0.AkPpR5BASPD4qY-y_RIkVuaRNTnnA4VCyq7qRPd7nwsbdRGifDlRVJi0RoxyzFAWBkgskTJJK3Zb8v_AF16yp8QkNx00SvTMGOYueFjk2cWxCOneJyJ14K4huflTvqmky5VTpI6Bv5l6ezrpZaWVM9bmpbqI-_QC6A74mFkC5T45WRPXx0K14YCL2lW8UelnRFb8b3y9CdOA088wU4fShLHQvzPS0lzH-WXjfHl5_Dt7AjV8Bwim1sJS1yZudebKV3qEnO9nd4OhMlTeFH2vxevPumtlmmqCf6e5K59x27KcIu7tfkRK81WjX1HP-UiD-p0rpcney3oBDMHcjwIqZQ"
},
"jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpYXQiOjE1MjAwMjYzNTIsImV4cCI6MTUyMDAyOTk1Mn0.AkPpR5BASPD4qY-y_RIkVuaRNTnnA4VCyq7qRPd7nwsbdRGifDlRVJi0RoxyzFAWBkgskTJJK3Zb8v_AF16yp8QkNx00SvTMGOYueFjk2cWxCOneJyJ14K4huflTvqmky5VTpI6Bv5l6ezrpZaWVM9bmpbqI-_QC6A74mFkC5T45WRPXx0K14YCL2lW8UelnRFb8b3y9CdOA088wU4fShLHQvzPS0lzH-WXjfHl5_Dt7AjV8Bwim1sJS1yZudebKV3qEnO9nd4OhMlTeFH2vxevPumtlmmqCf6e5K59x27KcIu7tfkRK81WjX1HP-UiD-p0rpcney3oBDMHcjwIqZQ"
}
Outputs the decoded JWT in JSON format.
jwt-generate decode eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1MjAwMjYyOTAsImV4cCI6MTUyMDAyOTg5MH0.lUGQ7n3QTWGLrH-KcMkCWsGlMWxO-QodOEdbGSeZF-A
{
"header": {
"typ": "JWT",
"alg": "HS256"
},
"payload": {
"iat": 1520026290,
"exp": 1520029890
},
"signature": "lUGQ7n3QTWGLrH-KcMkCWsGlMWxO-QodOEdbGSeZF-A"
}
FAQs
Generate a 'JSON Web Token' (JWT).
The npm package jwt-generate receives a total of 1 weekly downloads. As such, jwt-generate popularity was classified as not popular.
We found that jwt-generate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.