1 Reply Latest reply on Apr 1, 2009 6:18 AM by Arbi Sookazian

    Seam Security loginSuccessful observer not firing

    Troy Sellers Newbie

      Hi All,

      I have configured my Seam App to use the container security

      <security:identity jaas-config-name="activeDirectory" />

      This may be a stupid question, but would this now mean that my observer is not going to be called?
      The Seam docs are a little quiet about this kind of configuration....

      I am using JBoss 4.2.3 community server and have configured with an application-policy called activeDirectory, this is configured to talk to an AD 2003 server.

      This piece of code lives in the Authenticator (stateless) class that is part of my application.

      public void afterLogin() {
           logger.info("User [#{identity.credentials.username}] has logged in");

      This observer should fire with a successful login under these circumstances yeah?


        • 1. Re: Seam Security loginSuccessful observer not firing
          Arbi Sookazian Master

          from Seam 2.1.1.GA ref doc:

 Writing an event observer for security-related events
          Say for example, that upon a successful login that some user statistics must
          be updated. This would be done by writing an event observer for the
          org.jboss.seam.security.loginSuccessful event, like this:

          @In UserStats userStats;
          public void updateUserStats()
          userStats.setLastLoginDate(new Date());

          This observer method can be placed anywhere, even in the Authenticator component itself.