Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
4.5.1
-
None
-
None
Description
Hi all,
when configuring the credentials via system properties.
-Dhttp.proxyHost=TheUrlToTheNtmlProxy -Dhttp.proxyPort=8080 -Dhttp.proxyUser=TheUsersName -Dhttp.proxyPassword=TheUsersPassword -Dhttp.auth.ntlm.domain=TheDomain
they never get read...
Following code block seem wrong to me:
SystemDefaultCredentialsProvider:
@Override public Credentials getCredentials(final AuthScope authscope) { Args.notNull(authscope, "Auth scope"); final Credentials localcreds = internal.getCredentials(authscope); if (localcreds != null) { return localcreds; } if (authscope.getHost() != null) { PasswordAuthentication systemcreds = getSystemCreds( authscope, Authenticator.RequestorType.SERVER); if (systemcreds == null) { systemcreds = getSystemCreds( authscope, Authenticator.RequestorType.PROXY); } //*** systemcreds is always null *** if (systemcreds != null) { final String domain = System.getProperty("http.auth.ntlm.domain"); if (domain != null) { return new NTCredentials( systemcreds.getUserName(), new String(systemcreds.getPassword()), null, domain); } else { if (AuthSchemes.NTLM.equalsIgnoreCase(authscope.getScheme())) { // Domian may be specified in a fully qualified user name return new NTCredentials( systemcreds.getUserName(), new String(systemcreds.getPassword()), null, null); } else { return new UsernamePasswordCredentials( systemcreds.getUserName(), new String(systemcreds.getPassword())); } } } } return null; }
systemcreds is always null, because the Authenticator.requestPasswordAuthentication() returns null, when no system wide authenticator was set, by setDefault(...).
So, the question is, or maybe the bug... why is it possible to fully configure the NTLM credentials, but no authenticator is available, and due to that a programmatic way is always necessary to get NTLM auth working.
The benefit of configuring (no programming) via system properties is lost.
kind regards
Patrick