fix: add sAMAccountName for AD search (#1869)

This commit is contained in:
Yaodong Yu
2023-05-19 21:16:59 +08:00
committed by GitHub
parent af79fdedf2
commit 1260354b36
3 changed files with 5 additions and 2 deletions

View File

@ -367,7 +367,7 @@ func (ldapUser *LdapUser) GetLdapUuid() string {
return ldapUser.Cn
}
func (ldap *Ldap) buildFilterString(user *User) string {
func (ldap *Ldap) buildAuthFilterString(user *User) string {
if len(ldap.FilterFields) == 0 {
return fmt.Sprintf("(&%s(uid=%s))", ldap.Filter, user.Name)
}
@ -385,6 +385,8 @@ func (user *User) getFieldFromLdapAttribute(attribute string) string {
switch attribute {
case "uid":
return user.Name
case "sAMAccountName":
return user.Name
case "mail":
return user.Email
case "mobile":