@ConditionalOnMissingBean(name = "groovyScriptMultifactorAuthenticationTrigger")
        @Bean
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @ConditionalOnMissingGraalVMNativeImage
        public MultifactorAuthenticationTrigger groovyScriptMultifactorAuthenticationTrigger(
            @Qualifier(TenantExtractor.BEAN_NAME)
            final TenantExtractor tenantExtractor,
            @Qualifier(MultifactorAuthenticationProviderSelector.BEAN_NAME)
            final MultifactorAuthenticationProviderSelector multifactorAuthenticationProviderSelector,
            @Qualifier(MultifactorAuthenticationProviderResolver.BEAN_NAME)
            final MultifactorAuthenticationProviderResolver multifactorAuthenticationProviderResolver,
            final ConfigurableApplicationContext applicationContext,
            final CasConfigurationProperties casProperties) {
            return BeanSupplier.of(MultifactorAuthenticationTrigger.class)
                .when(BeanCondition.on("cas.authn.mfa.groovy-script.location")
                    .exists().given(applicationContext.getEnvironment()))
                .when(ExecutableCompiledScriptFactory.findExecutableCompiledScriptFactory().isPresent())
                .supply(() -> {
                    val groovyScript = casProperties.getAuthn().getMfa().getGroovyScript().getLocation();
                    val scriptFactory = ExecutableCompiledScriptFactory.getExecutableCompiledScriptFactory();
                    val watchableScript = scriptFactory.fromResource(groovyScript);
                    return new GroovyScriptMultifactorAuthenticationTrigger(watchableScript, applicationContext,
                        multifactorAuthenticationProviderResolver, multifactorAuthenticationProviderSelector, tenantExtractor);
                })
                .otherwiseProxy()
                .get();
        }
This is {@link CasCoreMultifactorAuthenticationWebflowAutoConfiguration}.

@author Travis Schmidt
@since 6.0.0
core/cas-server-core-webflow-mfa/src/main/java/org/apereo/cas/config/CasCoreMultifactorAuthenticationWebflowAutoConfiguration.java