0.1.5 • Published 10 years ago

wgu-jwt v0.1.5

Weekly downloads
17
License
WGU
Repository
bitbucket
Last release
10 years ago

wgu-jwt

JWT extraction and verification module for the WGU Service layer

Install

npm install wgu-jwt

Usage

var restify = require('restify');
var wguJwt = require('wgu-jwt');

module.exports = function( server )
{
	server.use(function(req, res, next)
	{
		var jwt = req.header('X-Jwt-Assertion', '');
		
		if( ! wguJwt.verify(jwt))
		{
			return next(new restify.InvalidCredentialsError('JWT Not Verified'));
		}
		
		return next();
	});
}

Exports

verify( jwt, logger )

Attempts to verify jwt passed in with optional logger

extractHeader( jwt )

Extracts and returns the header

extractPayload( jwt )

Extracts and returns the payload

extractSignature( jwt )

Extracts and returns the signature

extractSignedData( jwt )

Extracts and returns the signed data

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago