Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make HttpClient use Kerberos?

HttpClient is a Java library to browse websites.
I want to use it with Kerberos. The Kerberos part of HttpClient's documentation mostly says:

The best way to start is to grab the KerberosHttpClient.java file in examples and try and get it to work.

However, KerberosHttpClient.java is nowhere to be found (source, binaries, doc)
It is difficult to do anything without this file.

Where can I find KerberosHttpClient.java?
Or is there a better document explaining how to use HttpClient with Kerberos?

like image 763
Nicolas Raoul Avatar asked Jun 18 '12 10:06

Nicolas Raoul


1 Answers

In sources you will find the file ClientKerberosAuthentication.java with that example.

httpcomponents-client-4.2/httpclient/src/examples/org/apache/http/examples/client/ClientKerberosAuthentication.java

By the way, setting up Kerberos authentication requires many steps at KDC side (ActiveDirectory I guess) and HTTP server side too. I recommend you this generic server setup documentation even if targeting mod_auth_kerb, it addresses concepts and troubleshooting required to achieve the job.

like image 127
Yves Martin Avatar answered Sep 18 '22 04:09

Yves Martin