0.2.4 • Published 9 years ago

mserv-auth-jwt v0.2.4

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

Introduction

mserv-auth-jwt is a plugin for mserv-auth itself middleware for mserv. It adds JWT authentication to the middleware.

Installation

$ npm i --save mserv-auth-jwt

Usage

var mserv   = require('mserv'),
	auth    = require('mserv-auth'),
	helpers = require('mserv-auth/helpers'),
	jwtauth = require('mserv-auth-jwt'),

var service = mserv().use('auth', auth)
	
service.ext.auth('bearer', jwtauth, {
	keys: ['1234567890987654321', '1019181716151413120'],
	algorithm:'HS512'
})

service.invoke('some-action', args, helpers.authorization('Bearer', jwt))