Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples/login
lib
test
.gitignore
README.md
package.json

README.md

Passport strategy for MakerLog OAuth2

Passport strategies for authenticating with MakerLog.

This module lets you authenticate using MakerLog in your Node.js Express (or Connect) server applications.

Install

$ npm install passport-makerlog-oauth2

Usage of OAuth 2.0

Configure Strategy

The MakerLog OAuth 2.0 authentication strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a client ID, client secret, and callback URL.

var MakerLogStrategy = require('passport-makerlog-oauth2').MakerLogOAuth2Strategy;

passport.use(new MakerLogStrategy({
    clientID:     MAKERLOG_CLIENT_ID,
    clientSecret: MAKERLOG_CLIENT_SECRET,
    callbackURL: "http://yourdormain:3000/auth/makerlog/callback"
  },
  function(accessToken, refreshToken, profile, done) {
    User.findOrCreate({ makerlogId: profile.id }, function (err, user) {
      return done(err, user);
    });
  }
));

Authenticate Requests

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

For example, as route middleware in an Express application:

app.get('/auth/makerlog',
  passport.authenticate('makerlog', { scope: ['tasks'] }
));

app.get( '/auth/makerlog/callback', passport.authenticate( 'makerlog', { 
        successRedirect: '/auth/makerlog/success',
        failureRedirect: '/auth/makerlog/failure'
}));
You can’t perform that action at this time.