I'm trying to write an application and I have a problem with security. I need to know when a user is logged in. I'm using standart jaas web authentication. On the jboss forum I found someone with similar problem that is:
I am using JAAS for my security in a web application. I would like to get notified whenever a user logs in or logs out. Is there a way to do this in JBoss? Back to top View user's profile Send private message Send e-mail MrForms
Joined: Wed Aug 10, 2005 17:39 PM Posts: MrForms Location:
PostPosted: Tue Jan 17, 2006 21:20 PM Post subject: Re: JAAS Login/Logout Notification Reply with quote Just some random suggestions ...
If you are using a web application, how about using a simple Session listener and checking for sessionCreated, sessionDestroyed ?
Doesn't your application offer a explicit login/logout mechanism ?
I am not aware that JAAS offers any listener/callback support for these events as they are usually explicit calls to the the LoginContext.login and LoginContext.logout methods.
You could always set up your own login module or recompile the login modules of JBoss with a embedded logging strategy in it. Download the source of JBoss and edit the desired login modules, add your logging mechanism in the commit method for example and in the logout methods. A quick build and you are done.