[BUGFIX] Allow username_attribute == mail_attribute (#865)
parent
4d1c2f38be
commit
4deebe2a64
|
@ -162,7 +162,8 @@ func (p *LDAPUserProvider) getUserProfile(conn LDAPConnection, inputUsername str
|
|||
for _, attr := range sr.Entries[0].Attributes {
|
||||
if attr.Name == p.configuration.MailAttribute {
|
||||
userProfile.Emails = attr.Values
|
||||
} else if attr.Name == p.configuration.UsernameAttribute {
|
||||
}
|
||||
if attr.Name == p.configuration.UsernameAttribute {
|
||||
if len(attr.Values) != 1 {
|
||||
return nil, fmt.Errorf("User %s cannot have multiple value for attribute %s",
|
||||
inputUsername, p.configuration.UsernameAttribute)
|
||||
|
|
Loading…
Reference in New Issue