From ca5e8c73d773483317815e895ede32e49ccf39e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 24 Aug 2015 11:47:22 +0200 Subject: [PATCH] logging(ldap): added more logging to bind failures, #2588 --- pkg/login/ldap.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/login/ldap.go b/pkg/login/ldap.go index f3699efab0d..6305df6726c 100644 --- a/pkg/login/ldap.go +++ b/pkg/login/ldap.go @@ -193,6 +193,10 @@ func (a *ldapAuther) syncOrgRoles(user *m.User, ldapUser *ldapUserInfo) error { func (a *ldapAuther) secondBind(ldapUser *ldapUserInfo, userPassword string) error { if err := a.conn.Bind(ldapUser.DN, userPassword); err != nil { + if ldapCfg.VerboseLogging { + log.Info("LDAP second bind failed, %v", err) + } + if ldapErr, ok := err.(*ldap.Error); ok { if ldapErr.ResultCode == 49 { return ErrInvalidCredentials @@ -216,6 +220,10 @@ func (a *ldapAuther) initialBind(username, userPassword string) error { } if err := a.conn.Bind(bindPath, userPassword); err != nil { + if ldapCfg.VerboseLogging { + log.Info("LDAP initial bind failed, %v", err) + } + if ldapErr, ok := err.(*ldap.Error); ok { if ldapErr.ResultCode == 49 { return ErrInvalidCredentials