This is my first post on this forum. I am confused and with no clue while I am posting this query. I am writing an web application in which I have the requirement to redirect to other web application(running on a different server), but the problem is after redirecting I have to login to the other application and go to a specific page in that application(everything without user knowledge) from where uses continues his normal transaction.
Let test1 and test2 are applications. test2 has authentication procedure in it. If user is in test1 application where he clicks a link he has to go to a page in test2 application and after that he can browse the test2 application as if he logged in to the test2 application. Is this possible.
I looked at the requestdispatcher class but I think it is for redirecting in same application. response.redirect() is just forwarding to a page. I cant put authetication credentails in it. Any help is appreciated.
Thanks for the reply.. Yes, I have the ability(but with giving appropriate user credentials..) to alter the application running on the other server.just to reiterate What I need is a functionality like send.Redirect() and then setting the session values needed for the redirected page so that from there the user can continue.Any kind of suggestions are appreciated...
Well, if you have know how the authentication works in the Test2 application then it is fairly straight forward.
You said there is a link in the application1 which takes you to the application2. Then you can try either of the below mentioned ways
2. Else assign the application2 url to the href of the link and append the login credentials to it. For example
Although second bullet is a way to do it, its not at all secure as you will be exposing the credetential in the link.
I hope this might help you.
Joined: May 23, 2008
Thank you for the help.. I think it will work for single page and with basic authentication.. but what I need to do is I have to login to the server then I have to go to the required page. I googled for this, but I wasn't able to get the information. I believe some thing similar to the webRequest in .NET (screenscrapper) will suffice the requirement..please correct me If I am wrong
The authentication type I wish to use is digest authentication..so I need to encrypt the username and password and then login and then go to the required page..Is it possible..