Skip to content
Bullhorn (OAuth) authentication strategy for Passport
Branch: master
Clone or download
bvkimball Merge branch 'release/0.0.4'
* release/0.0.4:
  Update Version for prepublish
  Added npmignore file
Latest commit 01fc052 Sep 3, 2015
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
.npmignore
README.md
package.json Update Version for prepublish Sep 3, 2015

README.md

Passport-Bullhorn

Passport strategies for authenticating with Bullhorn using OAuth 2.0.

This module lets you authenticate using Bullhorn in your Node.js applications. By plugging into Passport, Bullhorn authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

The client id and client secret needed to authenticate with Bullhorn can be set up from the developer's console Bullhorn Developer's Console.

Install

$ npm install passport-bullhorn

Usage of OAuth 2.0

Configure Strategy

The Bullhorn OAuth 2.0 authentication strategy authenticates users using a Bullhorn account and OAuth 2.0 tokens. The strategy requires a verify callback, which accepts these credentials and calls done providing a user, as well as options specifying a client ID, client secret, and callback URL.

var BullhornStrategy = require('passport-bullhorn').BullhornOAuthStrategy;

passport.use(new BullhornStrategy({
    clientID: BULLHORN_CLIENT_ID,
    clientSecret: BULLHORN_CLIENT_SECRET,
    callbackURL: "http://127.0.0.1:3000/auth/bullhorn/callback"
  },
  function(accessToken, refreshToken, profile, done) {
    //profile.token == BhRestToken
    //profile.url == restUrl
  }
));

Authenticate Requests

Use passport.authenticate(), specifying the 'bullhorn' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth/bullhorn', 
  passport.authenticate('bullhorn'));

app.get('/auth/bullhorn/callback', 
  passport.authenticate('bullhorn', { failureRedirect: '/login' }),
  function(request, response) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

Examples

TBD

Tests

$ npm install
$ npm test

License

The MIT License

Copyright (c) 2015 <Bullhorn>

You can’t perform that action at this time.