0.0.4 • Published 6 years ago

passport-loopback v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Passport Loopback

Build Status Coverage Status Maintainability

Passport for Loopback.io base on its token

Passport strategy for authenticating with an authentication token.

This module lets you authenticate using a token in your Node.js applications. It is based on passport-local module by Jared Hanson. By plugging into Passport, token authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Loopback.io is a highly-extensible, open-source Node.js framework

Install

$ npm install passport-loopback

Usage

Configure Strategy

const LoopbackStrategy = require('passport-loopback').Strategy;

passport.use('loopback', new LoopbackStrategy({
    	authorizationURL: 'http://localhost:3000/me',
			passReqToCallback: true
  },
  function(req, accessToken, refreshToken, profile, done) {
    User.findOrCreate({loopbackId: profile.id}, done)
  }
));