Search in sources :

Example 1 with ViewStateModel

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

the class DuoSecurityMultifactorWebflowConfigurer method createDuoRedirectToRegistrationAction.

private static void createDuoRedirectToRegistrationAction(final List<AbstractStateModel> states) {
    val endModel = new ViewStateModel(VIEW_ID_REDIRECT_TO_DUO_REGISTRATION);
    endModel.setView("externalRedirect:#{flowScope.duoRegistrationUrl}");
    states.add(endModel);
}
Also used : lombok.val(lombok.val) ViewStateModel(org.springframework.webflow.engine.model.ViewStateModel)

Example 2 with ViewStateModel

use of org.springframework.webflow.engine.model.ViewStateModel 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 3 with ViewStateModel

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

the class DuoMultifactorWebflowConfigurer method createDuoRedirectToRegistrationAction.

private void createDuoRedirectToRegistrationAction(final List<AbstractStateModel> states) {
    final ViewStateModel endModel = new ViewStateModel("redirectToDuoRegistration");
    endModel.setView("externalRedirect:#{flowScope.duoRegistrationUrl}");
    states.add(endModel);
}
Also used : ViewStateModel(org.springframework.webflow.engine.model.ViewStateModel)

Example 4 with ViewStateModel

use of org.springframework.webflow.engine.model.ViewStateModel 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 5 with ViewStateModel

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

the class DuoSecurityMultifactorWebflowConfigurer method createDuoUniversalPromptLoginViewState.

private static void createDuoUniversalPromptLoginViewState(final ArrayList<AbstractStateModel> states) {
    val viewState = new ViewStateModel(CasWebflowConstants.STATE_ID_VIEW_LOGIN_FORM_DUO);
    val actions = new LinkedList<AbstractActionModel>();
    val action = new EvaluateModel(CasWebflowConstants.ACTION_ID_DUO_UNIVERSAL_PROMPT_PREPARE_LOGIN);
    actions.add(action);
    viewState.setOnEntryActions(actions);
    viewState.setView("externalRedirect:#{flowScope.duoUniversalPromptLoginUrl}");
    states.add(viewState);
}
Also used : lombok.val(lombok.val) ViewStateModel(org.springframework.webflow.engine.model.ViewStateModel) EvaluateModel(org.springframework.webflow.engine.model.EvaluateModel) LinkedList(java.util.LinkedList)

Aggregations

ViewStateModel (org.springframework.webflow.engine.model.ViewStateModel)5 LinkedList (java.util.LinkedList)3 lombok.val (lombok.val)3 EvaluateModel (org.springframework.webflow.engine.model.EvaluateModel)3 BinderModel (org.springframework.webflow.engine.model.BinderModel)2 BindingModel (org.springframework.webflow.engine.model.BindingModel)2 TransitionModel (org.springframework.webflow.engine.model.TransitionModel)2 AbstractActionModel (org.springframework.webflow.engine.model.AbstractActionModel)1