mirror of
https://github.com/Luzifer/nginx-sso.git
synced 2024-12-20 12:51:17 +00:00
Fix: Ensure alias is set correctly when it is a DN
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
bb079f0832
commit
ed630b3edd
1 changed files with 7 additions and 1 deletions
|
@ -219,7 +219,13 @@ func (a authLDAP) checkLogin(username, password, aliasAttribute string) (string,
|
|||
return "", "", errNoValidUserFound
|
||||
}
|
||||
|
||||
return userDN, sres.Entries[0].GetAttributeValue(aliasAttribute), nil
|
||||
alias := sres.Entries[0].GetAttributeValue(aliasAttribute)
|
||||
if aliasAttribute == "dn" {
|
||||
// DN is not fetchable through GetAttributeValue as it is not an attribute
|
||||
alias = userDN
|
||||
}
|
||||
|
||||
return userDN, alias, nil
|
||||
}
|
||||
|
||||
// dial connects to the LDAP server and authenticates using manager_dn
|
||||
|
|
Loading…
Reference in a new issue