Socket
Book a DemoInstallSign in
Socket

passport-misfit

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-misfit

Misfit authentication strategy for Passport and Node.js.

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

passport-misfit

Passport strategy for authenticating with Misfit using the OAuth 2.0 API.

See https://build.misfit.com/ for developer portal. You must apply for API access.

Install

$ npm install passport-misfit

Usage

Configure Strategy

note: Misfit currently does not provide a refreshToken in its response. It will be undefined

passport.use(new MisfitStrategy({
    clientID: YOUR_MISFIT_APP_ID,
    clientSecret: YOUR_MISFIT_APP_SECRET,
    callbackURL: "http://localhost:3000/auth/misfit/callback"
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ misfitUserId: profile.userId }, function (err, user) {
      return done(err, user);
    });
  }
));

Authenticate Requests

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

For example, as route middleware in an Express application:

app.get('/auth/misfit',
  passport.authenticate('misfit'));

app.get('/auth/misfit/callback', 
  passport.authenticate('misfit', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

Tests

$ npm install
$ npm test

Credits

  • Chris Quartier
  • Jared Hanson for his work on other passport-* libraries, making this one easier to create

License

The MIT License

Copyright (c) 2014 Chris Quartier

Keywords

passport

FAQs

Package last updated on 17 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.