private LdapEntry searchLdapAccountsBy(final long id) {
        return FunctionUtils.doUnchecked(() -> {
            val searchFilter = String.format("(%s=*\"id\":%s*)", ldapProperties.getAccountAttributeName(), id);
            val filter = LdapUtils.newLdaptiveSearchFilter(searchFilter);
            LOGGER.debug("Locating LDAP entry via filter [{}] based on attribute [{}]", filter,
                ldapProperties.getAccountAttributeName());
            val response = connectionFactory.executeSearchOperation(ldapProperties.getBaseDn(),
                filter, ldapProperties.getPageSize(), ldapProperties.getAccountAttributeName());
            if (LdapUtils.containsResultEntry(response)) {
                val entry = response.getEntry();
                LOGGER.debug("Located LDAP entry [{}]", entry);
                return entry;
            }
            return null;
        });
    }
This is {@link LdapGoogleAuthenticatorTokenCredentialRepository}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-gauth-ldap/src/main/java/org/apereo/cas/gauth/credential/LdapGoogleAuthenticatorTokenCredentialRepository.java