use of org.springframework.webflow.engine.builder.BinderConfiguration in project cas by apereo.
the class AbstractCasWebflowConfigurer method getViewStateBinderConfiguration.
/**
* Gets state binder configuration.
*
* @param state the state
* @return the state binder configuration
*/
protected BinderConfiguration getViewStateBinderConfiguration(final ViewState state) {
final Field field = ReflectionUtils.findField(state.getViewFactory().getClass(), "binderConfiguration");
ReflectionUtils.makeAccessible(field);
return (BinderConfiguration) ReflectionUtils.getField(field, state.getViewFactory());
}
use of org.springframework.webflow.engine.builder.BinderConfiguration in project cas by apereo.
the class DefaultWebflowConfigurer method createRememberMeAuthnWebflowConfig.
private void createRememberMeAuthnWebflowConfig(final Flow flow) {
if (casProperties.getTicket().getTgt().getRememberMe().isEnabled()) {
createFlowVariable(flow, CasWebflowConstants.VAR_ID_CREDENTIAL, RememberMeUsernamePasswordCredential.class);
final ViewState state = (ViewState) flow.getState(CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM);
final BinderConfiguration cfg = getViewStateBinderConfiguration(state);
cfg.addBinding(new BinderConfiguration.Binding("rememberMe", null, false));
} else {
createFlowVariable(flow, CasWebflowConstants.VAR_ID_CREDENTIAL, UsernamePasswordCredential.class);
}
}
use of org.springframework.webflow.engine.builder.BinderConfiguration in project cas by apereo.
the class PasswordManagementWebflowConfigurer method configure.
private void configure(final Flow flow, final String id) {
createFlowVariable(flow, FLOW_VAR_ID_PASSWORD, PasswordChangeBean.class);
final BinderConfiguration binder = createStateBinderConfiguration(Arrays.asList(FLOW_VAR_ID_PASSWORD, "confirmedPassword"));
final ViewState viewState = createViewState(flow, id, id, binder);
createStateModelBinding(viewState, FLOW_VAR_ID_PASSWORD, PasswordChangeBean.class);
viewState.getEntryActionList().add(this.passwordChangeAction);
final Transition transition = createTransitionForState(viewState, CasWebflowConstants.TRANSITION_ID_SUBMIT, PASSWORD_CHANGE_ACTION);
transition.getAttributes().put("bind", Boolean.TRUE);
transition.getAttributes().put("validate", Boolean.TRUE);
createStateDefaultTransition(viewState, id);
final ActionState pswChangeAction = createActionState(flow, PASSWORD_CHANGE_ACTION, createEvaluateAction(PASSWORD_CHANGE_ACTION));
pswChangeAction.getTransitionSet().add(createTransition(PasswordChangeAction.PASSWORD_UPDATE_SUCCESS, "casPasswordUpdateSuccess"));
pswChangeAction.getTransitionSet().add(createTransition(CasWebflowConstants.TRANSITION_ID_ERROR, id));
}
use of org.springframework.webflow.engine.builder.BinderConfiguration in project cas by apereo.
the class AbstractCasWebflowConfigurer method createStateBinderConfiguration.
/**
* Create state model bindings.
*
* @param properties the properties
* @return the binder configuration
*/
protected BinderConfiguration createStateBinderConfiguration(final List<String> properties) {
final BinderConfiguration binder = new BinderConfiguration();
properties.forEach(p -> binder.addBinding(new BinderConfiguration.Binding(p, null, true)));
return binder;
}
use of org.springframework.webflow.engine.builder.BinderConfiguration in project cas by apereo.
the class AbstractCasWebflowConfigurer method getViewStateBinderConfiguration.
@Override
public BinderConfiguration getViewStateBinderConfiguration(final ViewState state) {
val field = ReflectionUtils.findField(state.getViewFactory().getClass(), "binderConfiguration");
ReflectionUtils.makeAccessible(field);
return (BinderConfiguration) ReflectionUtils.getField(field, state.getViewFactory());
}
Aggregations