passport-loopback
v0.0.4
Published
Authentication loopback.io token for passport
Downloads
3
Readme
Passport Loopback
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)
}
));