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

    making custom user-object available to Seam context

    axismundi

      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".

        • 1. Re: making custom user-object available to Seam context
          swd847

          Can you post more code? The full code for authenticator and applicationUser would be good. Also more details about where in the lifecycle this exception occurs, is it straight after the login button is pressed or is it subsequent pages.

          I think the problem you are probably having is that it looks like you have not specified the scope of the authenticator (and possibly applicationUser), which means that they will be bound to EVENT scope (which is probbly fine for the authenticator, but you would want applicationUser to be bound to SESSION scope).

          • 2. Re: making custom user-object available to Seam context
            axismundi

            ty, it was the SCOPE indeed.