Search code examples
jbpm

JBPM REST API Runtime builder authentication options?


I am attempting to use JBPM as a black box to manage workflow for my external web application. I am using the REST builder to build the runtime:

            engine = RemoteRuntimeEngineFactory.newRestBuilder()
            .addUrl(new URL(jbpmProperties.getURL()))
            .addTimeout(5)
            .addDeploymentId(jbpmProperties.getDeploymentId())
            .addUserName(username)
            .addPassword(password)
            .build();

I notice that the documentation for the builder states:

addPassword(String password) **always**
Set the password of the user connecting to the server
addUserName(String userName) **always**
Set the name of the user connecting to the server

Are there other options for this besides explicitly embedding the username and password into the RuntimeEngine builder? Is there a way for JBPM and an external app to share authentication service instead of using addUserName and addPassword in the builder?


Solution

  • What do you mean by sharing authentication service? The authentication is configured on the server side where your KIE Workbench (or KIE Server) runs and it is most often something that requires username and password. However, there has been a small change recently adding support for custom authentication by allowing you to add custom headers to your requests. You can expect this feature to be a part of the upcoming jBPM 6.5 but I am not sure how to configure authentication on the server side in this case.