问题
I have an asp.net site which uses the same database as another JSP site. The JSP site does some reporting and asp site is used for data entry. What I need is once a user is logged in to asp.net site and clicks on one of those common id's, I want to take them to the jsp site to show the report without having them to sign in again. The username and password for the jsp site is exactly the same as asp since they use the same user table. The JSP site is 3-4 years old and I am not at all experienced in it. So if anyone can help me out here.
Here is the Response Header and Request Header for the login into JSP site:
**Response Headers**
Content-Length 0
Content-Type text/html
Date Wed, 05 Dec 2012 15:20:49 GMT
Location http://www.something.something.htm?action=0
Server Apache-Coyote/1.1
Request Headersview source
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cookie JSESSIONID=523454ADB2B7C19D29BD68DB55D30146
Host www.something.something.com
Proxy-Connection keep-alive
Referer http://www.something.login.htm
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20100101 Firefox/16.0
Request Headers From Upload Stream
Content-Length 41
Content-Type application/x-www-form-urlencoded
Request Header contains only username and password with mode=0.
Thanks.
回答1:
When someone clicks on the link for jsp site... I would send user to an intermediare page... Which has a form with user name and password as hidden field. Set the action of the form to jsp's form(which is used for login). And auto submit form using javascript.
来源:https://stackoverflow.com/questions/13710425/transferring-authentication-from-asp-site-to-jsp