2 Replies Latest reply on Oct 17, 2007 2:52 AM by Marc Lustig

    making custom user-object available to Seam context

    Marc Lustig Newbie

      I am struggling a little bit with the logic of the Seam context.
      Currently we get "RequiredException: @In attribute requires non-null value" messages after the user has logged in.

      Requirement:
      on authentication, an ApplicationUser object should be made available to Seam-context for later usage.

      Current solution:
      our authenticator-class is supposed to outject a property to the Seam-context:

      @Out
      private ApplicationUser applicationUser;

      or, alternatively, make itself available :

      @Name("authenticator")
      public class Authenticator {....


      However, none of both is available in the Seam-context after the user has logged in!
      I suppose, the reason is that once Authenticator.authenticate() returns true indicating successfull authentication, Seams Identity-class expires the current context and creates a new context. Hence, both objects, applicationUser and authenticator, are LOST.

      So, what is best practise to make our custom user-object available to the session?
      org.jboss.seam.security.Identity doesn't offer something like "setAttribute".