# multi-passport

> Dynamic, multi-strategy authentication strategy for Passport.

Latest version **0.1.3** (published 2014-07-31) · 0 weekly downloads

## Install

```sh
npm install multi-passport
pnpm add multi-passport
yarn add multi-passport
bun add multi-passport
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2014-07-31 |
| First published | 2014-07-16 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | curtis.lacy |
| Keywords | passport, local, auth, authn, authentication, username, password |

## Links

- npm: https://www.npmjs.com/package/multi-passport
- Repository: git@github.com:curtislacy/multi-passport
- Homepage: https://github.com/curtislacy/multi-passport
- Issues: https://github.com/curtislacy/multi-passport/issues
- npm.io page: https://npm.io/package/multi-passport

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ~2.4.1
- [passport-strategy](https://npm.io/package/passport-strategy.md) 1.x.x

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@oxyhq/services](https://npm.io/package/@oxyhq/services.md) — 2.3K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2014-07-31
- 0.1.2 — 2014-07-30
- 0.1.1 — 2014-07-29
- 0.1.0 — 2014-07-16

## README

# multi-passport

[Passport](http://passportjs.org/) strategy which loads other strategies dynamically at runtime.

## Install

    $ npm install multi-passport

## Usage

#### Configure Strategy

The local authentication strategy authenticates users using a username and
password.  The strategy requires a `verify` callback, which accepts these
credentials and calls `done` providing a user.

    passport.use(new LocalStrategy(
      function(username, password, done) {
        User.findOne({ username: username }, function (err, user) {
          if (err) { return done(err); }
          if (!user) { return done(null, false); }
          if (!user.verifyPassword(password)) { return done(null, false); }
          return done(null, user);
        });
      }
    ));

#### Authenticate Requests

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

For example, as route middleware in an [Express](http://expressjs.com/)
application:

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

## Examples

For complete, working examples, refer to the multiple [examples](https://github.com/jaredhanson/passport-local/tree/master/examples) included.

## Tests

    $ npm install
    $ npm test

## Credits

  - [Jared Hanson](http://github.com/jaredhanson)
  - [Curtis Lacy](https://github.com/curtislacy)

## License

[The MIT License](http://opensource.org/licenses/MIT)

Copyright (c) 2011-2014 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)>

---
_Source: https://npm.io/package/multi-passport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
