express-authentication-header

0.2.0 • Public • Published

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

Package Sidebar

Install

npm i express-authentication-header

Weekly Downloads

36

Version

0.2.0

License

CC0-1.0

Last publish

Collaborators

  • izaakschroeder