3 Replies Latest reply on Apr 23, 2008 11:17 AM by ragavgomatam

    logout

      Hey,

      i am working with jboss4.2
      the server expose stateless session bean as facade.
      i implement CustomLoginModule.

      My question is -
      is there a way to listent to logout? for how long the user is login to the system.

      I have remote client like this:

      Properties properties = new Properties();
      
       // Working for both
      
       String authConf = "C:/work/devenv/mgt-server/third-party/jboss-4.2.0.GA/client/auth.conf";
       System.setProperty("java.security.auth.login.config", authConf);
       AppCallbackHandler handler = new AppCallbackHandler("aaa", "aaaa".toCharArray());
       LoginContext lc = new LoginContext("testSecureHttpInvoker", handler);
       lc.login();
      
       properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
       //properties.put(Context.PROVIDER_URL, "https://127.0.0.1:8443/invoker/JNDIFactory");
       properties.put(Context.PROVIDER_URL, "https://10.205.102.37:8443/invoker/JNDIFactory");
      (Context.PROVIDER_URL, "127.0.0.1:1099");
       return new InitialContext(properties);


        • 1. Re: logout
          ragavgomatam

          No...Unless you want to do some convoluted coding....

          • 2. Re: logout

            Thanks for the answer.

            I have to implement logout. i saw that the 'AbstractServerLoginModule' has logout function. The question is how jboss now when to call it?

            • 3. Re: logout
              ragavgomatam

              There are 2 ways, I believe this is called.
              (1) If you are using a web app, & if your HttpSession times out, I believe jboss calles logout() on the AbstarctServerLoginModule & clears your Principal.
              (2) If you are using a java client, you have the LoginContext. You call LoginContext.login() , do your stuff and call LoginContext.logout()
              after you finish your work.

              Hope this helps