NOTE At this point, there are much better solutions for authorization in Node.js and this project is abandoned.
Fully working social authorization example in Node with Express.
- Initial role setting in the default setup.
- Add Facebook and/or Google user to MongoDB
- Amend user Mongo document instead of new document
- Persistence on server restart via connect-mongodb
- Google OAuth 2.0 aka Google+ Integration
- Passes auth specific helpers
fbUser
,googleUser
,bothUser
to the Jade file via ExpressHelpers
You may require some dependencies depending on your setup. Node should warn you about what is missing. This is more copy/paste for your situation than a true boilerplate.
You will need to drop the Mongoose-Auth Google Module into your setup because it's not included in the standard Mongoose-Auth package.
This code takes various examples from the DailyJS node tutorial series, the everyauth & mongoose-auth github pages and pieces it all together for a fully working login system with app-restart persistence.
- WebStorm/PHPStorm with Node Module (commercial)
- Nodemon & NodeInspector (open-source)
Copyright (c) 2011 by Brandon Hall
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE