-
Notifications
You must be signed in to change notification settings - Fork 159
Authentication
j-sz edited this page Nov 20, 2015
·
3 revisions
Digest auth example:
var jsDAV = require("jsDAV/lib/jsdav");
// setting debugMode to TRUE outputs a LOT of information to console
jsDAV.debugMode = true;
var jsDAV_Locks_Backend_FS = require("jsDAV/lib/DAV/plugins/locks/fs");
var jsDAV_Auth_Backend_File = require("jsDAV/lib/DAV/plugins/auth/file");
jsDAV.createServer({
node: __dirname + "/data",
locksBackend: jsDAV_Locks_Backend_FS.new(__dirname + "/data"),
authBackend: jsDAV_Auth_Backend_File.new(__dirname + "/myhtdigest"),
realm: "jsdavtest"
}, 8000);
To generate myhtdigest file:
htdigest -c ./myhtdigest jsdavtest mylogin
# remove empty line or it will crash into jsDAV
perl -i -pe "chomp if eof" ./myhtdigest