passport-moves

0.0.1 • Public • Published

passport-moves

Build Status

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

This module lets you authenticate using Facebook in your Node.js applications. By plugging into Passport, Facebook authentication can be easily and unobtrusively integrated into Express.

Install

$ npm install passport-moves

Usage

Configure Strategy

The Moves authentication strategy authenticates users using the Moves mobile app and OAuth 2.0 tokens. The strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a clientID, a clientSecret, and a callback URL.

passport.use(new MovesStrategy({
    clientID: 'YOUR_CLIENT_ID',
    clientSecret: 'YOUR_CLIENT_SECRET',
    callbackURL: 'http://your.site/auth/callback'
  },
  function(accessToken, refreshToken, profile, done) {
    process.nextTick(function() {
      return done(null, profile);
    });
  }
));

Authenticate Requests

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

For example, as route middleware in an Express application:

app.get('/moves/auth', 
  passport.authenticate('moves', {scope: ['default', 'activity', 'location']}));

app.get('/moves/auth/callback', 
  passport.authenticate('moves', { successRedirect: '/success', failureRedirect: '/failure' }));

Profile Fields

The Moves profile is very sparse and only the profile.id field is populated.

Tests

$ npm install
$ npm test

License

The MIT License

Acknowledgements

I'd like to thank Jared Hanson for his work on the passport-facebook and passport-instagram strategies. In many places, this module re-uses his work.

Package Sidebar

Install

npm i passport-moves

Weekly Downloads

1

Version

0.0.1

License

none

Last publish

Collaborators

  • billglover