cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti and JHIpster issue

darshan_hardas
Champ in-the-making
Champ in-the-making
We want to use the Activiti integrated with JHipster. JHipster uses JHI_USERS table for the authentication. When activiti is configured with JHipster spring-boot ACT_USER takes precedence over the user table failing the default authentication.

We want to achieve that Activiti should be used with anonymous user credentials which the JHipster is authenticated with the default one. Can someone help us out how to configure Activiti to use its table and not override the default Jhipster authentication.

Thanks in advance.

8 REPLIES 8

jbarrez
Star Contributor
Star Contributor
I'm not sure what you want to achieve here? Do you want the UI of Activiti integrated in there?
If not, then we're talking about regular Activiti - Spring Boot integration. Activiti does not mandate any authentication itself, so you should not have problems there.

darshan_hardas
Champ in-the-making
Champ in-the-making
Correct. JHipster internally uses spring boot. 
The activiti integration has been done using this link https://spring.io/blog/2015/03/08/getting-started-with-activiti-and-spring-boot. We are not trying to integrate the UI here. Just Activiti with Spring boot.

The activiti is initialized but now when the default login is used (given by default in jhipster), it fires an activiti query to check that in ACT_ID_USER table. Attaching the logs from the app

jbarrez
Star Contributor
Star Contributor
From what I can see from the logs, the query simply returns no results:

2016-01-07 20:45:49.790 DEBUG 5308 — [nio-8078-exec-3] o.a.e.i.p.e.U.selectUserByQueryCriteria  : ==>  Preparing: select * from ( select a.*, ROWNUM rnum from ( select RES.* from ACT_ID_USER RES WHERE RES.ID_ = ? order by RES.ID_ asc ) a where ROWNUM < ?) where rnum >= ?
2016-01-07 20:45:49.790 DEBUG 5308 — [nio-8078-exec-3] o.a.e.i.p.e.U.selectUserByQueryCriteria  : ==> Parameters: admin(String), 2147483647(Integer), 1(Integer)
2016-01-07 20:45:50.046 DEBUG 5308 — [nio-8078-exec-3] o.a.e.i.p.e.U.selectUserByQueryCriteria  : <==      Total: 0

Which means that either the query is wrong or no data is in the table

darshan_hardas
Champ in-the-making
Champ in-the-making
Thanks for your comments.

Jhipster creates some table for users and authentication (prefix with jhi_) like activiti (ACT_). We have created a sample project with jhipster and configured the mysql server with it. The application comes up and the default admin pages with authentication and metrics can be accessible.

But when we integrate activiti in pom.xml, spring-boot-starter-basic in dependencies and do the mvn build, application comes up but authentication does not work here.

Steps to reproduce:
1) Create directory
2) Create a jhipster project : yo jhipster <sample>
3) Select DB as mysql/oracle by modifying application-dev.yml
4) Build the project using 'mvn' and launch
5) Close the application, add activiti dependency
6) Again build and launch with mvn

The application provided login does not work and metrics, api documentation cannot be accessible

Attached the whole jhipster project (zip renamed to txt) with activiti configured. Might have to run the npm install to get the npm modules installed

darshan_hardas
Champ in-the-making
Champ in-the-making
Can anyone suggests any solution?

paolog
Champ in-the-making
Champ in-the-making
Apparently, the following two lines in "<Your>App.java" will do the trick!

import org.activiti.spring.boot.SecurityAutoConfiguration;
@EnableAutoConfiguration(exclude = { SecurityAutoConfiguration.class })

It'll prevent Activiti from adding its own IdentityService to Spring Security.

allas
Champ in-the-making
Champ in-the-making
Thanks paolog! It works fine.

darshan_hardas
Champ in-the-making
Champ in-the-making

I have checked this after much of a gap.... the solution works... 

Thanks a ton paolog _ !!!Activiti and JHIpster issue