HTTPCLIENT-1748: fix for proxy authentication issue / branch 4.5.x - #52
HTTPCLIENT-1748: fix for proxy authentication issue / branch 4.5.x#52sebastiencaille wants to merge 2 commits into
Conversation
applets (started with firefox)
|
Sebastien |
|
Hello At first I tried to provide the proxy's url, but the applet was always asking for credentials. I just checked the code of the openjdk... It looks like they are doing that, too My guess is that the other parameters are sufficient to define the realm of the auth challenge. That one is probably used to strengthen the security in some use cases (eg to reduce the risks of cross domain calls). By the way, it looks like providing HTTP_TARGET_HOST is sufficient to fix my use case, but strictly speaking it should be the entire request URI (but at the moment I don't know how to get that one)... Sebastien |
|
Sebastien, Adding the request URI to the AuthScope class looks conceptually wrong and should not be done simply because Oracle does it. |
|
Ok, I'll use HTTP_REQUEST my point about the openjdk was just that we need to provide this value, nothing more... As far as I get it, the other option is to add a parameter to CredentialsProvider.getCredentials... Sebastien |
|
I have no problem of what so ever with changing CredentialsProvider in 5.0 if it is justified. |
|
I have a question. Why cannot you build the URL from AuthScope attributes if effectively you only need the authority part (scheme://host:port)? |
|
When the java application is run in an applet environment (and webstart, possibly), The Authenticator delegates the call to a com.sun.deploy.security.DeployAuthenticator . The DeployAuthenticator only works when the url parameter of requestPasswordAuthentication is the url I want to connect to (eg http://www.whatever.com - the jdk provides the full url, it works with the authority part), it does NOT work if the url parameter is the proxy url (http://myproxy:3128) - I guess the authentication is delegated to the browser, which needs this information for security reasons (maybe to prevent cross domain calls). Since the AuthScope only contains information about the proxy, the information needed to call requestPasswordAuthentication the "right" way is currently not available... |
|
Obsoleted by #55. Please close |
Hello,
Here is a pull request for HTTPCLIENT-1748 for httpclient 4.5.x. The first change is the fix, the second one is an improvement.
I also implemented the fix for httpclient5. Should I submit it as a separate pull request, or do you have a specific way to handle such case? (rebase, ...)
Thanks