Camunda With Spring Boot || How can I create a default admin user

Hi
I use Camunda With Spring Boot || How can I create a default admin user?

I don’t have a processes xml yet and id prefer not to have one but… maybe I need to!?

Hi Dominik

1st: we really encourage people to use the standard ProcessApplication/processes.xml way because otherwise we had some issues in the past, like embedded forms not working.
I believe we will deprecate the spring-scan auto deploy as of 2.0.

I am working on a way to configure processes.xml attributes through yaml, but this requires a core change, so it will at least rely on 7.6.

But for your question: there are many way to achieve what you are doing, and they do not really depent on spring-boot:

  1. use ProcessApplication and @PostDeploy so you can execute code that uses identityService to create user&role
  2. use a ProcessEnginePlugin and execute code on postEngineBuild
  3. disable camundas schema creation and use flyway to set up camunda db+user+initial config via sql

I personally use option 3 currently.

regards
Jan

I wrote a plugin to do number 2 for now.
this works great and I like it!


P.S. Ill migrate to the xml later too :slight_smile: and maybe switch to flyway later

I would like to integrate your user setup configuration in the starter … objections?

sure, cool. sounds good to me! :slight_smile:

1 Like

I incorporated this into the upcoming 2.0.0 … thanks for the gist!

How to disable camunda schema creation and create via liquibase?
I found multiple SQLs for each DB (camunda-engine-7.10.0.jar!\org\camunda\bpm\engine\db\create\activiti.postgres.create.case.engine.sql), but not sure how to use those in liquibase

Disable the db-generation by setting the ProcessEngineConfiguration#setDatabaseSchemaUpdate to “false” (or use the application.yaml flag).

liquibase: provide a changelog where you reference the camunda script as sql from classpath.