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.
$ npm install passport-moves
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);
});
}
));
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' }));
The Moves profile is very sparse and only the profile.id
field is populated.
$ npm install
$ npm test
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.