Remove default users from property files

I’s setup Flowable to run with MSSQL and persist in the DB. I also create a “new” administrator account (new password, login name).

But there are still the “default users” for all webapps left. Every time I restart the Tomcat the default users are setup again - which I don’t like to happen.

When I comment the property settings e.g. like this:

# Content engine
flowable.admin.app.server-config.content.name=Flowable Content app
flowable.admin.app.server-config.content.description=Flowable Content REST config
flowable.admin.app.server-config.content.server-address=http://localhost
flowable.admin.app.server-config.content.port=12080
flowable.admin.app.server-config.content.context-root=flowable-task
flowable.admin.app.server-config.content.rest-root=content-api
#flowable.admin.app.server-config.content.user-name=admin
#flowable.admin.app.server-config.content.password=test

I get a startup exception for flowable-admin:

Caused by: java.lang.IllegalArgumentException: flowable.admin.app.server-config.process.user-name must be set
	at org.springframework.util.Assert.hasText(Assert.java:276)
	at org.flowable.admin.properties.FlowableAdminAppProperties.validateServerConfig(FlowableAdminAppProperties.java:90)
	at org.flowable.admin.properties.FlowableAdminAppProperties.afterPropertiesSet(FlowableAdminAppProperties.java:75)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1769)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706)
	... 92 more

Is there a way to just drop this information? I don’t want the default users to be generated or grant their privileges.

Hi Heurazio,

if I got it right you want to disable the created demo users. In this case you can disable the creation of the users in the engine.properties. The file is located in the flowable-rest application in /WEB-INF/classes/engine.properties

There you have to set the following property to false:

create.demo.users=false

If you want to disable the whole demo stuff, like users, definitions and models you have to set the following properties to false:

create.demo.users=false
create.demo.definitions=false
create.demo.models=false

Update:
The properties you have adjusted are the Rest endpoints. So if you want to make changes there you also can achieve this right in the admin application http://localhost:[PORT]/flowable-admin

Greetings,
Thomas

Will this be persisted or will it overwrite when the server restarts?

EDIT: Unfortunately, this doesn’t seam to work for me. I created a file engine.properties within the flowable-rest/WEB-INF/classes/ folder. But it’s still saying that the property must be present. Do those settings work for 6.3.0 ? All other properties have a trailing flowable.xx. in front of them.

The changes will be persisted in the database. You can have a look at the table act_adm_server_config there you will find the persisted configuration for your rest endpoints.

Normally the file should be already there without creating it manually. I am using flowable 6.2.1 and I have got the old properties. These should work too, but in your case you can have a look at https://www.flowable.org/docs/userguide/index.html#_flowable_ui_applications_configurations there you will find an explanation of these properties too.

I just had a look at flowable 6.3.0 so the structure changed dramatically. So the described way is not applicable in your case.

What you can try is to set the following property to false:

flowable.rest.app.create-demo-definitions=true

You will find it in flowable-rest/WEB-INF/classes/application.properties.

Maybe this will solve your problem. If flowable has already created the demo users you have to delete them manually. The property just defines that flowable won’t create demo content on every start. Cause in the demo setup the h2 in memory database will be used.

Greetings,
Thomas

Thanks, I tested this out and it’s working. It seams that the user-name/password property needs to be presend anyway but it’s not used if the demo settings are turned off.

I’m now facing the problem that even if the user exists, and the privileges mapping are right, I can’t login. It just redirects to login screen. Do you have any idea why this could happen?

Ok that sounds good.

I already saw the other topic where this problem is discussed. I will post possible solutions there.

https://forum.flowable.org/t/redirected-to-login-page-when-trying-to-access-flowable-modeler-flowable-task/1322/9

Greetings,
Thomas

2 Likes