Skip to content

bullhorn/passport-bullhorn

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

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>

About

Bullhorn (OAuth) authentication strategy for Passport

Resources

Stars

Watchers

Forks

Packages

No packages published