Kerberos Java Embedded Server for Testing

Does anyone know of any Kerberos embedded servers (KDC / KAdmin) that are written in Java and can only be started in the JVM process (something like a Hadoop mini-cluster or embedded LDAP servers)?

My goal is to allow people to run integrated tests that require Kerberos authentication without having to install a local kerberos server / configure a remote server and connect to it.

+8
java embedded integration-testing kerberos
source share
3 answers
+4
source share

I also looked for such a thing, but it is simply impossible, because for this you will need a full-fledged DNS server. A fully decoupled system is needed. You can achieve this with virtualization-maven-plugin and a group of virtual machines in a VirtualBox with an internal network.

LDAP servers will not help you because they do absolutely nothing with the GSS-API and Kerberos. SASL does everything by delegating auth to the next available KDC.

You need a KDC and a DNS server. You can try Samba 4 on one machine, install a second one that joins the domain. Install Hadoop on it, add a third (client), join and run the tests from there.

It looks like you can get Apache DS to mimic the KDC: http://directory.apache.org/apacheds/configuration/ads-2.0-configuration.html

0
source share

I have built-in LDAP for a similar purpose, and you can also use it for testing with Kerberos, which is useful for cases like testing Hadoop Kerberos.

https://github.com/krishdey/EmbeddedLdapKDC

You can also see the class for writing JUnit inline testing https://github.com/krishdey/EmbeddedLdapKDC/blob/master/EmbeddedLdapKDC/src/test/java/com/krish/ead/server/KerberosLdapIntegrationTest.java

May be useful for you.

0
source share

All Articles