From 13a8d8631e42e9e814666ae360bb85d4ba405f22 Mon Sep 17 00:00:00 2001 From: Ramkumar Chinchani Date: Fri, 8 Nov 2019 11:22:12 -0800 Subject: [PATCH] ldap: setup a new ldap conn on bind failure --- pkg/api/ldap.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/api/ldap.go b/pkg/api/ldap.go index 153cbc61..e6eee3b0 100644 --- a/pkg/api/ldap.go +++ b/pkg/api/ldap.go @@ -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 } }