JWT(JSON Web Token) encode and decode module for node.js
Installations
npm install jwt-simple
Developer Guide
Typescript
Yes
Module System
CommonJS
Min. Node Version
>= 0.4.0
Node Version
10.15.1
NPM Version
6.4.1
Score
99.9
Supply Chain
84
Quality
75.6
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
hokaccha
Download Statistics
Total Downloads
66,611,791
Last Day
9,607
Last Week
132,158
Last Month
794,183
Last Year
10,684,164
GitHub Statistics
1,364 Stars
82 Commits
135 Forks
31 Watching
1 Branches
20 Contributors
Package Meta Information
Latest Version
0.5.6
Package Id
jwt-simple@0.5.6
Size
3.63 kB
NPM Version
6.4.1
Node Version
10.15.1
Publised On
30 Mar 2019
Total Downloads
Cumulative downloads
Total Downloads
66,611,791
Last day
-75.6%
9,607
Compared to previous day
Last week
-35%
132,158
Compared to previous week
Last month
-9.6%
794,183
Compared to previous month
Last year
2.5%
10,684,164
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
jwt-simple
JWT(JSON Web Token) encode and decode module for node.js.
Install
$ npm install jwt-simple
Usage
1var jwt = require('jwt-simple'); 2var payload = { foo: 'bar' }; 3var secret = 'xxx'; 4 5// HS256 secrets are typically 128-bit random strings, for example hex-encoded: 6// var secret = Buffer.from('fe1a1915a379f3be5394b64d14794932', 'hex') 7 8// encode 9var token = jwt.encode(payload, secret); 10 11// decode 12var decoded = jwt.decode(token, secret); 13console.log(decoded); //=> { foo: 'bar' }
decode params
1/* 2 * jwt.decode(token, key, noVerify, algorithm) 3 */ 4 5// decode, by default the signature of the token is verified 6var decoded = jwt.decode(token, secret); 7console.log(decoded); //=> { foo: 'bar' } 8 9// decode without verify the signature of the token, 10// be sure to KNOW WHAT ARE YOU DOING because not verify the signature 11// means you can't be sure that someone hasn't modified the token payload 12var decoded = jwt.decode(token, secret, true); 13console.log(decoded); //=> { foo: 'bar' } 14 15// decode with a specific algorithm (not using the algorithm described in the token payload) 16var decoded = jwt.decode(token, secret, false, 'HS256'); 17console.log(decoded); //=> { foo: 'bar' }
Algorithms
By default the algorithm to encode is HS256
.
The supported algorithms for encoding and decoding are HS256
, HS384
, HS512
and RS256
.
1// encode using HS512 2jwt.encode(payload, secret, 'HS512')
Stable Version
Stable Version
0.5.6
CRITICAL
1
0/10
Summary
Forgeable Public/Private Tokens in jwt-simple
Affected Versions
< 0.3.1
Patched Versions
0.3.1
HIGH
1
0/10
Summary
Signature Verification Bypass in jwt-simple
Affected Versions
< 0.5.3
Patched Versions
0.5.3
MODERATE
1
0/10
Summary
Withdrawn
Affected Versions
< 0.3.1
Patched Versions
0.3.1
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 9/17 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 22 are checked with a SAST tool
Reason
33 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6
- Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9
- Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f
- Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p
- Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv
- Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8
- Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65
- Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh
- Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44
- Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp
- Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr
- Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh
- Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp
Score
2.4
/10
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More