Our business logic is implemented using EJBs which are secured. User with particular role can access the EJB methods. I have created the Restful Webservice which calls this EJB. As of now the EJB lookup is done using JNDI. i.e. EJB is not injected in Webservice.
I am calling this Webservice using a client code like below:
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter(.));
.
Inside my EJB if I call ejbContext. getCallerPrincipal(); I am getting value as ANONYMOUS.
How to resolve this issue?
Thanks