Search in sources :

Example 11 with TransitionModel

use of org.springframework.webflow.engine.model.TransitionModel in project cas by apereo.

the class DuoMultifactorWebflowConfigurer method createDuoLoginViewState.

private void createDuoLoginViewState(final List<AbstractStateModel> states) {
    final ViewStateModel viewState = new ViewStateModel(STATE_ID_VIEW_LOGIN_FORM_DUO);
    viewState.setView("casDuoLoginView");
    viewState.setModel(CasWebflowConstants.VAR_ID_CREDENTIAL);
    final BinderModel bm = new BinderModel();
    final LinkedList<BindingModel> bindings = new LinkedList<>();
    final BindingModel bme = new BindingModel("signedDuoResponse", null, null);
    bindings.add(bme);
    bm.setBindings(bindings);
    viewState.setBinder(bm);
    final LinkedList<AbstractActionModel> actions = new LinkedList<>();
    actions.add(new EvaluateModel("prepareDuoWebLoginFormAction"));
    viewState.setOnEntryActions(actions);
    final LinkedList<TransitionModel> trans = new LinkedList<>();
    final TransitionModel transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUBMIT);
    transModel.setTo(CasWebflowConstants.STATE_ID_REAL_SUBMIT);
    transModel.setBind(Boolean.TRUE.toString());
    transModel.setValidate(Boolean.FALSE.toString());
    trans.add(transModel);
    viewState.setTransitions(trans);
    states.add(viewState);
}
Also used : BindingModel(org.springframework.webflow.engine.model.BindingModel) TransitionModel(org.springframework.webflow.engine.model.TransitionModel) AbstractActionModel(org.springframework.webflow.engine.model.AbstractActionModel) ViewStateModel(org.springframework.webflow.engine.model.ViewStateModel) EvaluateModel(org.springframework.webflow.engine.model.EvaluateModel) BinderModel(org.springframework.webflow.engine.model.BinderModel) LinkedList(java.util.LinkedList)

Example 12 with TransitionModel

use of org.springframework.webflow.engine.model.TransitionModel in project cas by apereo.

the class DuoSecurityMultifactorWebflowConfigurer method createDuoFinalizeAuthenticationAction.

private static void createDuoFinalizeAuthenticationAction(final List<AbstractStateModel> states) {
    val actModel = new ActionStateModel(CasWebflowConstants.STATE_ID_FINALIZE_AUTHENTICATION);
    val actions = new LinkedList<AbstractActionModel>();
    actions.add(new EvaluateModel(CasWebflowConstants.ACTION_ID_DUO_AUTHENTICATION_WEBFLOW));
    actModel.setActions(actions);
    val trans = new LinkedList<TransitionModel>();
    val transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS);
    transModel.setTo(CasWebflowConstants.STATE_ID_SUCCESS);
    trans.add(transModel);
    actModel.setTransitions(trans);
    states.add(actModel);
}
Also used : lombok.val(lombok.val) ActionStateModel(org.springframework.webflow.engine.model.ActionStateModel) TransitionModel(org.springframework.webflow.engine.model.TransitionModel) EvaluateModel(org.springframework.webflow.engine.model.EvaluateModel) LinkedList(java.util.LinkedList)

Example 13 with TransitionModel

use of org.springframework.webflow.engine.model.TransitionModel in project cas by apereo.

the class DuoSecurityMultifactorWebflowConfigurer method createDuoInitializeLoginAction.

private static LinkedList<AbstractActionModel> createDuoInitializeLoginAction(final List<AbstractStateModel> states) {
    val actModel = new ActionStateModel(CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM);
    val actions = new LinkedList<AbstractActionModel>();
    actions.add(new EvaluateModel(CasWebflowConstants.ACTION_ID_INIT_LOGIN_ACTION));
    actModel.setActions(actions);
    val trans = new LinkedList<TransitionModel>();
    val transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS);
    transModel.setTo(CasWebflowConstants.STATE_ID_DETERMINE_DUO_USER_ACCOUNT);
    trans.add(transModel);
    actModel.setTransitions(trans);
    states.add(actModel);
    return actions;
}
Also used : lombok.val(lombok.val) ActionStateModel(org.springframework.webflow.engine.model.ActionStateModel) TransitionModel(org.springframework.webflow.engine.model.TransitionModel) EvaluateModel(org.springframework.webflow.engine.model.EvaluateModel) LinkedList(java.util.LinkedList)

Example 14 with TransitionModel

use of org.springframework.webflow.engine.model.TransitionModel in project cas by apereo.

the class DuoSecurityMultifactorWebflowConfigurer method createDuoDoNonWebAuthenticationAction.

private static void createDuoDoNonWebAuthenticationAction(final List<AbstractStateModel> states) {
    val actModel = new ActionStateModel(CasWebflowConstants.STATE_ID_DUO_NON_WEB_AUTHENTICATION);
    val actions = new LinkedList<AbstractActionModel>();
    actions.add(new EvaluateModel(CasWebflowConstants.ACTION_ID_DUO_NON_WEB_AUTHENTICATION));
    actModel.setActions(actions);
    val trans = new LinkedList<TransitionModel>();
    val transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS);
    transModel.setTo(CasWebflowConstants.STATE_ID_FINALIZE_AUTHENTICATION);
    trans.add(transModel);
    actModel.setTransitions(trans);
    states.add(actModel);
}
Also used : lombok.val(lombok.val) ActionStateModel(org.springframework.webflow.engine.model.ActionStateModel) TransitionModel(org.springframework.webflow.engine.model.TransitionModel) EvaluateModel(org.springframework.webflow.engine.model.EvaluateModel) LinkedList(java.util.LinkedList)

Aggregations

LinkedList (java.util.LinkedList)14 EvaluateModel (org.springframework.webflow.engine.model.EvaluateModel)14 TransitionModel (org.springframework.webflow.engine.model.TransitionModel)14 ActionStateModel (org.springframework.webflow.engine.model.ActionStateModel)12 lombok.val (lombok.val)7 AbstractActionModel (org.springframework.webflow.engine.model.AbstractActionModel)7 BinderModel (org.springframework.webflow.engine.model.BinderModel)2 BindingModel (org.springframework.webflow.engine.model.BindingModel)2 ViewStateModel (org.springframework.webflow.engine.model.ViewStateModel)2