mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-02 11:20:18 +08:00
fix: add sAMAccountName for AD search (#1869)
This commit is contained in:
@ -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":
|
||||
|
Reference in New Issue
Block a user