Comparing version 0.2.26 to 0.2.27
@@ -34,3 +34,3 @@ module.exports = { | ||
} | ||
, '37signals': { | ||
, _37signals: { | ||
clientId: 'cd4bf9cd9ed828b6bed8b67e6b314cf8b90c8de5' | ||
@@ -70,2 +70,6 @@ , clientSecret: '07883c36b4f4493b70f31872ed8fbdb099ff1cef' | ||
} | ||
, dwolla: { | ||
clientId: 'Enter your consumer key here' | ||
, clientSecret: 'Enter your consumer secret here' | ||
} | ||
}; |
@@ -42,2 +42,3 @@ var express = require('express') | ||
var usersByOpenId = {}; | ||
var usersByDwollaId = {}; | ||
var usersByLogin = { | ||
@@ -263,4 +264,4 @@ 'brian@example.com': addUser({ login: 'brian@example.com', password: 'password'}) | ||
everyauth['37signals'] | ||
.appId(conf['37signals'].clientId) | ||
.appSecret(conf['37signals'].clientSecret) | ||
.appId(conf['_37signals'].clientId) | ||
.appSecret(conf['_37signals'].clientSecret) | ||
.findOrCreateUser( function (sess, accessToken, accessSecret, _37signalsUser) { | ||
@@ -289,2 +290,11 @@ return usersBy37signalsId[_37signalsUser.id] || | ||
everyauth.dwolla | ||
.appId(conf.dwolla.clientId) | ||
.appSecret(conf.dwolla.clientSecret) | ||
.scope('accountinfofull') | ||
.findOrCreateUser( function (sess, accessToken, accessTokenExtra, dwollaUser) { | ||
return usersByDwollaId[dwollaUser.id] || (usersByDwollaId[dwollaUser.id] = addUser('dwolla', dwollaUser)); | ||
}) | ||
.redirectPath('/'); | ||
var app = express.createServer( | ||
@@ -291,0 +301,0 @@ express.bodyParser() |
@@ -146,3 +146,4 @@ var everyModule = require('./everymodule') | ||
, url = this.oauthHost() + this.accessTokenPath() | ||
, additionalParams = this.moreAccessTokenParams; | ||
, additionalParams = this.moreAccessTokenParams | ||
, param; | ||
@@ -157,3 +158,11 @@ if (this.accessTokenPath().indexOf("://") != -1) { | ||
if (additionalParams) for (var k in additionalParams) { | ||
params[k] = additionalParams[k]; | ||
param = additionalParams[k]; | ||
if ('function' === typeof param) { | ||
additionalParams[k] = // cache the fn call | ||
param = param.call(this); | ||
} | ||
if ('function' === typeof param) { | ||
param = param.call(this, req, res); | ||
} | ||
params[k] = param; | ||
} | ||
@@ -168,3 +177,2 @@ | ||
} | ||
delete opts.query.redirect_uri | ||
rest[this.accessTokenHttpMethod()](url, opts) | ||
@@ -265,4 +273,2 @@ .on('success', function (data, res) { | ||
} | ||
if ('function' === typeof val) | ||
val = val(); | ||
if (val) | ||
@@ -269,0 +275,0 @@ this.moreAccessTokenParams[key] = val; |
{ | ||
"name": "everyauth", | ||
"description": "Auth solution (password, facebook, & more) for your node.js Connect & Express apps", | ||
"version": "0.2.26", | ||
"version": "0.2.27", | ||
"homepage": "https://github.com/bnoguchi/everyauth/", | ||
@@ -30,2 +30,3 @@ "repository": { | ||
"restler": ">=0.2.1", | ||
"request": ">=2.2.0", | ||
"connect": ">=1 <2", | ||
@@ -32,0 +33,0 @@ "openid": ">=0.2.0", |
@@ -10,25 +10,40 @@ everyauth | ||
- `password` | ||
- `OpenId` (Credits [RocketLabs Development](https://github.com/rocketlabsdev), [Andrew Mee](https://github.com/starfishmod), [Brian Noguchi](https://github.com/bnoguchi)) | ||
- `Google Hybrid` (Credits [RocketLabs Development](https://github.com/rocketlabsdev)) | ||
- OAuth | ||
- `twitter` | ||
- `linkedin` | ||
- `yahoo` | ||
- `readability` (Credits [Alfred Nerstu](https://github.com/alfrednerstu)) | ||
- `dropbox` (Credits [Torgeir](https://github.com/torgeir)) | ||
- `justin.tv` (Credits [slickplaid](https://github.com/slickplaid)) | ||
- `vimeo` (Credits [slickplaid](https://github.com/slickplaid)) | ||
- `tumblr` | ||
- OAuth2 | ||
- `facebook` | ||
- `github` | ||
- `instagram` | ||
- `foursquare` | ||
- `google` | ||
- `gowalla` (Credits [Andrew Kramolisch](https://github.com/andykram)) | ||
- `37signals` (Basecamp, Highrise, Backpack, Campfire) | ||
- `angellist` | ||
- `box` (Box.net) | ||
- `LDAP` (experimental; not production-tested) | ||
<table style="text-align:left"> | ||
<thead> | ||
<tr> | ||
<th> Authenticate Via <th> Credits | ||
</tr> | ||
</thead> | ||
<tbody id=openid> | ||
<tr> <td> Password <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/openid.ico" style="vertical-align:middle"> OpenId <td> <a href="https://github.com/rocketlabsdev">RocketLabs Development</a>, <a href="https://github.com/starfishmod">Andrew Mee, <a href="https://github.com/bnoguchi">Brian Noguchi</a> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/google.ico" style="vertical-align:middle"> Google Hybrid <td> <a href="https://github.com/rocketlabsdev">RocketLabs Development</a> | ||
</tbody> | ||
<tbody id=oauth> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/twitter.ico" style="vertical-align:middle"> Twitter <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/linkedin.ico" style="vertical-align:middle"> LinkedIn <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/yahoo.ico" style="vertical-align:middle"> Yahoo! <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/readability.ico" style="vertical-align:middle"> Readability <td> <a href="https://github.com/alfrednerstu">Alfred Nerstu</a> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/dropbox.ico" style="vertical-align:middle"> Dropbox <td> <a href="https://github.com/torgeir">Torgeir</a> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/justintv.ico" style="vertical-align:middle"> Justin.tv <td> <a href="https://github.com/slickplaid">slickplaid</a> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/vimeo.gif" style="vertical-align:middle"> Vimeo <td> <a href="https://github.com/slickplaid">slickplaid</a> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/tumblr.jpg" style="vertical-align:middle"> Tumblr <td> | ||
</tbody> | ||
<tbody id=oauth2> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/facebook.ico" style="vertical-align:middle"> Facebook <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/github.ico" style="vertical-align:middle"> Github <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/instagram.ico" style="vertical-align:middle"> Instagram <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/foursquare.ico" style="vertical-align:middle"> Foursquare <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/google.ico" style="vertical-align:middle"> Google <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/gowalla.ico" style="vertical-align:middle"> Gowalla <td> <a href="https://github.com/andykram">Andrew Kramolisch</a> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/37signals.ico" style="vertical-align:middle"> 37signals | ||
(Basecamp, Highrise, Backpack, Campfire) <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/angellist.ico" style="vertical-align:middle"> AngelList <td> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/dwolla.ico" style="vertical-align:middle"> Dwolla <td> <a href="https://github.com/nanek">Kenan Shifflett</a> | ||
</tbody> | ||
<tbody id=misc> | ||
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/box.ico" style="vertical-align:middle"> Box.net <td> | ||
<tr> <td> LDAP (experimental; not production-tested) <td> | ||
</tbody> | ||
</table> | ||
@@ -1031,2 +1046,34 @@ `everyauth` is: | ||
## Setting up Dwolla OAuth2 | ||
First, register an app [on Dwolla](http://www.dwolla.com/developers). | ||
```javascript | ||
var everyauth = require('everyauth') | ||
, connect = require('connect'); | ||
everyauth.dwolla | ||
.appId('YOUR CLIENT ID HERE') | ||
.appSecret('YOUR TOKEN HERE') | ||
.scope('accountinfofull') | ||
.findOrCreateUser( function (session, accessToken, accessTokenExtra, dwollaUserMetadata) { | ||
// find or create user logic goes here | ||
// Return a user or Promise that promises a user | ||
// Promises are created via | ||
// var promise = this.Promise(); | ||
}) | ||
.redirectPath('/'); | ||
var routes = function (app) { | ||
// Define your routes here | ||
}; | ||
connect( | ||
connect.bodyParser() | ||
, connect.cookieParser() | ||
, connect.session({secret: 'whodunnit'}) | ||
, everyauth.middleware() | ||
, connect.router(routes); | ||
).listen(3000); | ||
## Setting up Yahoo OAuth | ||
@@ -1895,2 +1942,4 @@ | ||
- Gowalla | ||
- [Kenan Shifflett](https://github.com/nanek) | ||
- Dwolla | ||
@@ -1897,0 +1946,0 @@ ### MIT License |
Sorry, the diff of this file is not supported yet
217925
72
3145
1963
6
+ Addedrequest@>=2.2.0
+ Addedajv@6.12.6(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.15.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)