connect_auth_github

Simple connect middleware to authenticate users against github oauth

npm install connect_auth_github
8 downloads in the last week
17 downloads in the last month

connect_auth_github

Like https://github.com/atmos/sinatra_auth_github but for connect.

Warning: The API is not yet complete

Install

npm install connect_auth_github

Usage

var connect = require('connect');

var server = connect.createServer(
    connect.cookieParser(),
    connect.session({ secret: 'keyboard cat' }),
    github({
        appId: "app-id",
        appSecret: "app-secret",
        callback: "http://localhost/auth/github_callback"
      })
);

Authenticate and ensure the user have access to the org 'foo'

var connect = require('connect');

var server = connect.createServer(
    connect.cookieParser(),
    connect.session({ secret: 'keyboard cat' }),
    github.orgAccess({
        appId: "app-id",
        appSecret: "app-secret",
        callback: "http://localhost/auth/github_callback"
      }, 'foo')
);

Example

See test/app.js.

License

(c) 2012 Fran├žois de Metz

Mainly inspired by atmos's sinatra_auth_github.

BSD

npm loves you