1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-03 17:59:28 +02:00

Add UI to LDAP login.

This commit is contained in:
Simo Kinnunen 2014-01-31 21:39:07 +09:00
parent 01339b089e
commit 9119dcca63
15 changed files with 291 additions and 14 deletions

View file

@ -25,14 +25,19 @@ module.exports.login = function(options, username, password) {
, maxConnections: 1
})
client.bind(options.bind.dn, options.bind.credentials, function(err) {
if (err) {
resolver.reject(err)
}
else {
resolver.resolve(client)
}
})
if (options.bind.dn) {
client.bind(options.bind.dn, options.bind.credentials, function(err) {
if (err) {
resolver.reject(err)
}
else {
resolver.resolve(client)
}
})
}
else {
resolver.resolve(client)
}
return resolver.promise
}
@ -48,7 +53,7 @@ module.exports.login = function(options, username, password) {
, value: options.search.objectClass
})
, new ldap.EqualityFilter({
attribute: options.search.loginField
attribute: options.search.field
, value: username
})
]