title: Authenticating to sharepoint with kerberos from a java HttpClient
body: <p>I have a linux\java6 client that will authenticate to sharepoint2010 with NTLM and then send HTTP REST web services using Apache Commons <code>HttpClient</code>.</p>
  
  <p>I can do this with NTLM , but I want to use the same REST API to access sharepoint 2010 that uses kerberos auth.</p>
  
  <p>Any examples how to authenticate and send REST over HTTP  with a kerberos sharepoint?
  (preferably using <code>HttpClient</code>)</p>
  
  <p>p.s.
  I dont have access to sharepoint code, but i do have access to sharepoint admin configurations.
  This is roughly how I authenticate with NTLM:</p>
  
  <pre><code>HttpClient httpClient = new HttpClient(new SimpleHttpConnectionManager(true));
  AuthPolicy.registerAuthScheme(AuthPolicy.NTLM, JCIFS_NTLMScheme.class);
  String  localHostName = Inet4Address.getLocalHost().getHostName();
  authscope = new AuthScope(uri.getHost(), AuthScope.ANY_PORT);
  httpClient.getState().setCredentials(authscope,new NTCredentials(
               getUsername(),getPassword(),localHostName,getDomain()));
  
  // after the initial ntlm auth I can call my REST service with "httpClient.executeMethod" 
  
  int status = httpClient.executeMethod(new GetMethod(accessURI + "/sitecollection/info"));
  </code></pre>