Search in sources :

Example 6 with TransitionModel

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

the class DuoSecurityMultifactorWebflowConfigurer method createDuoLoginViewState.

private static void createDuoLoginViewState(final List<AbstractStateModel> states) {
    val viewState = new ViewStateModel(CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM_DUO);
    viewState.setView("duo-security/casDuoLoginView");
    viewState.setModel(CasWebflowConstants.VAR_ID_CREDENTIAL);
    val bm = new BinderModel();
    val bindings = new LinkedList<BindingModel>();
    val bme = new BindingModel("signedDuoResponse", null, null);
    bindings.add(bme);
    bm.setBindings(bindings);
    viewState.setBinder(bm);
    val actions = new LinkedList<AbstractActionModel>();
    actions.add(new EvaluateModel(CasWebflowConstants.ACTION_ID_PREPARE_DUO_WEB_LOGIN_FORM));
    viewState.setOnEntryActions(actions);
    val trans = new LinkedList<TransitionModel>();
    val 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 : lombok.val(lombok.val) BindingModel(org.springframework.webflow.engine.model.BindingModel) TransitionModel(org.springframework.webflow.engine.model.TransitionModel) 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 7 with TransitionModel

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

the class DuoSecurityMultifactorWebflowConfigurer method createDuoAuthenticationWebflowAction.

private static void createDuoAuthenticationWebflowAction(final List<AbstractStateModel> states) {
    val actModel = new ActionStateModel(CasWebflowConstants.STATE_ID_REAL_SUBMIT);
    val actions = new LinkedList<AbstractActionModel>();
    actions.add(new EvaluateModel(CasWebflowConstants.ACTION_ID_DUO_AUTHENTICATION_WEBFLOW));
    actModel.setActions(actions);
    val trans = new LinkedList<TransitionModel>();
    var transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS);
    transModel.setTo(CasWebflowConstants.STATE_ID_SUCCESS);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_ERROR);
    transModel.setTo(CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_DENY);
    transModel.setTo(CasWebflowConstants.STATE_ID_MFA_DENIED);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_UNAVAILABLE);
    transModel.setTo(CasWebflowConstants.STATE_ID_MFA_UNAVAILABLE);
    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 8 with TransitionModel

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

the class DuoSecurityMultifactorWebflowConfigurer method createDuoDetermineUserAccountAction.

private static void createDuoDetermineUserAccountAction(final List<AbstractStateModel> states) {
    val actModel = new ActionStateModel(CasWebflowConstants.STATE_ID_MFA_PRE_AUTH);
    val actions = new LinkedList<AbstractActionModel>();
    actions.add(new EvaluateModel(CasWebflowConstants.ACTION_ID_DETERMINE_DUO_USER_ACCOUNT));
    actModel.setActions(actions);
    val trans = new LinkedList<TransitionModel>();
    var transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS);
    transModel.setTo(CasWebflowConstants.STATE_ID_DETERMINE_DUO_REQUEST);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_ENROLL);
    transModel.setTo(VIEW_ID_REDIRECT_TO_DUO_REGISTRATION);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_BYPASS);
    transModel.setTo(CasWebflowConstants.STATE_ID_MFA_CHECK_BYPASS);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_UNAVAILABLE);
    transModel.setTo(CasWebflowConstants.STATE_ID_MFA_FAILURE);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_DENY);
    transModel.setTo(CasWebflowConstants.STATE_ID_MFA_DENIED);
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_ERROR);
    transModel.setTo(CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM);
    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 9 with TransitionModel

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

the class DuoMultifactorWebflowConfigurer method createDuoFinalizeAuthenticationAction.

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

Example 10 with TransitionModel

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

the class DuoMultifactorWebflowConfigurer method createDuoDetermineUserAccountAction.

private void createDuoDetermineUserAccountAction(final List<AbstractStateModel> states) {
    final ActionStateModel actModel = new ActionStateModel("determineDuoUserAccount");
    final LinkedList<AbstractActionModel> actions = new LinkedList<>();
    actions.add(new EvaluateModel("determineDuoUserAccountAction"));
    actModel.setActions(actions);
    final LinkedList<TransitionModel> trans = new LinkedList<>();
    TransitionModel transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_SUCCESS);
    transModel.setTo("determineDuoRequest");
    trans.add(transModel);
    transModel = new TransitionModel();
    transModel.setOn(CasWebflowConstants.TRANSITION_ID_ENROLL);
    transModel.setTo("redirectToDuoRegistration");
    trans.add(transModel);
    actModel.setTransitions(trans);
    states.add(actModel);
}
Also used : ActionStateModel(org.springframework.webflow.engine.model.ActionStateModel) TransitionModel(org.springframework.webflow.engine.model.TransitionModel) AbstractActionModel(org.springframework.webflow.engine.model.AbstractActionModel) 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