npm.io
0.2.4 • Published 10 years ago

mserv-auth-jwt

Licence
MIT
Version
0.2.4
Deps
1
Vulns
0
Weekly
0

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))

Keywords