**Problem:** 
Some AD users can't log in, they get the error:
`Authentification failed: password is incorrect or there is no user with such name`

Clickhouse version 22.3.2.1

**There is an error in Clickhouse logs:**
`<Error> Access(user directories): from: 10.11.12.13, user: AD_USERNAME: Authentification failed: Code: 532. DB::Exception: Size limit exceeded. (LDAP_ERROR)`

This error occurs for AD users who have many groups in the **memberOf** LDAP container.

**I checked the number of groups for 4 accounts:**

AD_USERNAME_1 - 107 groups - ERROR Authentification failed
AD_USERNAME_2 - 120 groups - ERROR Authentification failed
AD_USERNAME_3 - 54   groups - OK
AD_USERNAME_4 - 38   groups - OK

**I checked the search groups through the Ldapsearch program:**

Ldapsearch gave all 107 groups for the account without errors:
`ldapsearch -H "ldaps://hostname:636" -D 'CN=AD_USERNAME_1,OU=Users,DC=company,DC=corp.DC=net' -b 'DC=company,DC=corp.DC=net' '(&(objectClass=group)(member=CN=AD_USERNAME_1,OU=Groups,DC=company,DC=corp.DC=net))'`

**Probable cause of the error:** 
Clickhouse receives a list of groups which mapping from AD and cannot process a large string/array.
{
    std::scoped_lock lock(mutex);
    resetImpl();
    Poco::Util::AbstractConfiguration::Keys all_keys;
    config.keys("", all_keys);
    std::size_t ldap_servers_key_count = 0;
    std::size_t kerberos_keys_count = 0;
    for (auto key : all_keys)
    {
        const auto bracket_pos = key.find('[');
        if (bracket_pos != std::string::npos)
            key.resize(bracket_pos);
        boost::algorithm::to_lower(key);
        ldap_servers_key_count += (key == "ldap_servers");
        kerberos_keys_count += (key == "kerberos");
    }
    if (ldap_servers_key_count > 1)
        throw Exception("Multiple ldap_servers sections are not allowed", ErrorCodes::BAD_ARGUMENTS);
    if (kerberos_keys_count > 1)
        throw Exception("Multiple kerberos sections are not allowed", ErrorCodes::BAD_ARGUMENTS);
    Poco::Util::AbstractConfiguration::Keys ldap_server_names;
    config.keys("ldap_servers", ldap_server_names);
    ldap_client_params_blueprint.clear();
    for (auto ldap_server_name : ldap_server_names)
    {
        try
        {