2626import org .springframework .context .ConfigurableApplicationContext ;
2727import org .springframework .webflow .core .collection .MutableAttributeMap ;
2828import org .springframework .webflow .definition .registry .FlowDefinitionRegistry ;
29+ import org .springframework .webflow .engine .ActionList ;
2930import org .springframework .webflow .engine .ActionState ;
3031import org .springframework .webflow .engine .Flow ;
3132import org .springframework .webflow .engine .History ;
@@ -66,13 +67,21 @@ public OsfCasLoginWebflowConfigurer(
6667 super (flowBuilderServices , flowDefinitionRegistry , applicationContext , casProperties );
6768 }
6869
70+ @ Override
71+ protected void createInitialFlowActions (final Flow flow ) {
72+ final ActionList startActionList = flow .getStartActionList ();
73+ startActionList .add (createEvaluateAction (OsfCasWebflowConstants .ACTION_ID_OSF_PRE_INITIAL_FLOW_SETUP ));
74+ super .createInitialFlowActions (flow );
75+ }
76+
6977 @ Override
7078 protected void createDefaultViewStates (final Flow flow ) {
7179 super .createDefaultViewStates (flow );
7280 // Create OSF customized view states
7381 createTwoFactorLoginFormView (flow );
7482 createInstitutionLoginView (flow );
7583 createOrcidLoginAutoRedirectView (flow );
84+ createDefaultServiceLoginAutoRedirectView (flow );
7685 createOsfCasAuthenticationExceptionViewStates (flow );
7786 }
7887
@@ -316,6 +325,11 @@ private void createOsfDefaultLoginCheckAction(final Flow flow) {
316325 OsfCasWebflowConstants .TRANSITION_ID_ORCID_LOGIN_AUTO_REDIRECT ,
317326 OsfCasWebflowConstants .VIEW_ID_ORCID_LOGIN_AUTO_REDIRECT
318327 );
328+ createTransitionForState (
329+ action ,
330+ OsfCasWebflowConstants .TRANSITION_ID_DEFAULT_SERVICE_LOGIN_AUTO_REDIRECT ,
331+ OsfCasWebflowConstants .VIEW_ID_DEFAULT_SERVICE_LOGIN_AUTO_REDIRECT
332+ );
319333 createTransitionForState (
320334 action ,
321335 CasWebflowConstants .TRANSITION_ID_ERROR ,
@@ -426,6 +440,19 @@ protected void createOrcidLoginAutoRedirectView(final Flow flow) {
426440 );
427441 }
428442
443+ /**
444+ * Create the ORCiD login auto-redirect view to support the OSF feature "sign-up via ORCiD".
445+ *
446+ * @param flow the flow
447+ */
448+ protected void createDefaultServiceLoginAutoRedirectView (final Flow flow ) {
449+ createViewState (
450+ flow ,
451+ OsfCasWebflowConstants .VIEW_ID_DEFAULT_SERVICE_LOGIN_AUTO_REDIRECT ,
452+ OsfCasWebflowConstants .VIEW_ID_DEFAULT_SERVICE_LOGIN_AUTO_REDIRECT
453+ );
454+ }
455+
429456 /**
430457 * Create the institution SSO init view state to support the OSF feature "sign-in via institutions".
431458 *
@@ -438,5 +465,4 @@ protected void createInstitutionLoginView(final Flow flow) {
438465 OsfCasWebflowConstants .VIEW_ID_INSTITUTION_SSO_INIT
439466 );
440467 }
441-
442468}
0 commit comments