0.1.0 • Published 9 years ago
express-authentication-params v0.1.0
express-authentication-params
Authenticate against any express request properties, compatible with express-authentication.
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.');
});
0.1.0
9 years ago