Search in sources :

Example 1 with FlowDefinitionRegistry

use of org.springframework.webflow.definition.registry.FlowDefinitionRegistry in project cas by apereo.

the class CasWebflowContextConfiguration method flowExecutorViaClientFlowExecution.

@Bean
public FlowExecutor flowExecutorViaClientFlowExecution() {
    final FlowDefinitionRegistry loginFlowRegistry = loginFlowRegistry();
    final ClientFlowExecutionRepository repository = new ClientFlowExecutionRepository();
    repository.setFlowDefinitionLocator(loginFlowRegistry);
    repository.setTranscoder(loginFlowStateTranscoder());
    final FlowExecutionImplFactory factory = new FlowExecutionImplFactory();
    factory.setExecutionKeyFactory(repository);
    repository.setFlowExecutionFactory(factory);
    return new FlowExecutorImpl(loginFlowRegistry, factory, repository);
}
Also used : FlowDefinitionRegistry(org.springframework.webflow.definition.registry.FlowDefinitionRegistry) FlowExecutorImpl(org.springframework.webflow.executor.FlowExecutorImpl) FlowExecutionImplFactory(org.springframework.webflow.engine.impl.FlowExecutionImplFactory) ClientFlowExecutionRepository(org.apereo.spring.webflow.plugin.ClientFlowExecutionRepository) CipherBean(org.cryptacular.bean.CipherBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with FlowDefinitionRegistry

use of org.springframework.webflow.definition.registry.FlowDefinitionRegistry in project cas by apereo.

the class DuoMultifactorWebflowConfigurer method doInitialize.

@Override
protected void doInitialize() {
    provider.getProviders().forEach(p -> {
        final FlowDefinitionRegistry duoFlowRegistry = buildDuoFlowRegistry(p);
        applicationContext.getAutowireCapableBeanFactory().initializeBean(duoFlowRegistry, p.getId());
        final ConfigurableListableBeanFactory cfg = (ConfigurableListableBeanFactory) applicationContext.getAutowireCapableBeanFactory();
        cfg.registerSingleton(p.getId(), duoFlowRegistry);
        registerMultifactorProviderAuthenticationWebflow(getLoginFlow(), p.getId(), duoFlowRegistry);
    });
    casProperties.getAuthn().getMfa().getDuo().stream().filter(DuoSecurityMultifactorProperties::isTrustedDeviceEnabled).forEach(duo -> {
        final String id = duo.getId();
        try {
            LOGGER.debug("Activating multifactor trusted authentication for webflow [{}]", id);
            final FlowDefinitionRegistry registry = applicationContext.getBean(id, FlowDefinitionRegistry.class);
            registerMultifactorTrustedAuthentication(registry);
        } catch (final Exception e) {
            LOGGER.error("Failed to register multifactor trusted authentication for " + id, e);
        }
    });
}
Also used : FlowDefinitionRegistry(org.springframework.webflow.definition.registry.FlowDefinitionRegistry) ConfigurableListableBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)

Example 3 with FlowDefinitionRegistry

use of org.springframework.webflow.definition.registry.FlowDefinitionRegistry in project cas by apereo.

the class CasWebflowContextConfiguration method flowExecutorViaServerSessionBindingExecution.

@Bean
public FlowExecutor flowExecutorViaServerSessionBindingExecution() {
    final FlowDefinitionRegistry loginFlowRegistry = loginFlowRegistry();
    final SessionBindingConversationManager conversationManager = new SessionBindingConversationManager();
    conversationManager.setLockTimeoutSeconds(Long.valueOf(casProperties.getWebflow().getSession().getLockTimeout()).intValue());
    conversationManager.setMaxConversations(casProperties.getWebflow().getSession().getMaxConversations());
    final FlowExecutionImplFactory executionFactory = new FlowExecutionImplFactory();
    final SerializedFlowExecutionSnapshotFactory flowExecutionSnapshotFactory = new SerializedFlowExecutionSnapshotFactory(executionFactory, loginFlowRegistry);
    flowExecutionSnapshotFactory.setCompress(casProperties.getWebflow().getSession().isCompress());
    final DefaultFlowExecutionRepository repository = new DefaultFlowExecutionRepository(conversationManager, flowExecutionSnapshotFactory);
    executionFactory.setExecutionKeyFactory(repository);
    return new FlowExecutorImpl(loginFlowRegistry, executionFactory, repository);
}
Also used : DefaultFlowExecutionRepository(org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository) SessionBindingConversationManager(org.springframework.webflow.conversation.impl.SessionBindingConversationManager) SerializedFlowExecutionSnapshotFactory(org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory) FlowDefinitionRegistry(org.springframework.webflow.definition.registry.FlowDefinitionRegistry) FlowExecutorImpl(org.springframework.webflow.executor.FlowExecutorImpl) FlowExecutionImplFactory(org.springframework.webflow.engine.impl.FlowExecutionImplFactory) CipherBean(org.cryptacular.bean.CipherBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Example 4 with FlowDefinitionRegistry

use of org.springframework.webflow.definition.registry.FlowDefinitionRegistry in project cas by apereo.

the class AbstractCasWebflowConfigurer method buildFlow.

@Override
public Flow buildFlow(final String location, final String id) {
    final FlowDefinitionRegistryBuilder builder = new FlowDefinitionRegistryBuilder(this.applicationContext, this.flowBuilderServices);
    builder.setParent(this.loginFlowDefinitionRegistry);
    builder.addFlowLocation(location, id);
    final FlowDefinitionRegistry registry = builder.build();
    return (Flow) registry.getFlowDefinition(id);
}
Also used : FlowDefinitionRegistryBuilder(org.springframework.webflow.config.FlowDefinitionRegistryBuilder) FlowDefinitionRegistry(org.springframework.webflow.definition.registry.FlowDefinitionRegistry) Flow(org.springframework.webflow.engine.Flow)

Aggregations

FlowDefinitionRegistry (org.springframework.webflow.definition.registry.FlowDefinitionRegistry)4 CipherBean (org.cryptacular.bean.CipherBean)2 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 Bean (org.springframework.context.annotation.Bean)2 FlowExecutionImplFactory (org.springframework.webflow.engine.impl.FlowExecutionImplFactory)2 FlowExecutorImpl (org.springframework.webflow.executor.FlowExecutorImpl)2 ClientFlowExecutionRepository (org.apereo.spring.webflow.plugin.ClientFlowExecutionRepository)1 ConfigurableListableBeanFactory (org.springframework.beans.factory.config.ConfigurableListableBeanFactory)1 FlowDefinitionRegistryBuilder (org.springframework.webflow.config.FlowDefinitionRegistryBuilder)1 SessionBindingConversationManager (org.springframework.webflow.conversation.impl.SessionBindingConversationManager)1 Flow (org.springframework.webflow.engine.Flow)1 DefaultFlowExecutionRepository (org.springframework.webflow.execution.repository.impl.DefaultFlowExecutionRepository)1 SerializedFlowExecutionSnapshotFactory (org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshotFactory)1