Login-webflow detailed process for CAS server side

Source: Internet
Author: User
Tags cas

Login-webflow is when you enter https://uia.comsys.net.cn/login?param_list in the browser

After that, the CAS server side handles how.

It's actually a spring-webflow application.

For a detailed introduction to Spring-webflow,

The internet is overwhelming and I'm not going to nag.

The Web. xml file on the CAS server side has

<servlet>
<servlet-name>cas</servlet-name>
<servlet-class>
Org.jasig.cas.web.init.SafeDispatcherServlet
</servlet-class>
<init-param>
<param-name>publishContext</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

This is Login-webflow's entry servlet, one of the url-pattern of the map



<servlet-mapping>
<servlet-name>cas</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>

That is login

Spring Webflow must be registered inside the Flow-registry,

This is registered in Cas-servlet.xml.

<webflow:flow-registry id= "flowregistry" flow-builder-services= "Builder" >
<webflow:flow-location path= "/web-inf/login-webflow.xml" id= "Login"/>
</webflow:flow-registry>

This sentence login-webflow.xml the register.

And what?

The corresponding view properties are specified in the Propertyfileconfigurer.xml

<bean id= "Propertyplaceholderconfigurer" class= " Org.springframework.beans.factory.config.PropertyPlaceholderConfigurer "
p:location= "/web-inf/cas.properties"/>

Open Cas.properties



Cas.themeresolver.defaultthemename=default
Cas.viewresolver.basename=default_views

Corresponds to the Default.properties

Default_views.properties

These two properties put the corresponding CSS JS and JSP path, we must pay attention to.

OK, the basic configuration is these,

Let's focus on the next login-webflow.xml.

Inside is a concrete spring webflow process

The nodes involved have the On-start process started.

End-state process End decision-state judgment, similar to if

View-state corresponding JSP page action-state corresponding to a segment of the execution program

Inside the <evaluate expression= "initialflowsetupaction"/> These definitions in Cas-servlet.xml

The view inside the view-state is defined in the Default_views.properties

Below is a brief description of the statement below

<evaluate expression= "Initialflowsetupaction"/>

The meaning of this sentence is to execute

The Doexecute method in Org.jasig.cas.web.flow.InitialFlowSetupAction

The variables are injected by spring.

See the corresponding configuration file

Then the next process is

<decision-state id= "Ticketgrantingticketexistscheck" >
<if test= "Flowscope.ticketgrantingticketid neq null" then= "Hasservicecheck" else= "Gatewayrequestcheck"/>
</decision-state>

To judge

Flowscope.ticketgrantingticketid

This is in org.jasig.cas.web.flow.InitialFlowSetupAction by

Context.getflowscope (). Put (
"Ticketgrantingticketid", This.ticketGrantingTicketCookieGenerator.retrieveCookieValue (Request));

This sentence is put in, and then tested here NEQ NULL is not null meaning

Then else is well understood

View state

<view-state id= "Viewloginform" view= "Casloginview" model= "Credentials" >
<var name= "Credentials" class= "Org.jasig.cas.authentication.principal.UsernamePasswordCredentials"/>
<binder>
<binding property= "username"/>
<binding property= "Password"/>
</binder>
<on-entry>
<set name= "Viewscope.commandname" value= "' credentials '"/>
</on-entry>
<transition on= "Submit" bind= "true" validate= "true" to= "Realsubmit" >
<set name= "Flowscope.credentials" value= "credentials"/>
<evaluate expression= "Authenticationviaformaction.dobind (Flowrequestcontext, flowScope.credentials)"/>
</transition>
</view-state>

It corresponds to the casloginview.jsp.

In this case, some page variables and corresponding Java classes are bound

Action State

<action-state id= "Realsubmit" >
<evaluate expression= "Authenticationviaformaction.submit (Flowrequestcontext, FlowScope.credentials, Messagecontext) "/>
<transition on= "warn" to= "warn"/>
<transition on= "Success" to= "Sendticketgrantingticket"/>
<transition on= "error" to= "Viewloginform"/>
</action-state>

Execute the corresponding method, which executes the org.jasig.cas.web.flow.AuthenticationViaFormAction in the

Submit method, and depending on the return value to the different branches

It's not easy to figure this piece out, so it's recommended to look at the relevant information

There are still a lot of daoteng inside.

Transferred from: http://www.cnblogs.com/jifeng/archive/2011/08/07/2129988.html

Login-webflow detailed process for CAS server side

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.