What is the windows system setting to use the primitive NTLM authentication supported by Apache Http Client?
We are using Apache Axis client to communicate to a report server. The Apache Client uses Apache Http Client for NTLM authentication. Based on the below post
How can I get jcifs to play nicely with apache axis
it looks like it only supports the primitive NTLM. One of our machines is set to work with the recent NTLM authen开发者_如何学Pythontication.
I want to know where is this setting where I can reset to use the primitive NTLM authentication supported by Apache Http Client.
HttpClient doesnt support NTLM v2 hence I use JCIFS library to return NTLM v1,2,3 message type as described in this website
http://devsac.blogspot.com/2010/10/supoprt-for-ntlmv2-with-apache.html
I just used the JCIFS_NTLMScheme.java file from the above website to register the auth scheme and it worked !!!!
Sample client:
List authSchema = new ArrayList();
AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, org.tempuri.JCIFS_NTLMScheme.class);
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
auth.setUsername("");
auth.setPassword("");
auth.setDomain("");
auth.setHost("");
auth.setPort();
List authPrefs = new ArrayList(1);
authPrefs.add(AuthPolicy.NTLM);
auth.setAuthSchemes(authPrefs);
stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE, auth);
精彩评论