grant

Authentication Middleware for Express

npm install grant
2 downloads in the last day
19 downloads in the last week
71 downloads in the last month

grant

grant is build on top of mashape / guardian

usage

var express = require('express');

var grant = new require('grant')(require('./config/app'));

var app = express();

app.configure(function () {
  // ...
  app.use(express.cookieParser('very secret - required'));
  app.use(express.session());
  // ...
  app.use(grant);
});

Reserved routes for grant

/connect/:provider
/step/:number
/(?:\/connect\/.*)?\/callback/

configuration

  • config/credentials.json - application credentials

    {
      "facebook": {
        "key": "...",
        "secret": "..."
      },
      "twitter": {
      ...
    }
    
  • config/server.js - application server configuration

  • config/oauth.js - provider oauth configuration

  • config/app.js - consumer application configuration

license

MIT

npm loves you