@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @ConditionalOnMissingBean(name = "duoSecurityRestHttpRequestCredentialFactoryConfigurer")
    public RestHttpRequestCredentialFactoryConfigurer duoSecurityRestHttpRequestCredentialFactoryConfigurer(
        final ConfigurableApplicationContext applicationContext,
        @Qualifier("duoSecurityRestHttpRequestCredentialFactory")
        final RestHttpRequestCredentialFactory duoSecurityRestHttpRequestCredentialFactory) {
        return BeanSupplier.of(RestHttpRequestCredentialFactoryConfigurer.class)
            .when(DuoSecurityAuthenticationService.CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> factory -> factory.registerCredentialFactory(duoSecurityRestHttpRequestCredentialFactory))
            .otherwiseProxy()
            .get();
    }
This is {@link DuoSecurityRestConfiguration}.

@author Misagh Moayyed
@since 6.4.0
support/cas-server-support-duo/src/main/java/org/apereo/cas/config/DuoSecurityRestConfiguration.java