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:
parent
01339b089e
commit
9119dcca63
15 changed files with 291 additions and 14 deletions
|
@ -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
|
||||
})
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue