diff --git a/connector/ldap/ldap.go b/connector/ldap/ldap.go
index f37defe386108438ba565e3f9f0f1121c37c848e..8d112b7267d67a180d6a48670e1e8cf735e4700c 100644
--- a/connector/ldap/ldap.go
+++ b/connector/ldap/ldap.go
@@ -359,6 +359,11 @@ func (c *ldapConnector) userEntry(conn *ldap.Conn, username string) (user ldap.E
 }
 
 func (c *ldapConnector) Login(ctx context.Context, s connector.Scopes, username, password string) (ident connector.Identity, validPass bool, err error) {
+	// make this check to avoid anonymous bind to the LDAP server.
+	if password == "" {
+		return connector.Identity{}, false, nil
+	}
+
 	var (
 		// We want to return a different error if the user's password is incorrect vs
 		// if there was an error.