@Bean
    @ConditionalOnMissingBean(name = "duoSecurityRestHttpRequestCredentialFactory")
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public RestHttpRequestCredentialFactory duoSecurityRestHttpRequestCredentialFactory(
        @Qualifier(TenantExtractor.BEAN_NAME)
        final TenantExtractor tenantExtractor,
        final ConfigurableApplicationContext applicationContext) {
        return BeanSupplier.of(RestHttpRequestCredentialFactory.class)
            .when(DuoSecurityAuthenticationService.CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> new DuoSecurityRestHttpRequestCredentialFactory(tenantExtractor))
            .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