Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

README updated for mailchimp hoobajooba

  • Loading branch information...
commit 9038bf6d3626eada52864566d3a2daa5f67bc913 1 parent 151bf06
@wnadeau wnadeau authored
Showing with 30 additions and 0 deletions.
  1. +30 −0 README.md
View
30 README.md
@@ -46,6 +46,8 @@ So far, `everyauth` enables you to login via:
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/500px.ico" style="vertical-align:middle"> 500px <td> <a href="https://github.com/dannyamey">Danny Amey</a>
<tr> <td> <img src="https://github.com/bnoguchi/everyauth/raw/master/media/mixi.ico" style="vertical-align:middle"> mixi
<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>
</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>
@@ -1860,6 +1862,34 @@ var routes = function (app) {
};
```
+### Mailchimp OAuth2
+
+First, register an app [in Mailchimp](http://login.mailchimp.com).
+
+```javascript
+var everyauth = require('everyauth')
+ , connect = require('connect');
+
+everyauth.mailchimp
+ .appId('YOUR CLIENT KEY HERE')
+ .appSecret('YOUR CLIENT SECRET HERE')
+ .myHostname(process.env.HOSTNAME || "http://127.0.0.1:3000")//MC requires 127.0.0.1 for dev
+ .findOrCreateUser( function (session, accessToken, accessTokenExtra, mailchimpUserData) {
+ // find or create user logic goes here
+ // Return a user or Promise that promises a user
+ // Promises are created via
+ // var promise = this.Promise();
+ // The mailchimpUserData object contains everything from the API method getAccountDetails and an apikey.
+ // You'll want to work with mailchimpUserData.user_id for queries
+ // and mailchimpUserData.apikey for your API wrapper
+ })
+ .redirectPath('/');
+
+var routes = function (app) {
+ // Define your routes here
+};
+```
+
### OpenID protocol
OpenID protocol allows you to use an openid auth request. You can read more information about it here http://openid.net/
Please sign in to comment.
Something went wrong with that request. Please try again.