@abskmj/jwt-utility
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "@abskmj/jwt-utility", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "JWT Utility for Node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -10,3 +10,3 @@ # JWT Utility for Node.js | ||
# Utlity Methods | ||
# Utility Methods | ||
| Method | Arguments | Description | | ||
@@ -50,5 +50,24 @@ | :--- | :--- | :--- | | ||
.parse(jwt, 'secret key'); | ||
/* | ||
data: | ||
{ | ||
headers: { | ||
alg: 'HS256', | ||
typ: 'JWT' | ||
}, | ||
claims: { | ||
user: 'testUser', | ||
name: 'Test User', | ||
iat: 1512555172, | ||
iss: 'AuthServer', | ||
sub: 'Login', | ||
exp: 1512555182 | ||
} | ||
} | ||
*/ | ||
``` | ||
## Factory Instance Methods | ||
## Parser Instance Methods | ||
| Method | Arguments | Description | | ||
@@ -61,1 +80,4 @@ | :--- | :--- | :--- | | ||
| `parse` | String, String | Set JWT token and key used to verify the token | | ||
# Further Development | ||
Support for RS256, RS384, RS512 is not planned yet. Please get in touch with the [developer](mailto:abskmj@gmail.com), if you wish to request any new functionality or bug fix. |
const JWTUtility = require('./index'); | ||
let jwt = JWTUtility.getFactory('HS256') | ||
.setIssuer('majhi') | ||
.setIssuer('AuthServer') | ||
.setSubject('Login') | ||
@@ -11,3 +11,3 @@ .setExpiry(10) | ||
}) | ||
.sign('testKy'); | ||
.sign('secret key'); | ||
@@ -17,7 +17,6 @@ console.log(jwt); | ||
let data = JWTUtility.getParser() | ||
.validateIssuer('majhi') | ||
.validateExpiry(10) | ||
.validateIssuer('AuthServer') | ||
.validateSubject('Login') | ||
.parse(jwt, 'testKy'); | ||
.parse(jwt, 'secret key'); | ||
console.log(data); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10377
81
207