How to make HttpClient use Kerberos?
Asked Answered
S

1

14

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?

Sardonyx answered 18/6, 2012 at 10:10 Comment(0)
E
11

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.

Electrotonus answered 19/6, 2012 at 12:1 Comment(4)
Here's a link to ClientKerberosAuthentication.java in SVNOdisodium
The sample seems to be missing for the latest version 4.3.3. Anyone?Palmary
@Andy, It's certainly because DefaultHttpClient used in the ClientKerberosAuthentication has been deprecated in version 4.3, and no new example was providedHut
You may find this answer useful: #21629632Boozer

© 2022 - 2024 — McMap. All rights reserved.