mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
[BUGFIX] Allow username_attribute == mail_attribute (#865)
This commit is contained in:
parent
4d1c2f38be
commit
4deebe2a64
|
@ -162,7 +162,8 @@ func (p *LDAPUserProvider) getUserProfile(conn LDAPConnection, inputUsername str
|
||||||
for _, attr := range sr.Entries[0].Attributes {
|
for _, attr := range sr.Entries[0].Attributes {
|
||||||
if attr.Name == p.configuration.MailAttribute {
|
if attr.Name == p.configuration.MailAttribute {
|
||||||
userProfile.Emails = attr.Values
|
userProfile.Emails = attr.Values
|
||||||
} else if attr.Name == p.configuration.UsernameAttribute {
|
}
|
||||||
|
if attr.Name == p.configuration.UsernameAttribute {
|
||||||
if len(attr.Values) != 1 {
|
if len(attr.Values) != 1 {
|
||||||
return nil, fmt.Errorf("User %s cannot have multiple value for attribute %s",
|
return nil, fmt.Errorf("User %s cannot have multiple value for attribute %s",
|
||||||
inputUsername, p.configuration.UsernameAttribute)
|
inputUsername, p.configuration.UsernameAttribute)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user