@voxpelli/passport-dummy

1.0.0 • Public • Published

@voxpelli/passport-dummy

Passport strategy for dummy authentication. Fork of developmentseed/passport-dummy (due to critical PR:s not being merged).

Installation

$ npm install @voxpelli/passport-dummy

Usage

Configure Strategy

The dummy authentication strategy authenticates or denies all requests based on the 'allow' option passed to it.

passport.use(new DummyStrategy(
  function(done) {
    return done(null, {username: 'dummy'});
  }
));

Authenticate Requests

Use passport.authenticate(), specifying the 'dummy' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.post('/login', 
  passport.authenticate('dummy', { failureRedirect: '/login' }),
  function(req, res) {
    res.redirect('/');
  });

Credits

License

(The MIT License)

Package Sidebar

Install

npm i @voxpelli/passport-dummy

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

4.54 kB

Total Files

5

Last publish

Collaborators

  • voxpelli