🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

passport-makerlog-oauth2

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-makerlog-oauth2

An OAuth2 passport strategy for MakerLog

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

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'
}));

Keywords

passport

FAQs

Package last updated on 25 Dec 2018

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