3 Replies Latest reply on Mar 19, 2003 3:58 PM by Peter Doornbosch

    Flush won't work

    Chris Newbie

      I want to create a log-out function for my
      webapplication. I used a code to flush the authentication cache (see below). But when its done and I come back on the login page and press login.. it just logs in. And it doesn't ask for the user&password again. So probably the flush didn't work as it is suppossed to (it still knows the request.getUserPrinciple()).

      I imported org.jboss.jmx.adaptor.rmi.*
      and the code was:

      InitialContext iContext = new InitialContext();
      String serverName = null;

      if (serverName == null)
      serverName = java.net.InetAddress.getLocalHost().getHostName();

      RMIAdaptor server = (org.jboss.jmx.adaptor.rmi.RMIAdaptor)

      iContext.lookup("jmx:" + serverName + ":rmi");
      ObjectName jaasMgr = new ObjectName("jboss.security:service=JaasSecurityManager");

      Object[] params = {"My domain"};
      String[] signature = {"java.lang.String"};
      server.invoke(jaasMgr, "flushAuthenticationCache", params, signature);

      -- END CODE

      anyone an idea?