0.1.0 • Published 9 years ago

express-authentication-params v0.1.0

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

express-authentication-params

Authenticate against any express request properties, compatible with express-authentication.

build status coverage license version downloads

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

// Validate the challenge
app.use(params({
	properties: [ 'access_key' ],
	verify: function(challenge, callback) {
		callback(null, challenge.access_key === 'secret');
	}
}));

// Try ?access_key=secret!
app.get('/', auth.required(), function(req, res) {
	res.status(200).send('Hello world.');
});