Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8001069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:59:29+00:00 2026-06-04T15:59:29+00:00

I have a linux\java6 client that will authenticate to sharepoint2010 with NTLM and then

  • 0

I have a linux\java6 client that will authenticate to sharepoint2010 with NTLM and then send HTTP REST web services using Apache Commons HttpClient.

I can do this with NTLM , but I want to use the same REST API to access sharepoint 2010 that uses kerberos auth.

Any examples how to authenticate and send REST over HTTP with a kerberos sharepoint?
(preferably using HttpClient)

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:

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"));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T15:59:31+00:00Added an answer on June 4, 2026 at 3:59 pm

    Please confirm that your environment is correctly setup for Kerberos, this can be achieved by running kinit. If this fails you will need to ensure that your krb5.ini (windows) or krb5.conf (linux) are setup to point to your domain controller correctly.

    Once you have confirmed that Kerberos is functional you can use the example code from HttpClient as pasted below.

    Please note that there are many issues that can cause Kerberos to fail, such as time synchronisation, supported encryption types, trust relationships across domain forests and it’s also worth ensuring that your client is on a seperate box to the server.

    Here is the example code which is available in the HttpClient download, you will need to ensure your JAAS configuration and krb5.conf or ini are correct!

    public class ClientKerberosAuthentication {
    
        public static void main(String[] args) throws Exception {
    
            System.setProperty("java.security.auth.login.config", "login.conf");
            System.setProperty("java.security.krb5.conf", "krb5.conf");
            System.setProperty("sun.security.krb5.debug", "true");
            System.setProperty("javax.security.auth.useSubjectCredsOnly","false");
    
            DefaultHttpClient httpclient = new DefaultHttpClient();
            try {
                httpclient.getAuthSchemes().register(AuthPolicy.SPNEGO, new SPNegoSchemeFactory());
    
                Credentials use_jaas_creds = new Credentials() {
    
                    public String getPassword() {
                        return null;
                    }
    
                    public Principal getUserPrincipal() {
                        return null;
                    }
    
                };
    
                httpclient.getCredentialsProvider().setCredentials(
                        new AuthScope(null, -1, null),
                        use_jaas_creds);
    
                HttpUriRequest request = new HttpGet("http://kerberoshost/");
                HttpResponse response = httpclient.execute(request);
                HttpEntity entity = response.getEntity();
    
                System.out.println("----------------------------------------");
                System.out.println(response.getStatusLine());
                System.out.println("----------------------------------------");
                if (entity != null) {
                    System.out.println(EntityUtils.toString(entity));
                }
                System.out.println("----------------------------------------");
    
                // This ensures the connection gets released back to the manager
                EntityUtils.consume(entity);
    
            } finally {
                // When HttpClient instance is no longer needed,
                // shut down the connection manager to ensure
                // immediate deallocation of all system resources
                httpclient.getConnectionManager().shutdown();
            }
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Linux/c client app that connects to a WCF web service over
I have a Java web service client running on Linux (using Axis 1.4) that
I have created a java application for Debian Linux. Now I want that that
We have a linux app that depends on the speed with which the user
I have a linux VPS that uses an older version of python (2.4.3). This
I have Ubuntu Linux. I found one command will let me download unread message
I have a Linux app (written in C) that allocates large amount of memory
(See this question in ServerFault ) I have a Java client that uses Socket
I have a Java client that connects to a C++ server using TCP Sockets
We have huge record set on AIX box that we send over network to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.