How to make HttpClient use Kerberos?
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.
Related videos on Youtube
Nicolas Raoul
I am Nicolas Raoul, IT consultant in Tokyo. Feel free to copy/paste the source code from my StackExchange answers, I release it to the public domain.
Updated on September 15, 2022Comments
-
Nicolas Raoul over 1 year
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? -
Miles over 11 years
-
Andy Dufresne about 10 yearsThe sample seems to be missing for the latest version 4.3.3. Anyone?
-
FrankyFred almost 10 years@Andy, It's certainly because DefaultHttpClient used in the ClientKerberosAuthentication has been deprecated in version 4.3, and no new example was provided
-
eljeko almost 9 yearsYou may find this answer useful: stackoverflow.com/questions/21629132/…