mirror of
https://github.com/grafana/grafana.git
synced 2025-01-24 15:27:01 -06:00
logging(ldap): added more logging to bind failures, #2588
This commit is contained in:
parent
3e0c66edab
commit
ca5e8c73d7
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user