Installations
npm install @lindorm-io/koa-jwt
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
19.9.0
NPM Version
lerna/7.4.2/node@v19.9.0+arm64 (darwin)
Score
63.7
Supply Chain
51.7
Quality
71.7
Maintenance
25
Vulnerability
72.7
License
Releases
Unable to fetch releases
Love this project? Help keep it running — sponsor us today! 🚀
Download Statistics
Total Downloads
27,509
Last Day
2
Last Week
3
Last Month
376
Last Year
9,932
Package Meta Information
Latest Version
0.6.17
Package Id
@lindorm-io/koa-jwt@0.6.17
Unpacked Size
36.43 kB
Size
8.66 kB
File Count
48
NPM Version
lerna/7.4.2/node@v19.9.0+arm64 (darwin)
Node Version
19.9.0
Published on
Jan 12, 2024
Total Downloads
Cumulative downloads
Total Downloads
27,509
Last Day
-75%
2
Compared to previous day
Last Week
-91.2%
3
Compared to previous week
Last Month
735.6%
376
Compared to previous month
Last Year
39.1%
9,932
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@lindorm-io/koa-jwt
Token issuer middleware for @lindorm-io/koa applications.
Installation
1npm install --save @lindorm-io/koa-jwt
Peer Dependencies
This package has the following peer dependencies:
Usage
Token Issuer Middleware
1koaApp.addMiddleware( 2 tokenIssuerMiddleware({ 3 issuer: "https://authentication.service", // used for token validation 4 }), 5);
Token Validation Middleware
1const middleware = tokenValidationMiddleware({ 2 audiences: [configuration.server_oauth_client_id], // OPTIONAL | array | used when all tokens of this type require specific audience 3 clockTolerance: 300, // OPTIONAL | number | giving some tolerance for time validation 4 contextKey: "tokenKey", // REQUIRED | string | used to set validated token on context (ctx.token.tokenKey) 5 issuer: "https://authorization.service", // REQURIED | uri | used for token validation 6 subjectHint: "identity", // OPTIONAL [ string ] 7 types: ["refresh_token"], // REQUIRED | string | token type 8}); 9 10router.use( 11 middleware( 12 "request.body.tokenName", // REQUIRED | string | path used to find token 13 { 14 adjustedAccessLevel: 2, // OPTIONAL | number 15 audiences: [configuration.server_oauth_client_id], // OPTIONAL | array | used when token on specific route requires specific audiences 16 levelOfAssurance: 3, // OPTIONAL | number 17 maxAge: 400, // OPTIONAL | number 18 permissions: ["admin"], // OPTIONAL | array 19 scopes: ["openid"], // OPTIONAL | array 20 21 fromPath: { 22 audience: "query.clientId", // OPTIONAL | string | path to string 23 nonce: "entity.entityName.nonce", // OPTIONAL | string | path to string 24 subject: "token.bearerToken.subject", // OPTIONAL | string | path to string 25 }, // OPTIONAL | object 26 27 optional: false, // OPTIONAL [ boolean ] - determines if middleware should throw when token is missing 28 }, 29 ), 30);

No vulnerabilities found.

No security vulnerabilities found.