I have two SharePoint applications in the same farm.

The 1st is using classic windows authentication with Ntlm provider.

The 2nd is using claims authentication, with only the Windows authentication provider (Ntlm too).

We are also building a java application (actually a liferay plugin, but that's out of scope). This application has to grab content from the SharePoint application.

This is working for the first application, but not for the second (the one with claims).

So my question is: when using Claims authentication, with Ntlm authentication provider, what are the prerequisites of any consuming application?

  • Did you find out how to authenticate with claims and attach the token to your requests? – surlac Oct 3 '12 at 12:20
  • 1
    @surlac: check my answer below. This make my java colleagues to be able to call the SharePoint Web Services with no troubles. – Steve B Oct 4 '12 at 9:01

We finally found a solution, that consisted in changing the client library.

We especially use the component described here : Support for NTLMv2 with Apache HttpClient using JCIFS.

A sample code we used:

QueryServiceStub queryServiceStub = new QueryServiceStub("SHARE_POINT_ASMX_URL");
List authPrefs = new ArrayList(1);
AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, JCIFS_NTLMScheme.class);
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
List<String> authScheme = new ArrayList<String>();
queryServiceStub._getServiceClient().getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "true");
queryServiceStub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTHENTICATE, auth);
List<Header> headers = new ArrayList<Header>();
Header header = new Header();
queryServiceStub._getServiceClient().getOptions().setProperty(HTTPConstants.HTTP_HEADERS, headers);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.