How to implement Single-point logon in jsp

Source: Internet
Author: User

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
 

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.