0.2.0 • Published 9 years ago

express-authentication-header v0.2.0

Weekly downloads
15
License
CC0-1.0
Repository
github
Last release
9 years ago

express-authentication-header

Authenticate against any RFC7235 HTTP Authorization header, compatible with express-authentication.

build status coverage license version downloads

var header = require('express-authentication-header'),
	auth = require('express-authentication');

// Validate the challenge
app.use(header({
	scheme: 'API',
	verify: function(challenge, callback) {
		callback(null, challenge.token === 'secret');
	}
}));

app.get('/', auth.required(), function(req, res) {
	res.status(200).send('Hello world.');
});