2 Replies Latest reply on Jul 12, 2005 10:43 AM by Darran Lofthouse

    Getting caller principal into SSB connection?

    kellyschrock Newbie

      Hello,

      I have a plain Java desktop application from which I'm connecting to a stateless session bean. I'm trying to figure out how to make a connection to the SSB so that when it calls getCallerPrincipal() on its SessionContext, the userID from the client will be there. I already have the user ID, and I have tried the following:

      InitialContext ic = new InitialContext();
      ic.addToEnvironment(Context.SECURITY_PRINCIPAL, userName);
      
      Object ref = ic.lookup("whateverBean");
      


      ...which makes sense, other than the fact that it doesn't appear to work. I don't really have stringent requirements about security, I just need for the SSB to know who's calling its methods so it can log that activity.

      Thanks