1 Reply Latest reply on Sep 12, 2006 3:24 PM by cdecarlo

    getAuthenticationCachePrincipals always returns empty list

    cdecarlo Newbie

      Hi,

      We have a Swing based GUI application that connects to a JBoss EJB server and we need to know if a user is already logged into the server. I'm looking at the getAuthenticationCachePrincipals method in the JMX bean JaasSecurityManager to return me a list of authenticated users. I've got the code working O.K. but the method always returns me an empty list.

      MBeanServerConnection server = MBeanServerConnection)ctx.lookup("jmx/rmi/RMIAdaptor");
      
      ObjectName jaasMgr = new ObjectName("jboss.security:service=JaasSecurityManager");
      
      Object[] params = {p_strSecurityDomainName};
      
      String[] signature = {"java.lang.String"};
      
      List users = (List) server.invoke(jaasMgr, "getAuthenticationCachePrincipals", params, signature);


      I have double checked that the DefaultCacheTimeout is set to a non zero value. We are using a custom login module which extends the UsernamePasswordLoginModule....we are calling the super methods everywhere as well. Here is the entry in the login-config.xml file for our domain.

      <application-policy name="ucmslc">
       <authentication>
       <login-module code="ucs.common.security.ucms.JBossLoginModule" flag="optional">
       <module-option name="applicationName">UCMS-LC</module-option>
       <module-option name="principalUserRole">lccmsUser</module-option>
       <module-option name="addSecurityGroupsAsRoles">false</module-option>
       </login-module>
       </authentication>
      </application-policy>
      

      Anybody ever get this method call working successfully?

      Thanks,

      Cliff