Skip to content

Commit

Permalink
add some docs on how to use it, node-oauth needs an installable versi…
Browse files Browse the repository at this point in the history
…on. must bug ciaranj.
  • Loading branch information
atmos committed Apr 27, 2010
1 parent bc9c208 commit 7327b62
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 12 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Original file line Diff line number Diff line change
@@ -1,12 +1,11 @@

NODE = node NODE = node


all: test all: test

test: test:
@$(NODE) spec/node.js all @$(NODE) spec/node.js all

app: app:
@$(NODE) examples/app.js @$(NODE) examples/app.js


.PHONY: test app .PHONY: test app
33 changes: 33 additions & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,33 @@
express-auth
============

Useful authentication strategies based on [warden]. Available as a [kiwi] package.

Testing
=======

% make

Running with kiwi
=================

% brew install kiwi
% kiwi install express-auth
% node examples/app.js

Edit /etc/hosts to include the following entry

% grep twit /etc/hosts
127.0.0.1 testtwitter.com

For basic auth

% open http://localhost:3000

For twitter auth

% open http://localhost:3000/twitter


[warden]: http://github.com/hassox/warden
[kiwi]: http://github.com/visionmedia/kiwi
15 changes: 7 additions & 8 deletions examples/app.js
Original file line number Original file line Diff line number Diff line change
@@ -1,14 +1,12 @@
var kiwi= require('kiwi'); var kiwi= require('kiwi'),
var sys= require('sys'); sys= require('sys')


kiwi.require('express') kiwi.require('express')
require('express/plugins') require('express/plugins')
kiwi.seed('oauth')
var OAuth= require('oauth').OAuth;


//require.paths.unshift(__dirname+ "/../lib/node-oauth/lib/") var OAuth= kiwi.require('oauth').OAuth;


global.merge(require('../lib/express/plugins/auth')); global.merge(require('../lib/express/plugins/auth'));


var getPasswordForUserFunction= function(user, callback) { var getPasswordForUserFunction= function(user, callback) {
var result; var result;
Expand Down Expand Up @@ -73,4 +71,5 @@ get('/', function() {
} }
}); });
}) })
run();
run();
6 changes: 6 additions & 0 deletions seed.yml
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,6 @@
---
name: express-auth
description: Authenticate your node apps to twitter easily
version: 0.1.0
dependencies:
- node-outh >= 0.0.4

0 comments on commit 7327b62

Please sign in to comment.