Java 6 HTTPURLConnection and Project Server NTLM Authentication from RHEL5.5

There is currently an error for authentication with an instance of Microsoft Project Server 2007 running on IIS with integrated Windows authentication enabled from a Java 1.6 (u19) client running on Linux, RHEL 5.5.

Note. The client runs on my Windows workstation.

At first I tried to implement a JAX-WS call and found that I could not get the WSDL due to authentication errors, in particular 401.2, and then 500. Therefore, I simplified it to a Java class that:

  • Creates an Authenticator and sets it by default with a username / password in AD that has permissions to the project server site.
  • Create a java.net.URL object
  • Create java.net.HttpURLConnection and call getInputStream
  • It is at this moment that a failure occurs.

With HttpURLConnection debugging HttpURLConnection I can see:

  • initial authentication error (401.2) returned from the server with “negotiation” and “NTLM” included in the response.
  • a client that creates an NTLM token and sends it to the server
  • server returning with status code 500

On the Windows server in the logs, I see that the username is not included in the log file just for my request, and only "-", which I think means "anonymous."

My thought is that Project Server doesn't like the NTLM token, which is being transmitted and suffocating. Based on many reports of this, it is assumed that NTLM (v1 and v2) are supported in Java 1.6.

Any help would be greatly appreciated ...

UPDATE 6/20/12: narrowed the problem to a local security policy setting for network security: minimum session security for NTLM SSP servers (including RPC). The installation that causes the Java client to fail is the NTLMv2 security requirement. Against what is claimed to support NTLM with 1.6 JDK ..

Some links:

+1
source share
1 answer

And when I ran into this problem, I ended up using a circuit created by someone else.

http://devsac.blogspot.com/2010/10/supoprt-for-ntlmv2-with-apache.html

Worked for me when I had to get image files from the iis server using ntlm. Snippet using the code above ..

 AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, org.xyz.JCIFS_NTLMScheme.class); HttpClient client = new HttpClient(); client.getState().setCredentials(AuthScope.ANY, new NTCredentials(userName, password, "", strDomain)); GetMethod get = new GetMethod(strImageFile); get.setDoAuthentication(true); client.executeMethod(get); 
0
source

Source: https://habr.com/ru/post/1490284/


All Articles