?
Solved

Create an ASP session from a JSP page

Posted on 2003-04-01
10
Medium Priority
?
438 Views
Last Modified: 2012-06-22
Sounds a bit odd bit here is the scenario:

I have a JSP web app with a login page.  Within this site, there is a page with an <IFRAME> tag that points to an ASP page.  The ASP page requires credentials (via basic authentication) but I don't want the user to be forced to log in again.  The credentials are the same.  I would like to 'invisibly' call the ASP page (or another ASP page written for this purpose?) from the JSP login page once I have the credentials and establish an ASP session so that when the page containing the IFrame is hit, a session will already exist for the user and they will not be prompted.  The user must not know the call to the ASP is being done.  It should be one seamless login to the JSP app from their perspective.

How can this be done?
0
Comment
Question by:craigdawson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 8248198
Use URLConnection like shown here:
http://www.javaworld.com/javatips/jw-javatip34.html
or
http://www.javaworld.com/javaworld/javatips/jw-javatip41.html

And then send the login credentials to an ASP page.  That will receive the credentials and log the user in and create session data for them.

CJ
0
 

Author Comment

by:craigdawson
ID: 8248296
That might work but I can't run Java code on the client.  Applets are off limits for this project. A scripting approach is what I need (I think).
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 8248535
No this code would be in your servlet/jsp

you can http post/get to the asp page in your servlet/jsp code and create the asp session that way.

CJ
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:craigdawson
ID: 8248578
But the browser won't have the session context when it loads the <IFRAME> pointing to the ASP page.  The user will still be prompted to login.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 8248621
the session should be based on a cookie.

so when the browser requests the asp page and sends the session id cookie, the ASP page should identify it.

your code will have to send the session id cookie to the asp page and set it in the response in the servlet/jsp.

CJ
0
 
LVL 14

Expert Comment

by:kennethxu
ID: 8257999
In addition, your jsp and asp server must at least belongs to same domain. and the cookie must be set at domain level. otherwise cookie set by jsp server won't be able to read by asp server.
0
 

Author Comment

by:craigdawson
ID: 8261196
Cheekyci: I can't accept your comment as answer since I never got that to work.  Instead, I did this:

From JSP login, redirect to ASP page sending credentials with URL.  From ASP, redirect back to JSP sending credentials back on query string with password scrambled.  On JSP, rebuild with credentials and submit.  A bit convoluted but it works.
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 8261355
ok. atleast you got it working.

Would you like this questiond to be PAQ'd and your pts refunded?

CJ
0
 
LVL 35

Expert Comment

by:girionis
ID: 10078584
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQed and points NOT refunded.

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
GhostMod earned 0 total points
ID: 10130829
PAQed - no points refunded (of 250)

GhostMod
Community Support Moderator
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question