@cuties/jwt
Cutie extension for generating and validating JWT for authentication.
Last updated a year ago by guseyn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @cuties/jwt 
SYNC missed versions from official npm registry.

cutie-jwt

NPM Version Build Status codecov

Cutie extension for generating and validating JWT. It's based on the Async Tree Pattern.

Examples

You can find examples of using this library in the test directory.

Install

npm install @cuties/jwt

Run test

npm test

Run build

npm run build

Async objects

GeneratedHS256JWT(payload, secret[, minutesFromNow])

Generates JWT using HS256 algorithm. You can also use parameter minutesFromNow to set expiration time to payload(payload object will not be changed, it will be copied with set exp property).

IsHS256JWTValid(token, secret)

Validates token by secret. If it's valid this async object represents true, otherwise it represents false.

GeneratedRS256JWT(payload, privateKey[, minutesFromNow])

Generates JWT using RS256 algorithm. You can also use parameter minutesFromNow to set expiration time to payload(payload object will not be changed, it will be copied with set exp property).

IsRS256JWTValid(token, publicKey)

Validates token by publicKey. If it's valid this async object represents true, otherwise it represents false.

JWTOfRequest(request[, tokenName])

Retrieves JWT from Authorization header of incoming request parsing by tokenName(by default it's Bearer).

JWTPayload(token)

Retrieves payload from token.

JWTPayloadValue(token, key)

Retrieves payload value from token by key.

Current Tags

  • 1.0.4                                ...           latest (a year ago)

5 Versions

  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (8)
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |