jboss-dockerfiles / drools

MIT License
61 stars 98 forks source link

Adding new user to workbench via drools-users.properties #43

Open danilodeLuca opened 5 years ago

danilodeLuca commented 5 years ago

Hello, I'm trying to add new users via drools-users.properties file, but something is wrong. You can check my forked repository to get the diff code or follow as bellow. Some considerations: 1) When I login into workbench with user "admin" and check the users list, my new user "xablau" exists. 2) Using the user "admin" if I change the xablau's password then I try to login works!

diff --git a/etc/drools-roles.properties b/etc/drools-roles.properties
index d9f91c5..51613de 100644
--- a/etc/drools-roles.properties
+++ b/etc/drools-roles.properties
@@ -1,4 +1,5 @@
 admin=admin,analyst,kiemgmt,rest-all
+xablau=admin,analyst,kiemgmt,rest-all
 krisv=admin,analyst
 john=analyst,Accounting,PM
 sales-rep=analyst,sales
diff --git a/etc/drools-users.properties b/etc/drools-users.properties
index 7c7a308..986227e 100644
--- a/etc/drools-users.properties
+++ b/etc/drools-users.properties
@@ -1,5 +1,6 @@
 #admin=admin
 admin=207b6e0cc556d7084b5e2db7d822555c
+xablau=207b6e0cc556d7084b5e2db7d822555c

 #krisv=krisv
 krisv=7b21a03b9918f9c629a46e119a9b8714
mbiarnes commented 5 years ago

Hi, two things you can try :

  1. build the images again after you have changed the drools-roles.properties and drools-users.properties - try again (I am not sure if it is allowed to use the same pwd twice?)

  2. execute docker run -p 8081:8080 -p 8001:8001 -i -t --name drools-workbench-showcase jboss/jbpm-workbench-showcase:latest /bin/bash

    ./add-user.sh

    • add a new user when finished please look at standalone/configuration/application-roles.properties and application-users.properties

copy newUser=rol1,rol2 etc to .../drools/drools-wb/showcase/etc/drools-roles.properties and newUser= to .../drools/drools-wb/showcase/etc/drools-users.properties

exit the container. Remove the container > docker ps -a you can fetch the container and then docker rm

Run the container again and try to login as newUser/

danilodeLuca commented 5 years ago

Hello, Thank you for the answer. I realized that the password hash is composed by the "user", it's something like: "user:ApllicationRealm:password". That's why its not possible to "copy and paste" password from one user to another. The easiest way is to use the script you mentioned to create new user and password. This issue can be closed.