2 Replies Latest reply on Jul 28, 2008 3:06 AM by Anton

    Principal lost from my custom LoginModule

    Anton Newbie

      Hi all.

      I want to ask if this a bug, or how to work aroud this.

      I implemented a custom LoginModule extending UsernamePasswordLoginModule

      I created my own(smart) instance of principal
      public class User extends VersionedEntity implements Principal {

      and instantiated it in login.

      public boolean login() throws LoginException {
      ...
      User user = getIPersistanceRef().findUserByLoginPass(name, password);
      ...
      identity = user;
      return true;
      }

      So i think i will get this object calling

      (User) session.getCallerPrincipal()

      in my EJB.

      But realy i get an instance of SimplePrincipal (containing my users login).

      Are there any way to get (transfer) my principal implementation from LoginModule to my EJB?

      Is the scenario a bug? Have i to report it?