mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-01 07:38:33 -04:00
Introduce ldap.useridField
Signed-off-by: Dustin Frisch <fooker@lab.sh>
This commit is contained in:
parent
b0ce3d0230
commit
d6ee10d176
5 changed files with 10 additions and 3 deletions
|
@ -115,6 +115,7 @@ module.exports = {
|
|||
searchFilter: undefined,
|
||||
searchAttributes: undefined,
|
||||
usernameField: undefined,
|
||||
useridField: undefined,
|
||||
tlsca: undefined
|
||||
},
|
||||
saml: {
|
||||
|
|
|
@ -84,6 +84,7 @@ module.exports = {
|
|||
searchFilter: process.env.HMD_LDAP_SEARCHFILTER,
|
||||
searchAttributes: toArrayConfig(process.env.HMD_LDAP_SEARCHATTRIBUTES),
|
||||
usernameField: process.env.HMD_LDAP_USERNAMEFIELD,
|
||||
useridField: process.env.HMD_LDAP_USERIDFIELD,
|
||||
tlsca: process.env.HMD_LDAP_TLS_CA
|
||||
},
|
||||
saml: {
|
||||
|
|
|
@ -24,8 +24,11 @@ passport.use(new LDAPStrategy({
|
|||
}
|
||||
}, function (user, done) {
|
||||
var uuid = user.uidNumber || user.uid || user.sAMAccountName
|
||||
var username = uuid
|
||||
if (config.ldap.useridField && user[config.ldap.useridField]) {
|
||||
uuid = user[config.ldap.useridField]
|
||||
}
|
||||
|
||||
var username = uuid
|
||||
if (config.ldap.usernameField && user[config.ldap.usernameField]) {
|
||||
username = user[config.ldap.usernameField]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue