configure login to jBPM using user information configured in DB

291 views
Skip to first unread message

Matara Kankanange Harischandra

unread,
Sep 9, 2021, 4:38:29 AM9/9/21
to jBPM Setup
I tried to configure login to jBPM using user information configured in DB. But I Can not login from Workbench. It says Unauthorized. I see the following in the server.log.

2021-09-09 00:15:44,236 WARN  [org.kie.server.services.impl.controller.DefaultRestControllerImpl] (KieServer-ControllerConnect) Exception encountered while syncing with controller at http://localhost:8080/business-central/rest/controller/server/sample-server error Error while sending PUT request to http://localhost:8080/business-central/rest/controller/server/sample-server response code 405

JBPM Version is 7.56.0

Following are the changes I made in the standalone.xml file.
Added,
<property name="org.kie.server.user" value="dbuser"/>
<property name="org.kie.server.pwd" value="dbuser"/>
<property name="org.kie.server.controller.user" value="dbuser"/>
<property name="org.kie.server.controller.pwd" value="dbuser"/>

<!--login-module code="RealmDirect" flag="required">
       <module-option name="password-stacking" value="useFirstPass"/>
</login-module-->
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
       <module-option name="dsJndiName" value="java:jboss/datasources/jBPMDS"/>
       <module-option name="principalsQuery" value="select passwd from Users username where username=?"/>
       <module-option name="rolesQuery" value="select userRoles, 'Roles' from UserRoles where username=?"/>
</login-module>

In the DB, I created the two tables "users" and "userroles" and added the following records.
INSERT INTO Users VALUES("matara", "matara", "mata...@gmail.com", "en-US");
INSERT INTO Users VALUES("krisv", "krisv", "mata...@gmail.com", "en-US");
INSERT INTO Users VALUES("dbuser", "dbuser", "mata...@gmail.com", "en-US");
INSERT INTO Users VALUES("kieserver", "kieserver1!", "mata...@gmail.com", "en-US");

INSERT INTO UserRoles VALUES("matara", "kie-server");
INSERT INTO UserRoles VALUES("matara", "admin");
INSERT INTO UserRoles VALUES("matara", "matara-group");

INSERT INTO UserRoles VALUES("krisv", "admin");
INSERT INTO UserRoles VALUES("krisv", "analyst");
INSERT INTO UserRoles VALUES("krisv", "user");
INSERT INTO UserRoles VALUES("krisv", "process-admin");
INSERT INTO UserRoles VALUES("krisv", "kie-server");

INSERT INTO UserRoles VALUES("dbuser", "admin");
INSERT INTO UserRoles VALUES("dbuser", "analyst");
INSERT INTO UserRoles VALUES("dbuser", "user");
INSERT INTO UserRoles VALUES("dbuser", "process-admin");
INSERT INTO UserRoles VALUES("dbuser", "kie-server");

INSERT INTO UserRoles VALUES("kieserver", "kie-server");

Server log and standalone.xml attached herewith.

Can you please help me to resolve this?

Thanks,
Matara
server.log
standalone.xml

Arif Mohammed

unread,
Sep 9, 2021, 11:12:42 AM9/9/21
to jBPM Setup
login-module configuration should be part of the security-domain whose name is "other" (<security-domain name="other">)

Matara Kankanange Harischandra

unread,
Sep 10, 2021, 10:48:07 AM9/10/21
to jBPM Setup
Hi Arif,

Problem resolved. It was a silly mistake of mine. I had created the user and userroles tables in another JBPM DB. When the tables were created in the right DB it works perfectly.

Again, thanks a lot for spending your time on trying to help me.

Thanks,
Matara
Reply all
Reply to author
Forward
0 new messages