Hi!
I need to implement a custom authentication method working with another database…
After a hard battle I finally made this on REST in flowable-custom-context.xml:
<?xml version="1.0" encoding="UTF-8"?><bean id="dataSource" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://127.0.0.1:3306/flowable?useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
<bean id="dataSourceExternalAuth" class="org.springframework.jdbc.datasource.SimpleDriverDataSource">
<property name="driverClass" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://127.0.0.1:3306/external_auth?useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true" />
<property name="username" value="root" />
<property name="password" value="" />
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean>
<bean id="dmnEngineConfigurator" class="org.flowable.dmn.spring.configurator.SpringDmnEngineConfigurator" />
<bean id="formEngineConfigurator" class="org.flowable.form.spring.configurator.SpringFormEngineConfigurator" />
<bean id="contentEngineConfigurator" class="org.flowable.content.spring.configurator.SpringContentEngineConfigurator" />
<bean id="processEngineConfiguration" class="org.flowable.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseSchemaUpdate" value="true" />
<property name="mailServerHost" value="localhost" />
<property name="mailServerPort" value="5025" />
<property name="configurators">
<list>
<ref bean="dmnEngineConfigurator" />
<ref bean="formEngineConfigurator" />
<ref bean="contentEngineConfigurator" />
</list>
</property>
<property name="idmEngineConfigurator">
<bean class="my.flowable.auth.MyCustomAuthConfigurator">
<property name=“myCustomAuthConfiguration">
<bean class=“my.flowable.auth.MyCustomAuthConfiguration">
<property name="dataSource" ref="dataSourceExternalAuth" />
</bean>
</property>
</bean>
</property>
</bean>
<bean id="processEngineFactoryBean" class="org.flowable.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="formService" factory-bean="processEngine" factory-method="getFormService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
Here is my custom auth implementation based on LDAP module:
<property name="idmEngineConfigurator">
<bean class="my.flowable.auth.MyCustomAuthConfigurator">
<property name="liferayAuthConfiguration">
<bean class=“my.flowable.auth.MyCustomAuthConfiguration">
<property name="dataSource" ref="dataSourceExternalAuth" />
</bean>
</property>
</bean>
</property>
Works very well but I wondering if this is the better approach!?
And now… how I can configure the flowable-modeler to use my custom authentication method?
I very appreciate any enlightenment… thank you!