passportjs-header
Passport strategy for authenticating within a header.
This is effectively a stripped down version of passport-local.
This module lets you authenticate using a header username in your Node.js applications. By plugging into Passport, authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.
Install
$ npm install passportjs-header
Usage
Configure Strategy
The header authentication strategy authenticates users based on the user id
sent in the HTTP headers by header worstations. The strategy requires a verify
callback, which accepts these credentials and calls done
providing a user.
passport;
Authenticate Requests
Use passport.authenticate()
, specifying the 'header'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app;
Tests
$ npm install$ npm test