Here’s my code:
@Configuration
public class CamundaSecurityFilter {
@Bean
public FilterRegistrationBean<Filter> processEngineAuthenticationFilter() {
FilterRegistrationBean<Filter> registration = new FilterRegistrationBean<>();
registration.setName("camunda-auth");
registration.setFilter(getProcessEngineAuthenticationFilter());
registration.addInitParameter("authentication-provider",
"org.camunda.bpm.engine.rest.security.auth.impl.HttpBasicAuthenticationProvider");
registration.addUrlPatterns("/*");
registration.setOrder(1);
return registration;
}
@Bean
public Filter getProcessEngineAuthenticationFilter() {
return new ProcessEngineAuthenticationFilter();
}
}
When I run with Basic Auth, first time i try to access camunda webapp(cockpit,admin,tasklist), it was not allowing me to create user instead it was asking for login. At very first time execution of camunda server we dont have any user. After starting the application only we able to create user. So what i do is, i will disable basicauth and restart the application and now able to create user. And from further number of restart of camunda application i was able to login with basic auth.
Is there any solution to login/create users at first attempt?
Attached an image which requires users in place when i attempt first login after applictaion startup and it fails beacuse basicauth enabled and where no users present in db.
Is there a way to insert a script(create user if not available) while application startup?