Skip to content
Advertisement

Identifying http request with KERBEROS from Java runing on Linux

I have some environment with both Linux and Windows servers. Authentication is handled by Kerberos. I want to make some JAVA code which automatically authenticates the http requests it makes as being done by the logged in user executing the program.

For example, if I have this code:

CloseableHttpClient winHttpclient = WinHttpClients.createDefault();

HttpGet httpget = new HttpGet("http://mykerberos/endpoint");

winHttpclient.execute(httpget).getEntity();

when I execute it from windows, it works out of the box. I am identified by http://mykerberos/endpoint and get the response.

Now, I want to do the same from a Linux server. I found a couple of proposal, like https://docs.oracle.com/javase/8/docs/technotes/guides/security/jgss/lab/part6.html#Proxy_Authentication but it is not what I look for as it requires my credentials: from Windows, I do not even have to pass them.

Does someone know how I can achieve this ?

Thanks in advance for your help!

Advertisement

Answer

Following https://docs.oracle.com/javase/8/docs/technotes/guides/security/jgss/lab/part6.html is working fine when using a proper version of Java (it works for java 8 but not java 6).

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement