Detailed process of login-webflow on cas Server

Source: Internet
Author: User

Login-webflow is when you enter a https://uia.comsys.net.cn/login in your browser? Param_list

Then, how does the CAS server handle the issue.

It is actually a spring-webflow application.

For more information about spring-webflow,

I won't be jealous if the Internet is overwhelming

The Web. xml file on the CAS server contains

 

 

  < 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 the entry servlet of login-webflow. One of the mapped URL-pattern is

 

< Servlet-Mapping >
< Servlet-name > CAS </ Servlet-name >
< URL-Pattern > /Login </ URL-Pattern >
  </ Servlet-Mapping >

Login

Spring webflow must be registered in 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 >  

 

The login-webflow.xml was registered.

What about

The corresponding view properties are specified in propertyfileconfigurer. xml.

 

< Bean ID = "Propertyplaceholderpolicer" 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

 

Corresponding to default. Properties

Default_views.properties

The corresponding css js and JSP paths are put in these two properties. You must pay attention to them.

OK. These are the basic configurations,

Below we focus on the login-webflow.xml

There is a specific spring webflow process.

The involved nodes start the on-START process.

End-state process end demo-state judgment, similar to if

View-State corresponds to JSP page action-state corresponding to executionProgramA segment

The <evaluate expression = "initialflowsetupaction"/> definitions in

The view definition in view-state is in default_views.properties.

The following is a brief description of the statements.

< Evaluate Expression = "Initialflowsetupaction"   />

This sentence means execution

Doexecute method in org. JASIG. Cas. Web. flow. initialflowsetupaction

All the variables are injected by spring.

For more information, see the corresponding configuration file.

Then the next process is

< Demo--state ID = "Ticketgrantingticketexistscheck" >
< If Test = "Flowscope. ticketgrantingticketid NEQ null" Then = "Hasservicecheck" Else = "Gatewayrequestcheck"   />
  </ Demo--state >

 

Determine

Flowscope. ticketgrantingticketid

In org. JASIG. Cas. Web. flow. initialflowsetupaction

Context. getflowscope (). Put (
"Ticketgrantingticketid", this. ticketgrantingticketcookiegenerator. retrievecookievalue (request ));

 

This sentence is put in, and then we will check here that NEQ null is not null.

Then else is easy to understand

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 >

Corresponding to casloginview. jsp

Some page variables and corresponding Java classes are bound here

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. Here, execute org. JASIG. Cas. Web. flow. authenticationviaformaction

Submit method, and return values to different branches

It is not easy to figure this one out. We suggest you read more relevant information,

There are still a lot of things in it.

 

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.