How to propagate SecurityContext through ESB message, while invoking ESB service externally through ServiceInvoker ?

Solution Unverified - Updated -


  • I have an ESB service WebServiceInvoke through which I am invoking a JBossWS webservice through SOAPProcessor action. In the web service implementation I have access to the logged in user which indicates that the Security Context has been propagated to the WebService.
    In the webservice I create a new ESB Message like below, and with the help of ServiceInvoker I call the target ESB Service TargetServiceESB.
Message msg = MessageFactory.getInstance().getMessage();
ServiceInvoker invoker = new ServiceInvoker(myServiceCategory, myServiceName);
response = invoker.deliverSync(msg, 2000);

But, to my surprise the SecurityContext is not propagated from the webservice implementation to the ESB Service. Can you please suggest me if
I have to manually set the security context on the ESB Message as shown below?

msg.getContext.setContext(SecurityService.AUTH_REQUEST, encrypted);


  • JBoss Enterprise Service Oriented Architecture Platform (SOA-P)
    • 5.3.0

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