@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    @ConditionalOnMissingBean(name = "ldapSurrogateAuthenticationService")
    public BeanSupplier<SurrogateAuthenticationService> ldapSurrogateAuthenticationService(
        @Qualifier(RegisteredServicePrincipalAccessStrategyEnforcer.BEAN_NAME)
        final RegisteredServicePrincipalAccessStrategyEnforcer principalAccessStrategyEnforcer,
        final ConfigurableApplicationContext applicationContext,
        @Qualifier(ServicesManager.BEAN_NAME)
        final ServicesManager servicesManager,
        final CasConfigurationProperties casProperties) {
        return BeanSupplier.of(SurrogateAuthenticationService.class)
            .when(CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> new SurrogateLdapAuthenticationService(casProperties,
                servicesManager, principalAccessStrategyEnforcer, applicationContext))
            .otherwiseNull();
    }
This is {@link CasSurrogateLdapAuthenticationAutoConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-surrogate-authentication-ldap/src/main/java/org/apereo/cas/config/CasSurrogateLdapAuthenticationAutoConfiguration.java