passport-salesforce
Salesforce authentication strategy for Passport.
Install
$ npm install passport-salesforce
Usage
Configure Strategy
passport.use(new SalesforceStrategy({
clientID: CLIENT_ID,
clientSecret: CLIENT_SECRET,
callbackURL: "http://localhost:1234/salesforce/callback"
},
function(accessToken, refreshToken, profile, done) {
done(null, {});
}
));
Authenticate Requests
Use passport.authenticate()
, specifying the 'salesforce'
strategy, to
authenticate requests.
For example, as route middleware in an Express application:
app.get('/force/authorize',
passport.authenticate('salesforce', {session: false}));
app.get('/force/callback',
passport.authenticate('salesforce', {session: false}),
function(req, res) {
res.redirect('/');
});
Tests
Credits
License
Copyright (c) 2011-2015 Jared Hanson <http://jaredhanson.net/>