docs: protected void registerMultifactorTrustedAuthentication(final FlowDefinitionRegistry flowDefinitionRegistry) {
          validateFlowDefinitionConfiguration(flowDefinitionRegistry);
  
          LOGGER.debug("Flow definitions found in the registry are [{}]", (Object[]) flowDefinitionRegistry.getFlowDefinitionIds());
          val flowId = Arrays.stream(flowDefinitionRegistry.getFlowDefinitionIds()).findFirst().get();
          LOGGER.debug("Processing flow definition [{}]", flowId);
  
          val flow = (Flow) flowDefinitionRegistry.getFlowDefinition(flowId);
  
          val state = getState(flow, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM, ActionState.class);
          val transition = (Transition) state.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS);
          val targetStateId = transition.getTargetStateId();
          transition.setTargetStateResolver(new DefaultTargetStateResolver(CasWebflowConstants.STATE_ID_VERIFY_TRUSTED_DEVICE));
          val verifyAction = createActionState(flow,
              CasWebflowConstants.STATE_ID_VERIFY_TRUSTED_DEVICE,
              createEvaluateAction(MFA_VERIFY_TRUST_ACTION_BEAN_ID));
  
          if (enableDeviceRegistration) {
              createTransitionForState(verifyAction, CasWebflowConstants.TRANSITION_ID_YES, CasWebflowConstants.STATE_ID_FINISH_MFA_TRUSTED_AUTH);
          } else {
              createTransitionForState(verifyAction, CasWebflowConstants.TRANSITION_ID_YES, CasWebflowConstants.STATE_ID_REAL_SUBMIT);
          }
          createTransitionForState(verifyAction, CasWebflowConstants.TRANSITION_ID_NO, targetStateId);
  
          createDecisionState(flow, CasWebflowConstants.DECISION_STATE_REQUIRE_REGISTRATION,
              isDeviceRegistrationRequired(),
              CasWebflowConstants.VIEW_ID_REGISTER_DEVICE, CasWebflowConstants.STATE_ID_REAL_SUBMIT);
  
          val submit = getState(flow, CasWebflowConstants.STATE_ID_REAL_SUBMIT, ActionState.class);
          val success = (Transition) submit.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS);
          if (enableDeviceRegistration) {
              success.setTargetStateResolver(new DefaultTargetStateResolver(CasWebflowConstants.VIEW_ID_REGISTER_DEVICE));
          } else {
              success.setTargetStateResolver(new DefaultTargetStateResolver(CasWebflowConstants.STATE_ID_REGISTER_TRUSTED_DEVICE));
          }
          val viewRegister = createViewState(flow, CasWebflowConstants.VIEW_ID_REGISTER_DEVICE, "casMfaRegisterDeviceView");
          val viewRegisterTransition = createTransition(CasWebflowConstants.TRANSITION_ID_SUBMIT,
              CasWebflowConstants.STATE_ID_REGISTER_TRUSTED_DEVICE);
          viewRegister.getTransitionSet().add(viewRegisterTransition);
  
          val registerAction = createActionState(flow,
              CasWebflowConstants.STATE_ID_REGISTER_TRUSTED_DEVICE, createEvaluateAction(MFA_SET_TRUST_ACTION_BEAN_ID));
          createStateDefaultTransition(registerAction, CasWebflowConstants.STATE_ID_SUCCESS);
  
          if (submit.getActionList().size() == 0) {
              throw new IllegalArgumentException("There are no actions defined for the final submission event of " + flowId);
          }
          val act = submit.getActionList().iterator().next();
          val finishMfaTrustedAuth = createActionState(flow, CasWebflowConstants.STATE_ID_FINISH_MFA_TRUSTED_AUTH, act);
          val finishedTransition = createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS, CasWebflowConstants.STATE_ID_SUCCESS);
          finishMfaTrustedAuth.getTransitionSet().add(finishedTransition);
          createStateDefaultTransition(finishMfaTrustedAuth, CasWebflowConstants.STATE_ID_SUCCESS);
      }