0.0.1 • Published 10 years ago

passport-moves v0.0.1

Weekly downloads
1
License
-
Repository
github
Last release
10 years ago

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.