Permalink
Browse files

added dailycred to providers, finished touches

  • Loading branch information...
1 parent 66fc876 commit 7ce6393198851589bb00c9ab40f1483051a73beb @hstove hstove committed Jul 14, 2012
Showing with 18 additions and 5 deletions.
  1. +13 −0 README.md
  2. +5 −5 lib/modules/dailycred.js
View
@@ -60,6 +60,7 @@ So far, `everyauth` enables you to login via:
<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>
</tbody>
</table>
@@ -2377,6 +2378,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
@@ -4,11 +4,11 @@ var oauthModule = require('./oauth2')
var dc = module.exports =
oauthModule.submodule('dailycred')
- .apiHost('https://auth.dailycred.com')
- .oauthHost('https://auth.dailycred.com')
+ .apiHost('https://www.dailycred.com')
+ .oauthHost('https://www.dailycred.com')
- .authPath('https://auth.dailycred.com/oauth/authorize')
- .accessTokenPath('/oauth/tokeninfo')
+ .authPath('https://www.dailycred.com/oauth/authorize')
+ .accessTokenPath('/oauth/api/token.json')
.entryPath('/auth/dailycred')
.callbackPath('/auth/dailycred/callback')
@@ -31,7 +31,7 @@ oauthModule.submodule('dailycred')
.fetchOAuthUser( function (accessToken) {
var p = this.Promise();
- this.oauth.get(this.apiHost() + '/oauth/me', accessToken, function (err, data) {
+ this.oauth.get(this.apiHost() + '/oauth/api/me.json', accessToken, function (err, data) {
if (err) return p.fail(err);
var oauthUser = JSON.parse(data);
p.fulfill(oauthUser);

0 comments on commit 7ce6393

Please sign in to comment.