@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @ConditionalOnMissingBean(name = "ldapServiceRegistry")
    public ServiceRegistry ldapServiceRegistry(
        @Qualifier("ldapServiceRegistryMapper")
        final LdapRegisteredServiceMapper ldapServiceRegistryMapper,
        final CasConfigurationProperties casProperties,
        final ConfigurableApplicationContext applicationContext,
        final ObjectProvider<List<ServiceRegistryListener>> serviceRegistryListeners) {
        return BeanSupplier.of(ServiceRegistry.class)
            .when(CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> {
                val ldap = casProperties.getServiceRegistry().getLdap();
                val connectionFactory = LdapUtils.newLdaptiveConnectionFactory(ldap);
                LOGGER.debug("Configured LDAP service registry search filter to [{}] and load filter to [{}]",
                    ldap.getSearchFilter(), ldap.getLoadFilter());
                return new LdapServiceRegistry(connectionFactory, ldapServiceRegistryMapper,
                    ldap, applicationContext,
                    Optional.ofNullable(serviceRegistryListeners.getIfAvailable()).orElseGet(ArrayList::new));
            })
            .otherwiseProxy()
            .get();
    }
This is {@link CasLdapServiceRegistryAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-ldap-service-registry/src/main/java/org/apereo/cas/config/CasLdapServiceRegistryAutoConfiguration.java