Skip to content

Commit

Permalink
added dailycred to providers, finished touches
Browse files Browse the repository at this point in the history
  • Loading branch information
hstove committed Jul 14, 2012
1 parent 66fc876 commit 7ce6393
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -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>

Expand Down Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions lib/modules/dailycred.js
Expand Up @@ -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')

Expand All @@ -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);
Expand Down

0 comments on commit 7ce6393

Please sign in to comment.