I use my own login module which extends CertRolesLoginModule and looks like this:
public class CustonCertLoginModule extends CertRolesLoginModule { private String issuer; private String defaultRole; public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) { super.initialize(subject, callbackHandler, sharedState, options); issuer = (String) options.get("issuer"); defaultRole = (String) options.get("defaultRole"); } protected Group[] getRoleSets() throws LoginException { X509CertImpl credentials = (X509CertImpl) getCredentials(); if (issuer.equals(credentials.getIssuerDN().getName())) { Group[] roleSets = {new SimpleGroup("Roles") { { addMember(new SimplePrincipal(defaultRole)); } }}; return roleSets; } return null; }
Try adding System.nanoTime() between statements to see if there are blocks of code in your module that are taking a long time.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#nanoTime()