@Bean
    @ConditionalOnMissingBean(name = "captchaActivationStrategy")
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public CaptchaActivationStrategy captchaActivationStrategy(
        final ConfigurableApplicationContext applicationContext,
        @Qualifier(ServicesManager.BEAN_NAME)
        final ServicesManager servicesManager) {
        return BeanSupplier.of(CaptchaActivationStrategy.class)
            .when(CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> new DefaultCaptchaActivationStrategy(servicesManager))
            .otherwiseProxy()
            .get();
    }
This is {@link CasCaptchaAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-captcha/src/main/java/org/apereo/cas/config/CasCaptchaAutoConfiguration.java