JSPM

passport-salesforce

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 859
  • Score
    100M100P100Q99673F

Salesforce authentication strategy for Passport.

Package Exports

  • passport-salesforce

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (passport-salesforce) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

passport-oauth2

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

$ npm install
$ npm test

Credits

License

The MIT License

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