diff --git a/internal/authentication/ldap_user_provider.go b/internal/authentication/ldap_user_provider.go index a9a26760..97fd6f41 100644 --- a/internal/authentication/ldap_user_provider.go +++ b/internal/authentication/ldap_user_provider.go @@ -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)