During the project process, we often encounter such a situation that we need to perform single-point logon, that is, users can log on to a system and other systems at the same time.
Here is an example to illustrate how to implement Single-point logon.
For example, in my project (scott), You need to log on to this project and log on to the same city of 58. To log on to two projects, you must have the usernames and passwords of these two systems.
First, run scott -- login. jsp to verify the logon. If the logon is successful, the logon success page is displayed, and the logon to the same city is also 58. If the logon fails, there is no need to log on to the same city as 58.
After scott -- login. jsp is successfully logged on, go to the index. jsp page, where another jsp file is responsible for 58 local logins. P_58.login.jsp
Assume that some parameters on the logon page in the same city are as follows:
<Body onload = "document. pform. submit ();">
<Form action = "/58/cgi-bin/cognos. cgi" name = "pform">
<Input name = "CAMNamespace" value = "MyCognos" type = "text">
<Input name = "CAMNamespaceDisplayName" value = "MyCognos" type = "text">
<Input name = "B _action" value = "xts. run" type = "text">
<Input name = "m" value = "portal/main. xts" type = "text">
<Input name = "h_CAM_action" value = "logonAs" type = "text">
<Input name = "startwel" value = "yes" type = "text">
<Input name = "encoding" value = "UTF-8" type = "text">
<Input name = "CAMUsername" value = "yourUserName" type = "text">
<Input name = "CAMPassword" value = "yourPassWord" type = "text">
<Input type = "submit" value = "OK">
</Form>
</Body>
In the index. jsp page, we need to load this p_58.login.jsp at the same time.
In this way, single-point logon is realized. It is very simple. There is no need for HttpClient to perform backend operations. Of course, the premise is that the detailed parameters of the login form on this login page are required.
From a450065208