0 Replies Latest reply on Jan 26, 2006 10:59 AM by Igor Kuzmitshov

    HttpServletRequest.getUserPrincipal() vs. SessionContext.get

    Igor Kuzmitshov Newbie


      I would like to use user ID instead of user name as the caller principal. After LoginModule customization, Subject looks like this (subject.toString()):

      Principal: john
      Principal: Roles(members:user,manager)
      Principal: CallerPrincipal(members:123)

      The problem is:

      • HttpServletRequest.getUserPrincipal().getName() returns "123", but
      • SessionContext.getCallerPrincipal().getName() returns "john"!

        I expected SessionContext.getCallerPrincipal() to return the same Principal (from the "CallerPrincipal" group).

        Setup: Linux, JDK 1.5.0_04, JBoss 4.0.3SP1

        I would be grateful for any comments,


        P.S. I've seen some similar posts, but found no answer.