passport-salesforce

Salesforce authentication strategy for Passport.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
passport-salesforce
210.0.29 years ago9 years agoMinified + gzip package size for passport-salesforce in KB

Readme

passport-salesforce
Quality Dependencies
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

- Ben Shank - Jared Hanson

License

The MIT License
Copyright (c) 2011-2015 Jared Hanson <http://jaredhanson.net/>