passwordless-couchbasestore v0.0.10
Passwordless-CouchbaseStore
This module provides token storage for Passwordless, a node.js module for express that allows website authentication without password using verification through email or other means. Visit the project's website https://passwordless.net for more details.
Usage
First, install the module:
$ npm install passwordless-couchbasestore --save
Afterwards, follow the guide for Passwordless. A typical implementation may look like this:
var passwordless = require('passwordless');
var CouchbaseStore = require('passwordless-couchbasestore');
passwordless.init(new CouchbaseStore('http://localhost:8091', { bucket: 'passwordless-token' }));
passwordless.addDelivery(function (tokenToSend, udiToSend, recipient, cb) {
// send token to user
});
app.use(passwordless.sessionSupport( ));
app.use(passwordless.acceptToken( ));
Initialization
new CouchbaseStore(url, [options]);
- url: (string) No special uri, just a basic http address (http://localhost:8091).
- options: (object) Optional. This can include Coucbase options, such as bucket.
Options
- bucket: (string) Optional. Name of the bucket to be used. Default: 'default'. Needs to be created in Couchbase before used.
Hash and salt
As the tokens are equivalent to passwords (even though they do have the security advantage of only being valid for a limited time) they have to be protected in the same way. passwordless-mongostore uses bcrypt with automatically created random salts. To generate the salt 10 rounds are used.
License
Author
Fredrik Slättman @fredrikslattman
9 years ago