2021年6月11日星期五

flowable 6.6.0 更新变动,相对于6.5.0版本,导致流程设计器免登录验证失败

前沿:

flowable和activiti是同一个团队开发的,activiti先,flowable后 。所以,flowable 算是 activiti的升级版。
flowable 确实要比activiti功能更完善。未来肯定flowable 是主流趋势,当下也已经是主流了。

目前最新版本的 flowable 6.6.0 版本,相对于6.5.0版本配置的免登录方案,对6.6.0版本就无效了

通过查看对比flowable源码,发现内置的 Security 权限代码有不少改动,这个是导致免登陆失败的根源

需要重新重构flowable源码的两个函数,如下

1. SecurityUtils

package org.flowable.ui.common.security;import org.fh.util.Jurisdiction;import org.flowable.common.engine.api.FlowableIllegalStateException;import org.flowable.idm.api.User;import org.flowable.ui.common.model.RemoteUser;import org.springframework.security.core.Authentication;import org.springframework.security.core.context.SecurityContext;import org.springframework.security.core.context.SecurityContextHolder;import java.util.ArrayList;import java.util.List;/** * 说明:重构流程编辑器获取用户信息 * 作者:FH Admin * from:www.fhadmin.org */public class SecurityUtils {	private static User assumeUser;		private static SecurityScopeProvider securityScopeProvider = new FlowableSecurityScopeProvider();	private SecurityUtils() {	}	/**	 * Get the login of the current user.	 */	public static String getCurrentUserId() {		User user = getCurrentUserObject();		if (user != null) {			return user.getId();		}		return null;	}	/**	 * @return the {@link User} object associated with the current logged in user.	 */	public static User getCurrentUserObject() {		if (assumeUser != null) {			return assumeUser;		}		RemoteUser user = new RemoteUser();		user.setId(Jurisdiction.getUsername());		user.setDisplayName(Jurisdiction.getName());		user.setFirstName(Jurisdiction.getName());		user.setLastName(Jurisdiction.getName());		user.setEmail("admin@flowable.com");		user.setPassword("123456");		List<String> pris = new ArrayList<>();		pris.add(DefaultPrivileges.ACCESS_MODELER);		pris.add(DefaultPrivileges.ACCESS_IDM);		pris.add(DefaultPrivileges.ACCESS_ADMIN);		pris.add(DefaultPrivileges.ACCESS_TASK);		pris.add(DefaultPrivileges.ACCESS_REST_API);		user.setPrivileges(pris);		return user;	}	 public static void setSecurityScopeProvider(SecurityScopeProvider securityScopeProvider) {  SecurityUtils.securityScopeProvider = securityScopeProvider; } public static SecurityScope getCurrentSecurityScope() {  SecurityContext securityContext = SecurityContextHolder.getContext();  if (securityContext != null && securityContext.getAuthentication() != null) {   return getSecurityScope(securityContext.getAuthentication());  }  return null; } public static SecurityScope getSecurityScope(Authentication authentication) {  return securityScopeProvider.getSecurityScope(authentication); } public static SecurityScope getAuthenticatedSecurityScope() {  SecurityScope currentSecurityScope = getCurrentSecurityScope();  if (currentSecurityScope != null) {   return currentSecurityScope;  }  throw new FlowableIllegalStateException("User is not authenticated"); }	public static void assumeUser(User user) {		assumeUser = user;	}	public static void clearAssumeUser() {		assumeUser = null;	}}

2.FlowableUiSecurityAutoConfiguration

package org.flowable.ui.common.security;import org.flowable.spring.boot.FlowableSecurityAutoConfiguration;import org.flowable.spring.boot.idm.IdmEngineServicesAutoConfiguration;import org.springframework.boot.autoconfigure.AutoConfigureAfter;import org.springframework.boot.autoconfigure.AutoConfigureBefore;import org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration;import org.springframework.context.annotation.Configuration;/** * 说明:重构FlowableUiSecurity自动配置 * 作者:FH Admin * from:www.fhadmin.org */@Configuration(proxyBeanMethods = false)@AutoConfigureAfter({  IdmEngineServicesAutoConfiguration.class,})@AutoConfigureBefore({  FlowableSecurityAutoConfiguration.class,  OAuth2ClientAutoConfiguration.class,})public class FlowableUiSecurityAutoConfiguration {}









原文转载:http://www.shaoqun.com/a/799509.html

跨境电商:https://www.ikjzd.com/

杨颜:https://www.ikjzd.com/w/1820

贝贝母婴网:https://www.ikjzd.com/w/1321

bap:https://www.ikjzd.com/w/1492

hemingway:https://www.ikjzd.com/w/2344


前沿:flowable和activiti是同一个团队开发的,activiti先,flowable后。所以,flowable算是activiti的升级版。flowable确实要比activiti功能更完善。未来肯定flowable是主流趋势,当下也已经是主流了。目前最新版本的flowable6.6.0版本,相对于6.5.0版本配置的免登录方案,对6.6.0版本就无效了通过查看对比flowable源码
Spark:https://www.ikjzd.com/w/218
Fotki:https://www.ikjzd.com/w/219
沃尔玛:https://www.ikjzd.com/w/220
亚马逊应用商店:https://www.ikjzd.com/w/531
cicpa考试:https://www.ikjzd.com/w/1375
camel:https://www.ikjzd.com/w/331.html
合租第一天 我就和他上床了:http://lady.shaoqun.com/m/a/270888.html
女友为工作和别的男人暧昧 口述和女友的第一次爱情:http://lady.shaoqun.com/m/a/270072.html
醉酒小叔子一把拉住了我 口述我与小叔子危险的瞬间:http://lady.shaoqun.com/a/269891.html
2014年,云南"王喜"失守,摔了几千个二奶,被捕后被判死刑:http://lady.shaoqun.com/a/369111.html
已婚男人的真言:你婚后生活中不知道的"秘密"!:http://www.30bags.com/a/386385.html
已婚男人的真言:你婚后生活中不知道的"秘密"!:http://lady.shaoqun.com/a/369112.html

没有评论:

发表评论

跨境电商资讯:外贸宣传平台有哪些(出口的

现在很多做外贸的人都非常关注 外贸企业怎么推广 ,而现在推广的途径和平台有很多,企业如果都做,成本和时间精力是一个问题,而且并不是所有的推广渠道都是有用的。今天云程网络就来为大家盘点几个有效的外贸推广渠道。 一、海外社交媒体营销 Facebook,领英等海外社交媒体营销在近几年得...