spring-attic / spring-social

Allows you to connect your applications with SaaS providers such as Facebook and Twitter.
http://projects.spring.io/spring-social
Apache License 2.0
619 stars 351 forks source link

Proxy User Authentication based on http.proxyUser #177

Closed ricardozanini closed 8 years ago

ricardozanini commented 9 years ago

Working behind a proxy that requires user authentication was causing connection error (407) between local and the service server requests.

When the http.proxyUser system property is available and using Apache HttpClient, just add the user credentials (http.proxyUser and http.proxyPassword) to the proxy scope.

Implementation based on Apache HttpClient official documentation that worked on my environment. The Unit Tests were ignored, so I leave it as is.

Windows Servers requires NTLM Authentication and the API doesn't support it. Despite the WARN message bellow, the connection was completed successfully.

WARN org.apache.http.impl.auth.HttpAuthenticator- NTLM authentication error: Credentials cannot be used for NTLM authentication: org.apache.http.auth.UsernamePasswordCredentials

Reference: http://stackoverflow.com/questions/6962047/apache-httpclient-4-1-proxy-authentication