The following code is for authentication on a Windows AD server using Java + Kerberos, and it works great -
public class KerberosAuthenticator { public static void main(String[] args) { String jaasConfigFilePath = "/myDir/jaas.conf"; System.setProperty("java.security.auth.login.config", jaasConfigFilePath); String krb5ConfigFilePath = "/etc/krb5/krb5.conf"; System.setProperty("java.security.krb5.conf", krb5ConfigFilePath); boolean success = auth.KerberosAuthenticator.authenticate("testprincipal", "testpass"); System.out.println(success); } }
The above program is just a test program. Actual code will be run in tomcat webapp. The problem that I encountered is that if the krb5.conf file changes, then the same will not be reflected in tomcat if successful authentication has already occurred once with the earlier version of krb5.conf. New changes reflect only restart of tomcat.
I want to know if there is a way to tell the JVM to reload krb5.conf so that it gets the latest changes without restarting the JVM.
java tomcat jaas kerberos
Keshav
source share