0 Replies Latest reply on May 8, 2003 10:25 PM by Tal Golan

    How-to: Flush Authentication Cache

    Tal Golan Newbie

      In an effor to save others from the stress this caused me...

      Here is the code that I used to flush the JBoss authentication cache. While there is information to this effect in the JBoss Admin Manual (somewhere around page 297 depending on the manual version), the code example is not complete.

      ArrayList servers = MBeanServerFactory.findMBeanServer(null);
      MBeanServer server = (MBeanServer) servers.get(0);
      String jaasMgrName = "jboss.security:service=JaasSecurityManager";
      ObjectName jaasMgr = new ObjectName( jaasMgrName );
      Object[] params= { "PostgresDbRealm" }; // change this to reflect your Security-Domain
      String[] signature = { "java.lang.String" };
      server.invoke( jaasMgr, "flushAuthenticationCache", params, signature );

      If you have found this posting and it has saved you some time, please remember to return the favor.

      Peace,

      Tal