Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

heroku-bouncer

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heroku-bouncer

heroku bouncer middleware for express

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

node-heroku-bouncer

node-heroku-bouncer is an easy-to-use module for adding Heroku OAuth authentication to express apps.

Install

$ npm install heroku-bouncer --save

Use

node-heroku-bouncer assumes you've already added the express cookieParser and cookieSession middlewares to your app. To set it up, pass it your OAuth client ID and secret and another secret used to encrypt your user's OAuth session data.

Use the bouncer.middleware object to set up middleware that will ensure that your users are logged in (and redirect otherwise), and the bouncer.routes object to add the OAuth-specific routes to your app:

var express = require('express');
var app     = express();

app.use(express.cookieParser('your cookie secret'));
app.use(express.cookieSession({
  secret: 'your session secret',
  cookie: {
    path    : '/',
    signed  : true,
    httpOnly: true,
    maxAge  : null
  }
}));

var bouncer = require('heroku-bouncer')({
  herokuOAuthID      : 'client-id',
  herokuOAuthSecret  : 'client-secret',
  herokuBouncerSecret: 'bouncer-secret'
});

// Optional parameter:

// `herokaiOnly`: Default value: false. It accepts a request handler. Example:

```js
herokaiOnly : function(req, res, next) { res.end('ok'); }

app.use(bouncer.middleware); app.use(bouncer.router);

app.get('/', function(req, res) { res.end('you must be logged in!'); });


To log a user out, send them to `/auth/heroku/logout`.

## Test

```sh
$ npm test

FAQs

Package last updated on 11 Jun 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc