Git Product home page Git Product logo

hapi-jwt-auth's Introduction

hapi-jwt-auth

[Build Status] (https://travis-ci.org/lvegerano/hapi-jwt-auth)

Coverage 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] (http://hapijs.com/api#serverauthstrategyname-scheme-mode-options). 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

hapi-jwt-auth's People

Contributors

lvegerano avatar silend avatar scotthardin avatar

Watchers

Scott Hardin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.