diff options
author | Adam Strzelecki <ono@java.pl> | 2016-02-16 12:36:40 +0100 |
---|---|---|
committer | Adam Strzelecki <ono@java.pl> | 2016-02-20 14:12:32 +0100 |
commit | 5649556a3368d3b9fbf8cdb89d04a1c6154c529a (patch) | |
tree | c892bbcca5d83f6d767c774f1d304e79f6aacd00 /modules/auth | |
parent | 834d92a47ba782b0f6cf609799864c4c73d44c5e (diff) | |
download | gitea-5649556a3368d3b9fbf8cdb89d04a1c6154c529a.tar.gz gitea-5649556a3368d3b9fbf8cdb89d04a1c6154c529a.zip |
LDAP: Make a bit more detailed log traces
This is useful especially to check whether we fetch right attributes, using
right LDAP search base and in right order.
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/ldap/ldap.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/auth/ldap/ldap.go b/modules/auth/ldap/ldap.go index 376092fcb0..8a8cb89b67 100644 --- a/modules/auth/ldap/ldap.go +++ b/modules/auth/ldap/ldap.go @@ -78,7 +78,7 @@ func (ls *Source) findUserDN(l *ldap.Conn, name string) (string, bool) { return "", false } - log.Trace("Searching using filter %s", userFilter) + log.Trace("Searching for DN using filter %s and base %s", userFilter, ls.UserBase) search := ldap.NewSearchRequest( ls.UserBase, ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false, userFilter, []string{}, nil) @@ -144,6 +144,7 @@ func (ls *Source) SearchEntry(name, passwd string, directBind bool) (string, str return "", "", "", "", false, false } + log.Trace("Fetching attributes '%v', '%v', '%v', '%v' with filter %s and base %s", ls.AttributeUsername, ls.AttributeName, ls.AttributeSurname, ls.AttributeMail, userFilter, userDN) search := ldap.NewSearchRequest( userDN, ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false, userFilter, []string{ls.AttributeUsername, ls.AttributeName, ls.AttributeSurname, ls.AttributeMail}, @@ -170,6 +171,7 @@ func (ls *Source) SearchEntry(name, passwd string, directBind bool) (string, str admin_attr := false if len(ls.AdminFilter) > 0 { + log.Trace("Checking admin with filter %s and base %s", ls.AdminFilter, userDN) search = ldap.NewSearchRequest( userDN, ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false, ls.AdminFilter, []string{ls.AttributeName}, |