Project: Tomcat
Bug 41407 CLIENT-CERT Authentication with JAASRealm not working
Reported: 2007-01-18 18:33:49 | Status: resolved fixed

I tried to config my webapp to authenticate user by CLIENT-CERT auth method. I verified my JAAS LoginModule by using "BASIC" to auth method and successfully authenticated user login. After studying Tomcat 5.5.20 source, I found that the problem is caused by the RealmBase.java and JAASRealm.java. if CLIENT-CERT auth method is used, SSLAuthenticator will call the : JAASRealm.authenticate(X509Certificate certs[]) As JAASRealm didn't override authenticate(X509Certificate certs[]), RealmBase's authenticate will be used and it will only validate the certs and then call getPrincipal(X509Certificate) and then getPrincipal(String) is being called to get the Principal. However, in JAASRealm, this function always return null. That means Tomcat can't use JAASRealm with CLIENT-CERT auth method. Thanks Butler

Files changed in fix:
java/org/apache/catalina/realm/JAASCallbackHandler.java java/org/apache/catalina/realm/JAASMemoryLoginModule.java java/org/apache/catalina/realm/JAASRealm.java