2 Replies Latest reply on Oct 10, 2007 1:43 PM by Fabio Silva

    Custom Principal classes and EJBContext.getCallerPrincipal()

    Fabio Silva Newbie


      I'm creating a custom JAAS authentication module, by extending AbstractServerLoginModule, to integrate in a EJB 3.0 layer. During authentication, I assign objects to the user's Subject that are instances of custom Principal classes I wrote to represent users and roles in my system. It works fine, and I can retrive the authenticated Subject with the right objects by calling SecurityAssociation.getSubject() from my EJB's.

      However, using injected EJBContext instances, the method getCallerPrincipal() always returns an instance of SimplePrincipal, which contains only the username.
      Is there a way to get this method to return the same Principal object reference that was assigned to the Subject during authentication?

      Thanks in advance.