passport-bamboohr

!-- [![Build](https://travis-ci.org/jaredhanson/passport-local.png)](https://travis-ci.org/jaredhanson/passport-local) [![Coverage](https://coveralls.io/repos/jaredhanson/passport-local/badge.png)](https://coveralls.io/r/jaredhanson/passport-local) [![Quality](https://codeclimate.com/github/jaredhanson/passport-local.png)](https://codeclimate.com/github/jaredhanson/passport-local) [![Dependencies](https://david-dm.org/jaredhanson/passport-local.png)](https://david-dm.org/jaredhanson/passport-local) [![Tips](http://img.shields.io/gittip/jaredhanson.png)](https://www.gittip.com/jaredhanson/) --

Passport strategy for authenticating with a username and password, on BambooHR.

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

Install

$ npm install passport-bamboohr

Usage

Configure Strategy

The Bamboohr authentication strategy authenticates users using a username and password. The strategy requires a verify callback, which accepts these credentials and calls done providing a user.

passport.use(new BamboohrStrategy({
    apiKey: "<applicationKey>"
  },
  function(username, done) {
    User.findOne({ username: username }, function (err, user) {
      if (err) { return done(err); }
      if (!user) { return done(null, false); }
      if (!user.verifyPassword(password)) { return done(null, false); }
      return done(null, user);
    });
  }
));

Authenticate Requests

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

For example, as route middleware in an Express application:

app.post('/login', 
  passport.authenticate('bamboohr', { failureRedirect: '/login' }),
  function(req, res) {
    res.redirect('/');
  });

License

The MIT License

Copyright (c) 2011-2014 Thinkerous Inc. [https://www.thinkero.us/](https://www.thinkero.us/)

Supported by

SEARCH FOR STRATEGIES

0STRATEGIES