@Override
    protected void doInitialize() {
        val flow = getLoginFlow();
        if (flow != null) {
            val actionState = createActionState(flow, CasWebflowConstants.STATE_ID_X509_START,
                CasWebflowConstants.ACTION_ID_X509_CHECK);
            val transitionSet = actionState.getTransitionSet();

            val targetStates = getTargetStates(flow);

            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS,
                CasWebflowConstants.STATE_ID_CREATE_TICKET_GRANTING_TICKET));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_WARN,
                CasWebflowConstants.TRANSITION_ID_WARN));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_ERROR, getStateIdOnX509Failure(flow, targetStates)));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_AUTHENTICATION_FAILURE,
                CasWebflowConstants.STATE_ID_HANDLE_AUTHN_FAILURE));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS_WITH_WARNINGS,
                CasWebflowConstants.STATE_ID_SHOW_AUTHN_WARNING_MSGS));

            actionState.getExitActionList().add(createEvaluateAction(CasWebflowConstants.ACTION_ID_CLEAR_WEBFLOW_CREDENTIALS));

            val initState = getState(flow, targetStates.getLeft(), ActionState.class);
            createTransitionForState(initState, targetStates.getRight(), CasWebflowConstants.STATE_ID_X509_START, true);
        }
    }
The {@link X509WebflowConfigurer} is responsible for
adjusting the CAS webflow context for x509 integration.
<p>
Creates a flow that starts by trying to construct credentials using an X509
certificate found as request attribute with key {@code jakarta.servlet.request.X509Certificate}
{@link X509CertificateCredentialsNonInteractiveAction}.
If the check of the certificate is valid, flow goes to sendTicketGrantingTicket.
On error or authenticationFailure, the user is sent to the login page.
The authenticationFailure outcome can happen when CAS got a valid certificate but
couldn't find entry for the certificate in an attribute repository.
<p>
Credentials are cleared out at the end of the action in case the user
is sent to the login page where the X509 credentials object will cause
errors (e.g. no username property)

@author Misagh Moayyed
@since 4.2
support/cas-server-support-x509-webflow/src/main/java/org/apereo/cas/web/flow/X509WebflowConfigurer.java