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);
}
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);
}
});
}
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);
}
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);
}
Aggregations