All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jasig.cas.web.flow.SpengoWebflowConfigurer Maven / Gradle / Ivy

There is a newer version: 4.2.7
Show newest version
package org.jasig.cas.web.flow;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.webflow.engine.ActionState;
import org.springframework.webflow.engine.Flow;

/**
 * The {@link SpengoWebflowConfigurer} is responsible for
 * adjusting the CAS webflow context for spnego integration.
 *
 * @author Misagh Moayyed
 * @since 4.2
 */
@Component("spnegoWebflowConfigurer")
public class SpengoWebflowConfigurer extends AbstractCasWebflowConfigurer {

    @Value("${cas.spnego.hostname.client.action.strategy:hostnameSpnegoClientAction}")
    private String hostNameClientActionStrategy;

    @Override
    protected void doInitialize() throws Exception {
        final Flow flow = getLoginFlow();
        final ActionState actionState = createActionState(flow, "startSpnegoAuthenticate",
                createEvaluateAction("negociateSpnego"));
        actionState.getTransitionSet().add(createTransition(TRANSITION_ID_SUCCESS, "spnego"));
        actionState.getTransitionSet().add(createTransition(TRANSITION_ID_ERROR, STATE_ID_VIEW_LOGIN_FORM));

        final ActionState spnego = createActionState(flow, "spnego", createEvaluateAction("spnego"));
        spnego.getTransitionSet().add(createTransition(TRANSITION_ID_SUCCESS, TRANSITION_ID_SEND_TICKET_GRANTING_TICKET));
        spnego.getTransitionSet().add(createTransition(TRANSITION_ID_ERROR,
                STATE_ID_VIEW_LOGIN_FORM));

        final ActionState evaluateClientRequest = createActionState(flow, "evaluateClientRequest",
                createEvaluateAction(hostNameClientActionStrategy));
        evaluateClientRequest.getTransitionSet().add(createTransition(TRANSITION_ID_YES, "startSpnegoAuthenticate"));
        evaluateClientRequest.getTransitionSet().add(createTransition(TRANSITION_ID_NO, getStartState(flow)));

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy