Forums Register Login
Redirection to a basic-authenticated page

Hi all,
I have a servlet that has to redirect to a remote page (another domain, another machine) and this new page is protected under basic authentication (you know, floating window asking for user/pass)...
Well, I´ve no problem to do it, using URLConnection or Apache HttpConnection...
Then I take the response and I write it on the standard servlet output. Now I have the new remote page.

BUT my problem is that (logically) I stay in my servlet context (that means, navigator´s URL is http://mymachine:8080/myservlet ) so every link in the new remote page is not working (because they´re not absolute but relative, as expected).

Then I´m trying to do a kind of sendRedirect(), but I´m not able to put it to work. request.sendRedirect() is not working because the page is asking me again for user & pass.

I need to redirect the page (URL in navigator must be http://remotemachine:8080/whatever....) but having pass authentication.

I´ve tried:
- Ajax connection using a dinamically generated form: Ok for IE, not works in firefox (security reasons)
- Using request.setHeader(): Doesnt´work, I dunno why

¿How can I redirect to a page passing this authentication?

Thank you very much and forgive my bad English...!


Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

This thread has been viewed 1122 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jun 25, 2018 13:43:14.