I have a NodeJs+Express+Mongo application. Application does CRUD operation on model "Item"
var Item = new Schema({
name: { type: String, required: true }
, description: String
, status: String
, price: { type: Number, "default": 0 }
});
What I want is to implement Authentication and authorization using everyauth (password -- not through facebook,twitter...) .can any one suggest a simple,easily understandable tutorial and an executable example that will suit a beginner?
Probably not the answer you are looking for, but if you've already read the official everyauth example and are still looking for more examples, you should perhaps consider a different project.
First, this problem domain in general isn't really great for beginners. You should probably code your own basic authentication to your database first and really understand that before laying the complexity of the everyauth library on top of that. Have you built a basic Node/Express/Mongo app that can do basic create, read, update, and delete operations without any authentication whatsoever? If not, go do that first. This is a bleeding edge technology stack and it looks like you are using Mongoose as well, which is another highly sophisticated API in terms of how it uses JavaScript.
Everyauth uses some deep javascript magic pretty heavily, advanced uses of promises, and a chaining/literate API that is difficult to work with inside a debugger and not necessarily an optimal API for beginners.
You might consider PassportJS instead of everyauth as it's API is somewhat less esoteric.
I agree with Peter's answer, but if you're certain you want to go this route take a look at mongoose-auth. It's an authentication plugin for mongoose that's based on everyauth.