Q:

Node.js - Need authentication tutorial for passport.js with couchdb

I'm a CouchDB begginer, suggest me a tutorial for authentication method using node.js + couchdb.

A:

You can see SuperLogin - it uses Passport strategies but adds some convenient abstractions to make development easier for common tasks. See:

https://www.npmjs.com/package/superlogin

SuperLogin is a full-featured NodeJS/Express user authentication solution for APIs and Single Page Apps (SPA) using CouchDB or Cloudant.

It has good documentation and examples. What will be of most use to you is the SuperLogin Demo - a full-stack demo of how to integrate SuperLogin and Express with AngularJS and CouchDB. It's available on GitHub and is very well documented:

https://github.com/colinskow/superlogin-demo

If you want a strictly Passport-based solution then see this example of Passport authentication using Express 4.0 and CouchDB:

https://github.com/pin3da/passport-couchdb

