2.0.0 • Published 6 years ago

hapi-jwt-auth v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

hapi-jwt-auth

Build Status

Installation

npm install hapi-jwt-auth --save

About plugin

JSON Web Token (JWT) authentication plugin for HapiJS

Inspired by hapi-auth-jsonwebtoken by boketto, modified to to expose additional node-jsonwebtoken methods for convienience.

Usage

This plugin will validate a signed token in the bearer header.

Setup

You will have to register the plugin with your server object, then create a new server auth strategy. Validation will occur only on routes that require authorization.

Options

The jwt scheme takes the following options:

  • key(required) - The private key the token was signed.
  • validate(optional) - Addiotional validation/user lookup, signature function(token, decoded, callback)
    • token - the verified signed token.
    • decoded - the decoded signed token.
    • callback - a callback function with signature function(err, isValid, credentials)
      • err - an internal error.
      • isValid(boolean) - whether the token was valid or not.
      • credentials - a credentials object passed back to the application in request.auth.credentials
2.0.0

6 years ago

1.1.0

6 years ago

1.0.0

7 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago