Merge pull request #35 from rchincha/ldap

ldap: setup a new ldap conn on bind failure
This commit is contained in:
Tycho Andersen 2019-11-08 13:35:24 -07:00 committed by GitHub
commit 0550752e63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,9 @@ func (lc *LDAPClient) Authenticate(username, password string) (bool, map[string]
err := lc.Conn.Bind(lc.BindDN, lc.BindPassword)
if err != nil {
lc.log.Error().Err(err).Str("bindDN", lc.BindDN).Msg("bind failed")
// clean up the cached conn, so we can retry
lc.Conn.Close()
lc.Conn = nil
return false, nil, err
}
}