Forcing of approval prompt, not user friendly. #324

Open
wants to merge 60 commits into
from
Commits
+3,690 −19
Split
View
@@ -5,3 +5,5 @@ issues
IRC.md
playground.js
CHANGES
+npm-debug.log
+.idea
View
118 README.md
@@ -50,14 +50,22 @@ So far, `everyauth` enables you to login via:
<td> <a href="https://github.com/ufssf">ufssf</a>
<tr> <td> <img src="http://static.mailchimp.com/www/downloads/brand-assets/Freddie_Light_Background.png" style="vertical-align:middle" width="16px"> Mailchimp
<td> <a href="http://github.com/wnadeau">Winfred Nadeau</a>
+ <tr> <td> <img src="http://github.com/bnoguchi/everyauth/raw/master/media/meetup.ico" style="vertical-align:middle"> Meetup
+ <td> <a href="http://github.com/jonathana">Jonathan Altman</a>
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/mendeley.ico" style="vertical-align:middle"> Mendeley
<td> <a href="https://github.com/edy-b">Eduard Baun</a>
+ <tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/smarterer.ico" style="vertical-align:middle"> Smarterer
+ <td> <a href="https://github.com/kaizenpack">kaizenpack</a>
+ <tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/runkeeper.ico" style="vertical-align:middle"> RunKeeper
+ <td> <a href="https://github.com/akinsella">Alexis Kinsella</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> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/openid.ico" style="vertical-align:middle" width="16px" height="16px"> 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> LDAP (experimental; not production-tested) <td>
<tr> <td> Windows Azure Access Control Service (ACS)<td> <a href="https://github.com/darrenzully">Dario Renzulli</a>, <a href="https://github.com/jpgarcia">Juan Pablo Garcia</a>, <a href="https://github.com/woloski">Matias Woloski</a> from <a href="http://blogs.southworks.net/">Southworks</a>
+ <tr><td><img src='https://www.dailycred.com/public/img/favicon.ico' style="vertical-align:middle">Dailycred <td> <a href='https://github.com/hstove'>Hank Stoever</a> at <a href='https://dailycred.com'>Dailycred.com</a>
+ <tr><td><img src='http://www.sinaimg.cn/blog/developer/wiki/LOGO_16x16.png' style="vertical-align:middle">Sina Weibo<td> <a href='https://github.com/justan'>justan</a>
</tbody>
</table>
@@ -76,8 +84,15 @@ So far, `everyauth` enables you to login via:
## Installation
+
+If you are using Connect 1.x or Express 2.x, install via:
+
$ npm install everyauth
+If you are using Express 3.x, install via:
+
+ $ npm install git://github.com/bnoguchi/everyauth.git#express3
+
## Quick Start
Using everyauth comes down to just 2 simple steps if using Connect
or 3 simple steps if using Express:
@@ -445,6 +460,28 @@ everyauth.facebook
// rest of configuration
```
+### Facebook Canvas Pages
+For apps that can be embedded in Facebook via the canvas page, you can use the
+facebookCanvas submodule:
+
+```javascript
+everyauth.facebookCanvas
+ .canvasPath('CANVAS URL MINUS HOSTNAME') // Default is '/auth/facebook/canvas'
+ .canvasPage('CANVAS PAGE'); // Generally http://apps.facebook.com/APP-NAME
+```
+
+Note that you must also configure the usual Facebook configurations described
+above in order for this to work.
+
+You can tell if the user logged in via the canvas interface using the following test:
+
+```javascript
+if (everyauth.facebookCanvas) {
+ // Do something different
+}
+```
+
+
## Twitter OAuth
```javascript
@@ -794,7 +831,7 @@ everyauth.password
var promise = this.Promise()
, password = newUserAttrs.password;
- delete newUserAttrs[password]; // Don't store password
+ delete newUserAttrs.password; // Don't store password
newUserAttrs.salt = bcrypt.genSaltSync(10);
newUserAttrs.hash = bcrypt.hashSync(password, salt);
@@ -1065,10 +1102,10 @@ var everyauth = require('everyauth')
everyauth.google
.appId('YOUR CLIENT ID HERE')
.appSecret('YOUR CLIENT SECRET HERE')
- .scope('https://www.google.com/m8/feeds') // What you want access to
+ .scope('https://www.googleapis.com/auth/userinfo.profile') // What you want access to
.handleAuthCallbackError( function (req, res) {
// If a user denies your app, Google will redirect the user to
- // /auth/facebook/callback?error=access_denied
+ // /auth/google/callback?error=access_denied
// This configurable route handler defines how you want to respond to
// that.
// If you do not configure this, everyauth renders a default fallback
@@ -2112,6 +2149,35 @@ connect(
).listen(3000);
```
+### RunKeeper OAuth (2.0)
+
+You will first need to [register your application](http://runkeeper.com/partner/applications) to get the appId and appSecret.
+
+```javascript
+everyauth.runkeeper
+ .appId('YOUR CONSUMER KEY HERE')
+ .consumerSecret('YOUR CONSUMER SECRET HERE')
+ .findOrCreateUser( function (sess, accessToken, accessSecret, user) {
+ // find or create user logic goes here
+ //
+ // e.g.,
+ // return usersByRunKeeperId[user.userID] || (usersByRunKeeperId[user.userID] = user);
+ })
+ .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);
+```
+
### OpenID protocol
OpenID protocol allows you to use an openid auth request. You can read more information about it here http://openid.net/
@@ -2195,6 +2261,40 @@ connect(
).listen(3000);
```
+### Smarterer
+
+You will need to register for an app id [here](http://www.smarterer.com/). Implementation details follow the same pattern as with other
+oauth2 implementations.
+
+```javascript
+
+var everyauth = require('everyauth')
+ , connect = require('connect');
+
+everyauth.smarterer
+ .appId('YOUR APP ID')
+ .appSecret('YOUR APP SECRET')
+ .findOrCreateUser(function(session, accessToken, accessTokenSecret, userData) {
+ // find or create user logic goes here
+ // userData.userName will contain the smarterer username for the authenticated user
+ // userData.badges will contain the scores on quizes
+ })
+ .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);
+```
+
+
### Box.net
```javascript
@@ -2341,6 +2441,18 @@ object whose parameter name keys map to description values:
everyauth.box.configurable();
```
+### Dailycred OAuth
+
+```javascript
+everyauth.dailycred
+ .appId(conf.dc.appId)
+ .findOrCreateUser( function (session, accessToken, accessTokenExtra, dcUserMetadata) {
+ return usersByDcId[dcUserMetadata.id] ||
+ (usersByDcId[dcUserMetadata.id] = addUser('dailycred', dcUserMetadata));
+ })
+ .redirectPath('/');
+```
+
## Configuring a Module
everyauth was built with powerful configuration needs in mind.
View
@@ -1,5 +1,9 @@
module.exports = {
- fb: {
+ dc: {
+ appId: '7ab1a53d-9d0e-4eeb-af62-76a5e1a83af9',
+ appSecret: '88bee747-c1ef-4851-be60-84d53dd474ad-88495db2-5db0-47c8-ad77-9e92db7e308c',
+ }
+ , fb: {
appId: '111565172259433'
, appSecret: '85f7e0a0cc804886180b887c1f04a3c1'
}
@@ -116,4 +120,15 @@ module.exports = {
consumerKey: 'Enter your consumer key here'
, consumerSecret: 'Enter your consumer secret here'
}
+ , weibo: {
+ appId: '3350967939'
+ , appSecret: 'ef7f0a836d0ef315dca53e8d73816cc0'
+ }
+ , runkeeper: {
+ appId: 'Enter your client/app id here'
+ , appSecret: 'Enter your client/app secret here'
+ , meetup: {
+ appId: 'nurgg46uqquq3eqa957ivnddv9'
+ , appSecret: '6spfeab72gc8f89l735i391rr3'
+ }
};
Oops, something went wrong.