Very difficult question regarding jsp, http and authentication.
Posted on 2002-07-02
I am wondering how to accomplish the following scenario:
Server A hosts jsp-page A.jsp.
A.jsp contains a link to B.html at server B.
The web-server at B is using HTTP
basic authentication to protect B.html from unauthorized
My problem is that a.jsp knows the credentials for B.html
but I just can't find a way to supply the credentials to the web-server at B and then access B.html.
And I have tried several ways to do this.
For example, I have tried to implement a http-socket
client in A.jsp that authenticates with the web-server at B, this works of course, but then only the web-server at A gets authenticated and not the client who will actually display A.jsp.
Another way is to retrieve the html-code for B.html through a similar http-socket connection in A.jsp but this will not solve relative links in B.html and the same problem occurs if B.html contains links to other resources at B that are also protected.
The whole idea is to avoid the login-operation by knowing the credentials in advance.
Can this be done in any way?
I think not.
I am very grateful for your help!
Best regards Mathias