more logging
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-04 16:07:54 +11:00
parent f57f11d855
commit ad93b59769

View File

@@ -123,12 +123,14 @@ func VerifyLdapCreds(username string, password string) bool {
defer ldaps.Close() defer ldaps.Close()
ldaps.Debug = true
// try to bind to AD // try to bind to AD
log.Printf("Attempting LDAP bind with user '%s' and password '%s'\n", username, password) log.Printf("Attempting LDAP bind with user '%s' and password '%s'\n", username, password)
err = ldaps.Bind(username, password) err = ldaps.Bind(username, password)
if err != nil { if err != nil {
if ldapErr, ok := err.(*ldap.Error); ok && ldapErr.ResultCode == ldap.LDAPResultInvalidCredentials { if ldapErr, ok := err.(*ldap.Error); ok && ldapErr.ResultCode == ldap.LDAPResultInvalidCredentials {
log.Printf("VerifyLdapCreds user credentials are incorrect\n") log.Printf("VerifyLdapCreds user credentials are incorrect : '%s'\n", err)
return false return false
} else { } else {
log.Printf("VerifyLdapCreds error binding to LDAP with supplied credentials : '%s'\n", err) log.Printf("VerifyLdapCreds error binding to LDAP with supplied credentials : '%s'\n", err)