Java-written embedded Kerberos server for testing

≯℡__Kan透↙ 提交于 2019-12-04 03:44:28

I was/am looking for such a thing too but this is simply not really possible because you will need a fully functional DNS server for this. A fully decoupled system is necessary. You can achieve this via the virtualization-maven-plugin and a group of virtual machines in VirtualBox with an internal network.

LDAP servers won't help you at all because they do absolutely nothing with GSS-API and Kerberos. SASL does everything by delegating auth to the next available KDC.

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

It seems like you can have Apache DS mimic a KDC: http://directory.apache.org/apacheds/configuration/ads-2.0-configuration.html

I have a written an Embedded LDAP for similar purpose and also to you can use it for testing with Kerberos, spcially useful for cases like testing Hadoop Kerberos testing.

https://github.com/krishdey/EmbeddedLdapKDC

You may also look at the class for writing embedded JUnit testing https://github.com/krishdey/EmbeddedLdapKDC/blob/master/EmbeddedLdapKDC/src/test/java/com/krish/ead/server/KerberosLdapIntegrationTest.java

Might be useful for you.

Hadoop publishes a MiniKdc class which can be used. From the MiniKdc class doc comment:

Mini KDC based on Apache Directory Server that can be embedded in testcases or used from command line as a standalone KDC.

https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-minikdc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!