JAX-WS endpoint as Stateless EJB with SecurityContext returning wrong user (Anonymous) in JBoss EAP 7

Solution In Progress - Updated -


In a JAX-WS endpoint as Stateless EJB, the securityContext.getCallerPrincipal().getName() is always returning Anonymous name, even when an user is informed.

public class HelloWorldImpl implements HelloWorld {

    private SessionContext securityContext;

    public String hello() {
        return "User:"+securityContext.getCallerPrincipal().getName();


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In