-
15. Re: The right way to log out a remote desktop client?
randahl Apr 18, 2012 5:17 AM (in response to jaikiran)Roger that. – I will take that into account.
-
16. Re: The right way to log out a remote desktop client?
danjee Apr 18, 2012 6:22 AM (in response to jaikiran)I see, then what is the correct way to flush tha jaas cache? It seems to work on a web application upon session invalidation. It will be reasonable to work from a swing application.
Thanks
-
17. Re: The right way to log out a remote desktop client?
dlofthouse Apr 18, 2012 6:40 AM (in response to danjee)It will be reasonable to work from a swing application.
No it will not as the authentication is associated with the established connection, if a client wishes to connect as a different user that user needs to establish a new connection to re-authenticate as a new user.
-
18. Re: The right way to log out a remote desktop client?
danjee Apr 18, 2012 7:03 AM (in response to dlofthouse)My scenario is like this:
User is logging in application. After a while he wants a break. He pushes a logout button that doesn't make exit the application entirely, only the login screen will be displayed so the connection is the same.
After that when he relogin he can login with any password. The logout was never called.
Looks like this piece of code calls the logout method, but also calls the login with same credentials, so it's not helping me.
try {
MBeanServerConnection mbeanServerConnection = ManagementFactory.getPlatformMBeanServer();
ObjectName mbeanName = new ObjectName("jboss.as:subsystem=security,security-domain=CaponeJaas");
mbeanServerConnection.invoke(mbeanName, "flushCache", null, null);
} catch (Exception e) {
throw new SecurityException(e);
}
-
19. Re: The right way to log out a remote desktop client?
dlofthouse Apr 18, 2012 7:21 AM (in response to danjee)so the connection is the same
No you must close the connection, authentication occurs on establishing the connection.
-
20. Re: The right way to log out a remote desktop client?
danjee Apr 18, 2012 7:32 AM (in response to dlofthouse)Is there any other way to close the connection other than calling System.exit(0) ?
-
21. Re: The right way to log out a remote desktop client?
danjee Apr 20, 2012 8:42 AM (in response to danjee)I will assume that it's impossible to disconnect without leaving the application
-
22. Re: The right way to log out a remote desktop client?
jaikiran Apr 20, 2012 10:38 AM (in response to danjee)I'm not sure which disconnect you are talking about. The code snippets you have posted so far all deal with MBeanServerConnection and don't see how that relates to this thread. Could you create a separate thread explaining your usecase?
-
23. Re: The right way to log out a remote desktop client?
danjee Apr 23, 2012 2:43 AM (in response to jaikiran)Hello,
There is a separate thread created: https://community.jboss.org/thread/198386
My main issue is to use a logout button that will invoke the logout from my JAAS login module. How can I do that from a swing application? It seems that it's possible to invoke that logout method from a web application when http session is invalidated.
-
24. Re: The right way to log out a remote desktop client?
randahl Sep 24, 2012 10:58 AM (in response to jaikiran)Thank you Jaikiran Pai! I finally got around to testing this, and you were right. I tested both suggestions, but as you expected, the JAAS clearing had no effect, whereas your
EJBClientContext
based solution worked like a breeze. Thank you again for helping me out with this.