@Override
    protected Event doExecuteInternal(final RequestContext context) {
        val credential = WebUtils.getCredential(context, Credential.class);
        if (credential instanceof final MutableCredential mc) {
            val surrogateRequest = surrogateCredentialParser.parse(mc);
            surrogateRequest.ifPresentOrElse(payload -> addSurrogateInformation(context, payload),
                () -> removeSurrogateInformation(context, Objects.requireNonNull(mc)));
        }
        return null;
    }
This is {@link SurrogateInitialAuthenticationAction}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-surrogate-webflow/src/main/java/org/apereo/cas/web/flow/action/SurrogateInitialAuthenticationAction.java