Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Jwt | 7,060 | 6,817 | 535 | 6 days ago | 53 | February 25, 2023 | 7 | bsd-3-clause | PHP | |
A simple library to work with JSON Web Token and JSON Web Signature | ||||||||||
Pyjwt | 4,692 | 9,443 | 2,192 | 12 days ago | 48 | July 18, 2023 | 18 | mit | Python | |
JSON Web Token implementation in Python | ||||||||||
Jsmn | 3,265 | 5 months ago | 89 | mit | C | |||||
Jsmn is a world fastest JSON parser/tokenizer. This is the official repo replacing the old one at Bitbucket | ||||||||||
Node Jwt Simple | 1,320 | 7,828 | 646 | 2 years ago | 13 | March 30, 2019 | 33 | mit | JavaScript | |
JWT(JSON Web Token) encode and decode module for node.js | ||||||||||
Vault Ui | 1,299 | 1 | 5 years ago | 3 | October 04, 2017 | 50 | other | JavaScript | ||
Vault-UI — A beautiful UI to manage your Vault, written in React | ||||||||||
Frangipanni | 1,190 | 3 months ago | 6 | April 10, 2021 | 7 | mit | Go | |||
Program to convert lines of text into a tree structure. | ||||||||||
Token Lists | 1,162 | 387 | 7 days ago | 33 | July 05, 2023 | 185 | mit | TypeScript | ||
📚 The Token Lists specification | ||||||||||
Spring Boot Jwt | 1,022 | 2 years ago | mit | Java | ||||||
JWT auth service using Spring Boot, Spring Security and MySQL | ||||||||||
Jwt | 844 | 6 years ago | mit | Java | ||||||
webapp用户身份认证方案 JSON WEB TOKEN 实现Deme示例,Java版 | ||||||||||
Jwt Cpp | 666 | a month ago | 5 | June 22, 2022 | 38 | mit | C++ | |||
A header only library for creating and validating json web tokens in c++ |
JWT(JSON Web Token) encode and decode module for node.js.
$ npm install jwt-simple
let jwt = require('jwt-simple');
let payload = { foo: 'bar' };
let secret = 'xxx';
// HS256 secrets are typically 128-bit random strings, for example hex-encoded:
// let secret = Buffer.from('fe1a1915a379f3be5394b64d14794932', 'hex')
// encode
let token = jwt.encode(payload, secret);
// decode
let decoded = jwt.decode(token, secret);
console.log(decoded); //=> { foo: 'bar' }
/*
* jwt.decode(token, key, noVerify, algorithm)
*/
// decode, by default the signature of the token is verified
let decoded = jwt.decode(token, secret);
console.log(decoded); //=> { foo: 'bar' }
// decode without verify the signature of the token,
// be sure to KNOW WHAT ARE YOU DOING because not verify the signature
// means you can't be sure that someone hasn't modified the token payload
let decoded = jwt.decode(token, secret, true);
console.log(decoded); //=> { foo: 'bar' }
// decode with a specific algorithm (not using the algorithm described in the token payload)
let decoded = jwt.decode(token, secret, false, 'HS256');
console.log(decoded); //=> { foo: 'bar' }
By default the algorithm to encode is HS256
.
The supported algorithms for encoding and decoding are HS256
, HS384
, HS512
and RS256
.
// encode using HS512
jwt.encode(payload, secret, 'HS512')