views:

702

answers:

2

My application runs under tomcat. It is using GSS API (JNDI) to connect to Active Directory LDAP Server using Kerberos. It allows the user to define AD servers and try to connect to them. However, once the first Kerberos using connect attempt is done, the application does not read Kerberos configuration again (/etc/krb5.conf). Hence, any change to it requires a restart of tomcat.

How can I avoid such a restart ? How can I force the application to reload Kerberos configuration before each connect attempt ?

A: 

I am trying to do a very similar thing, I think: run a tomcat JNDIRealm using authentication="GSSAPI" (use Kerberos for authentication)...however, I'm getting this:

Sep 16, 2009 3:40:01 PM org.apache.catalina.realm.JAASRealm authenticate
WARNING: Cannot find message associated with key jaasRealm.loginException
javax.security.auth.login.LoginException: javax.naming.NamingException: 
[LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: 
In order to perform this operation a successful bind must be completed on the 
connection., data 0, vece]; remaining name 'ou=LIMUsers,dc=lim,dc=com'
        at edu.vt.middleware.ldap.jaas.LdapDnAuthorizationModule.login
                  (LdapDnAuthorizationModule.java:93)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke
                    (NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke
                   (DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
        at javax.security.auth.login.LoginContext.access$000
                    (LoginContext.java:186)
        at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)

any idea what I am missing here?

A: 

http://stackoverflow.com/questions/1437281/reload-kerberos-config-in-java-without-restarting-jvm

I was facing the same problem too! Hope the above link helps.

Keshav