4 Replies Latest reply on Feb 28, 2006 7:35 PM by kosl

    JAAS Login/Logout Notification

    rameshsr

      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?

        • 1. Re: JAAS Login/Logout Notification
          mrforms

          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.

          • 2. Re: JAAS Login/Logout Notification
            kosl

             

            "MrForms" wrote:

            If you are using a web application, how about using a simple Session listener and checking for sessionCreated, sessionDestroyed ?


            I have the same problem as rameshsr. But can anybody tell me where I can find information how to write this "simple Session listener" ? Thx. in advance for any help.

            karol

            • 3. Re: JAAS Login/Logout Notification
              jornik
              • 4. Re: JAAS Login/Logout Notification
                kosl

                Thank you very much!