I am working on a web project which contains EJB components and is deployed in JBoss EAP 7.0.7. Some of the EJBs are called from a standalone client application.
The problem is although the authentication seems to work fine, the principal is not propagated to the EJB layer, so when I call sessionContext.getCallerPrincipal().getName(), it just returns "anonymous".
It seems that my configuration works fine. I setup a security domain in my standalone.xml and jboss-web.xml, then I annotated my EJBs to use the configured security domain.
When I call the EJB from within the web app, it works perfectly fine. The principal is propagated and set to the logged in user (I used the HttpServletRequest.login api).
So how would I propagate the principal to the EJB layer just as it is propagated using the HttpServletRequest.login? Is there any api similar to the one I mentioned that I can implement in a standalone app? Ive been searching for some time now, but nothing worked for me so far. Hope someone can help me. Thanks!