How to propagate SecurityContext through ESB message, while invoking ESB service externally through ServiceInvoker ?
Issue
- I have an ESB service
WebServiceInvokethrough which I am invoking a JBossWS webservice throughSOAPProcessoraction. 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 ofServiceInvokerI call the target ESB ServiceTargetServiceESB.
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);
Environment
- JBoss Enterprise Service Oriented Architecture Platform (SOA-P)
- 5.3.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.