0.5.0 • Published 7 years ago

justows.plugin.http.jwt v0.5.0

Weekly downloads
18
License
-
Repository
bitbucket
Last release
7 years ago

justows.plugin.http.jwt

NPM version Total downloads

Plugin for JSON Web Token support.

Developed in Dogma, compiled to JavaScript.

Engineered in Valencia, Spain, EU by Justo WebServices.

Description

This plugin provides a pre action for processing a JSON Web Token stored in a cookie or in the Authorization header.

Use

The plugin returns a function which returns the plugin metadata:

function plugin(opts:object) : object
  • opts:
    • alg (string, required). Algorithm to use: HS256, HS384, HS512, RS256, RS384, RS512.
    • secret (string, required when using HS*). Secret to use with HS*.
    • key (string, required when using RS*). Public key to use.
    • cookie (string). Cookie name where the JWT is stored.
    • authorization (bool). Is the token stored in the Authorization header? Default: false.
    • field (string). Field name where to save the decoded token in the req object. Default: token.
    • iss (string). iss claim to check.
    • aud (string). aud claim to check.
    • exp (bool). To check exp claim.

Example:

http: {
  plugins: [
    require("justows.plugin.http.jwt")({alg: "HS259", secret: "1234567890", cookie: "Token"})
  ]

  ...
}
0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago