I encouter a problem like this, sessionContext.getCallerPrincipal() always returns a SimplePrincipal instance, and its name is "anonymous", I expected that it would return a customed principal which implements the interface Principal.
At client side, I implement a LoginModule, in the method commit(), add a my own customed principal, then call the remote EJB.