1 Reply Latest reply on Jan 25, 2008 2:58 PM by ragavgomatam

    logout from swing client

      I have a swing client that is passing login identity via SecurityAssociation.setPrincipal and SecurityAssociation.setCredential which initially works as expected.

      However once I've made EJB calls etc and the user is logged in to my JAAS module on the server side, I can't figure out how to subsequently log them out (other than shutting down the client application)

      I was hoping that SecurityAssociation.clear would achieve this but it doesn't, neither does calling setCredential etc with different values.

      Is this possible?

      Thanks
      Alan Shields

        • 1. Re: logout from swing client
          ragavgomatam

          I think you can..Try this ( we did this in our swing client) ....In your swing client you must be having a handle to your callback handler, LoginContext & your implementation of PrivilgedAction

          CallBackHandler cbh = new FooCallBackHandler();
          LoginContext lc = new LoginContext("FooRealm", cbh);
          lc.login();
          Subject userSubject = lc.getSubject();
          // do your secured stuff here
          userSubject.doAsPrivileged(PrivilegedAction action, AccessControlContext acc);
          // done with my stuff, so i am loggin out
          lc.logout()