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

Solution In Progress - Updated -

Issue

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

@Stateless
@WebService()
public class HelloWorldImpl implements HelloWorld {

    @Resource
    private SessionContext securityContext;

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

Environment

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

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content