protected boolean doesSurrogateAccountExistInLdap(final String surrogate) {
        val ldapProperties = casProperties.getAuthn().getSurrogate().getLdap();
        for (val ldap : ldapProperties) {
            try (val connectionFactory = new LdapConnectionFactory(LdapUtils.newLdaptiveConnectionFactory(ldap))) {
                if (doesSurrogateAccountExistInLdap(surrogate, connectionFactory, ldap)) {
                    return true;
                }
            } catch (final Throwable e) {
                LoggingUtils.error(LOGGER, e);
            }
        }
        return false;
    }
This is {@link SurrogateLdapAuthenticationService}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-surrogate-authentication-ldap/src/main/java/org/apereo/cas/authentication/surrogate/SurrogateLdapAuthenticationService.java