2 Replies Latest reply on Dec 4, 2008 6:17 AM by Ingo Jobling

    JPAIdentityStore and full username.

    Roman Podlesny Newbie

      I start using seam (Novice or beginner). I use seam-gen to create the project tenplate. According to the documentation, make some customization fo the login: define jpa-identity-store classes. Write authenticate method. The next I need is the displaying the full name of the user which is logged in (not username).
      My bad solution is to store the user-class in Session context. Bad, because of make storing in authenticate method. I try do define @Observer(JpaIdentityStore.EVENTUSERAUTHENTICATED), but it did not invoke. Define @Observer(JpaIdentityStore.EVENTUSERAUTHENTICATED) in Authenticator class. May be it is wrong place? So, where I have to define this observer, configuration information?
      Logout question. Can I override logout action? If can,how to do this?

        • 1. Re: JPAIdentityStore and full username.
          Ingo Jobling Master

          Hi Roman,

          I am using the new Seam Identify Management, the event is raised and my @Observer catches it.  Try to let Seam do the authenticate (don't write your own authenticate method) ... see the documentation regarding this point, it doesn't say you can't, but it says you don't have to, and I found that my authenticate method didn't work anymore when I switched to the new Seam Identity Management. 

          As for the @Observer, there are no special requirements, it can be in any class.

          For logout, I extended the IdentityManager class and overrode the logout action, because it raises the event after the user is logged out, which is correct but kind of useless because the User is not available anymore (for audit logging or whatever else you need to do).  It would be nice to have a pre-logout event!

          Hopen this helps,

          • 2. Re: JPAIdentityStore and full username.
            Ingo Jobling Master

            Also, the User is stored in the Session by Seam, you don't have to do this yourself.