express-authentication-params

0.1.0 • Public • Published

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.');
});
 

Package Sidebar

Install

npm i express-authentication-params

Weekly Downloads

2

Version

0.1.0

License

CC0-1.0

Last publish

Collaborators

  • izaakschroeder