盘古BPM体验地址    盘古BPM交流群盘古BPM交流群号:963222735

Flowable无法登录

分享牛 7262℃

摘要:Flowable UI 模块刷新之无法登录,报错信息如下:no default admin account and no privileges for ui apps created by flowable-ui-idm configuration bootstrap if user table not empty。所有UI应用程序都无法验证身份验证。

使用的flowable版本为Flowable6.1.2。

问题详情如下:登陆之后访问了Flowable UI 应用,使用的用户名/密码是admin/test。但是刷新之后,提示无法登陆。

下面是我部署操作的整个过程,详情如下:

 1.复制 wars并放到Tomcat的 web app 目录中

2.编辑修改 flowable-ui-app.properties 配置文件( flowable-modeler, flowable-admin, flowable-task, flowable-admin),使用的是 MySQL数据库并替换了默认的H2数据库。

3.编辑并修改  flowable-rest模块中的db.properties。

4.修改了跳转的URLs。

5.创建flowable 所需要的数据库以及表

6.启动Tomcat.

这里需要注意的是,如果我保留默认的H2数据库配置,上面问题就不存在了。

这个问题在Flowable6.1.2以及Flowable6.1.2以下的版本中都是存在的,可能是我们的运行先后顺序不一样导致的,并非Flowable的bug。我们看一下org.flowable.app.conf.Bootstrapper类的核心实现:

    protected void initializeDefaultPrivileges(String adminId) {
        Privilege idmAppPrivilege = identityService.createPrivilege(DefaultPrivileges.ACCESS_IDM);
        identityService.addUserPrivilegeMapping(idmAppPrivilege.getId(), adminId);
 
        Privilege adminAppPrivilege = identityService.createPrivilege(DefaultPrivileges.ACCESS_ADMIN);
        identityService.addUserPrivilegeMapping(adminAppPrivilege.getId(), adminId);
 
        Privilege modelerAppPrivilege = identityService.createPrivilege(DefaultPrivileges.ACCESS_MODELER);
        identityService.addUserPrivilegeMapping(modelerAppPrivilege.getId(), adminId);
 
        Privilege taskAppPrivilege = identityService.createPrivilege(DefaultPrivileges.ACCESS_TASK);
        identityService.addUserPrivilegeMapping(taskAppPrivilege.getId(), adminId);
    }

以上代码默认会创建一个用户并授权其访问所有的模块。

我有一个理论认为,问题是,flowable-rest和 flowable-idm都在同一个数据库中运行,大家可能首先运行了flowable-rest模块。

如果 flowable-restt配置首先运行,那么将会有Kermit、gonzo、fozzie设置,而没有任何相关的权限给task / modeler / idm / admin应用程序。因为已经存在了3,所以程序跳过了跳过了flowable-idm的设置操作。

若要测试此理论是否正确,请尝试清空数据库,并在之后首先部署flowable-idm,然后部署flowable-rest 。

或者,配置flowable-rest 没有任何演示数据。

 

 

 

 


转载请注明:分享牛 » Flowable无法登录