Relmeauth
This is a very simple IndieAuth (or rel='me' auth) middleware (Connect) for Node.js. The main design goal is to enable a dead simple auth inside any Connect-type application.
Install
npm install relmeauth
Dependencies
It requires that you use the bodyParser middleware, the cookieParser middleware (for the session).
Example/Usage
var express = ;var relme = ; var app = ;app;app;app;app; app; app
Current providers include: Google, Github, with OStatus sites, Twitter, to come. If you want to support IndieAuth, make sure you support OAuth2, provide rel=me
links on your profiles pages.
Test it in on this site.
Customization
You can initialize the middleware by providing a configuration object. Options include
- prefix: the prefix for all the relmeauth urls. Default is
relmeauth
. Change it if it conflicts with your application. - authPage: the page on which the user will be asked to submit his indieAuth url. The form must be of GET method and the
url provided' name must be
me
. - authErrorPage: the page on which error messages will be displayed. The error message is accessible in response.authError
Example:
app;
Thank you
Special thanks go to ciaranj for his node-auth NPM, and praise goes to jaredhanson for his willingness to make passport simpler to use!