ldap authentication works

This commit is contained in:
Marc Wäckerlin
2016-09-20 22:29:33 +00:00
parent 53a51b354c
commit efeb7a6987
12 changed files with 103 additions and 45 deletions

View File

@@ -1,4 +1,4 @@
module.exports = function(io) {
module.exports = function(io, authentication) {
var pty = require('pty.js');
var proc = require('child_process');
@@ -287,10 +287,9 @@ module.exports = function(io) {
//get credentials sent by the client
var username = data.username;
var password = data.password;
if (username=="hello")
return callback(null, "world" == password);
else
return callback(new Error("wrong credentials"));
authentication(data.username, data.password,
function() {console.log("####LOGIN-SUCESS####");callback(null, true)},
function() {console.log("####LOGIN-FAIL####");callback(new Error("wrong credentials"))});
},
postAuthenticate: connection,
timeout: "none"