Dead-simple authentication for diet.js.
npm install diet-auth
More services are coming soon.
Example Facebook Authentication
// index.jsvar server =var app =appvar auth = app// Setup Auth Servicevar facebook =// Listen on GET /auth/facebook/redirectapp
http://localhost:8000/auth/facebookwill bring up the facebook login page.
- After the user agreed or declined access to the application it will be redirected to your Redirect URL that is held in
truethen you'll have access to the
$.data.userobject that contains every profile information that you requested with the scope.
falsethen you can see what's wrong in the
diet-auth has a generalised api for all services. The only differences between services is the scope names and the
// Setup Auth Servicevar yourService = auth// Listen on GET /auth/yourService/redirectapp
Better API documentation
Windows Live authorization