Commit ca5e8c73 by Torkel Ödegaard

logging(ldap): added more logging to bind failures, #2588

parent 3e0c66ed
...@@ -193,6 +193,10 @@ func (a *ldapAuther) syncOrgRoles(user *m.User, ldapUser *ldapUserInfo) error { ...@@ -193,6 +193,10 @@ func (a *ldapAuther) syncOrgRoles(user *m.User, ldapUser *ldapUserInfo) error {
func (a *ldapAuther) secondBind(ldapUser *ldapUserInfo, userPassword string) error { func (a *ldapAuther) secondBind(ldapUser *ldapUserInfo, userPassword string) error {
if err := a.conn.Bind(ldapUser.DN, userPassword); err != nil { 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, ok := err.(*ldap.Error); ok {
if ldapErr.ResultCode == 49 { if ldapErr.ResultCode == 49 {
return ErrInvalidCredentials return ErrInvalidCredentials
...@@ -216,6 +220,10 @@ func (a *ldapAuther) initialBind(username, userPassword string) error { ...@@ -216,6 +220,10 @@ func (a *ldapAuther) initialBind(username, userPassword string) error {
} }
if err := a.conn.Bind(bindPath, userPassword); err != nil { 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, ok := err.(*ldap.Error); ok {
if ldapErr.ResultCode == 49 { if ldapErr.ResultCode == 49 {
return ErrInvalidCredentials return ErrInvalidCredentials
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment