MiguelAngelVega / openid4java

Automatically exported from code.google.com/p/openid4java
Apache License 2.0
0 stars 0 forks source link

org.openid4java.util.HttpClientFactory should exclude NTLM authentication policy from HTTP client schemes list #144

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. On non-windows system (Linux, etc.) that has to connect to windows HTTP 
proxy, NTLM is the preferred authentication policy selected by HTTP client
2. There is no handling of domain for NTLM authentication in 
org.openid4java.util.HttpClientFactory even though the value can be set on 
org.openid4java.util.ProxyProperties. Furthermore, host information is not 
accounted for at all.
3. As a result following stack trace is triggered:

What is the expected output? What do you see instead?
The expected output is successful connection. Instead the exception is thrown
org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials 
cannot be used for NTLM authentication: 
org.apache.commons.httpclient.UsernamePasswordCredentials
        at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme.java:332)
        at org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(HttpMethodDirector.java:320)
        at org.apache.commons.httpclient.HttpMethodDirector.executeConnect(HttpMethodDirector.java:491)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:391)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.openid4java.util.HttpCache.head(HttpCache.java:296)
        at org.openid4java.discovery.yadis.YadisResolver.retrieveXrdsLocation(YadisResolver.java:360)

What version of the product are you using? On what operating system?
0.9.5.593

Please provide any additional information below.
Attached proposed fix

Original issue reported on code.google.com by ishai...@gmail.com on 4 Feb 2011 at 8:36

Attachments: