Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
    
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

1 Answer 1

up vote 1 down vote accepted

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);
authPrefs.add(AuthPolicy.NTLM);
AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, JCIFS_NTLMScheme.class);
HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator();
List<String> authScheme = new ArrayList<String>();
authScheme.add(HttpTransportProperties.Authenticator.NTLM);
auth.setUsername("USERNAME");
auth.setPassword("PASSWORD");
auth.setDomain("DOMAIN");
auth.setHost("SHAREPOINT_HOSTNAME");
auth.setAuthSchemes(authScheme);
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();
header.setName("X-FORMS_BASED_AUTH_ACCEPTED");
header.setValue("f");
headers.add(header);
queryServiceStub._getServiceClient().getOptions().setProperty(HTTPConstants.HTTP_HEADERS, headers);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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