mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 20:35:24 +01:00
Merge pull request #925 from jlebleu/915-Unable_to_log_twice_using_LDAP
fix: force username to lower case when creating LDAP user
This commit is contained in:
commit
6a4444b645
@ -3,13 +3,14 @@ package api
|
||||
import (
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"github.com/ansible-semaphore/semaphore/api/helpers"
|
||||
"github.com/ansible-semaphore/semaphore/db"
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ansible-semaphore/semaphore/api/helpers"
|
||||
"github.com/ansible-semaphore/semaphore/db"
|
||||
"github.com/go-ldap/ldap/v3"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/ansible-semaphore/semaphore/util"
|
||||
|
||||
@ -84,7 +85,7 @@ func tryFindLDAPUser(username, password string) (*db.User, error) {
|
||||
}
|
||||
|
||||
ldapUser := db.User{
|
||||
Username: sr.Entries[0].GetAttributeValue(util.Config.LdapMappings.UID),
|
||||
Username: strings.ToLower(sr.Entries[0].GetAttributeValue(util.Config.LdapMappings.UID)),
|
||||
Created: time.Now(),
|
||||
Name: sr.Entries[0].GetAttributeValue(util.Config.LdapMappings.CN),
|
||||
Email: sr.Entries[0].GetAttributeValue(util.Config.LdapMappings.Mail),
|
||||
|
Loading…
Reference in New Issue
Block a user