How to pass BasicAuth authentication to WebServiceWorkItemHandler in BPM Suite 6.4?

Solution Unverified - Updated -

Environment

Red Hat JBoss BPM Suite 6.4.x

Issue

  • How to pass BasicAuth authentication to WebServiceWorkItemHandler in BPM Suite 6.4?
  • org.jbpm.process.workitem.webservice.WebServiceWorkItemHandler doesn't seem to have a way to pass username and password for Basic authentication similar to RESTWorkItemHandler. Is there a way to accomplish this?

Resolution

DISCLAIMER
Please note that the sample code within this article is provided for customer benefit, but, is not supported by Red Hat. Customers can use it "as it is" or by customizing it appropriately. Red Hat does not support custom code. Please refer to the Scope of coverage (What Red Hat supports) for further details.

It is currently possible only by creating a custom WorkItemHandler. A feature request has already been raised to fix it in a future release.

A sample of custom WorkItemHandler can be found in this gituhub repository - cxf-webservice-workitem project. It is a CXF based WIH, which is an extension of our default one, which instead of a standard JaxWsDynamicClientFactory creates one that supports a SpringBus. This allows you to load a CXF configuration from a cxf.xml file on your classpath, which allows you to use CXF supported security configuration. The main trick used can be found in CxfDynamicClientFactoryBuilder java class.

The CXF configuration file it uses defaults to cxf.xml, but it is configurable as in CxfWebServiceWorkItemHandler. See a cxf.xml that uses BasicAuth in the unit-tests.

In order to get it working in EAP, it will require the Spring modules be added to the EAP modules directory as described in How to install a Spring module in JBoss EAP ? . Those will be automatically be picked up by CXF. The reason it is needed is because the solution uses the CXF SpringBusFactory.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments