@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @Bean
    @ConditionalOnMissingBean(name = "restfulSurrogateAuthenticationService")
    public BeanSupplier<SurrogateAuthenticationService> restfulSurrogateAuthenticationService(
        @Qualifier(RegisteredServicePrincipalAccessStrategyEnforcer.BEAN_NAME)
        final RegisteredServicePrincipalAccessStrategyEnforcer principalAccessStrategyEnforcer,
        final CasConfigurationProperties casProperties,
        final ConfigurableApplicationContext applicationContext,
        @Qualifier(ServicesManager.BEAN_NAME)
        final ServicesManager servicesManager) {
        return BeanSupplier.of(SurrogateAuthenticationService.class)
            .alwaysMatch()
            .supply(Unchecked.supplier(() -> {
                val su = casProperties.getAuthn().getSurrogate();
                LOGGER.debug("Using REST endpoint [{}] with method [{}] to locate surrogate accounts",
                    su.getRest().getUrl(), su.getRest().getMethod());
                return new SurrogateRestAuthenticationService(servicesManager, casProperties,
                    principalAccessStrategyEnforcer, applicationContext);
            }))
            .otherwiseNull();
    }
This is {@link CasSurrogateRestAuthenticationAutoConfiguration}.

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