当前位置: 首页 > news >正文

flowable 去掉自带的登录权限

重写Security配置,使所有请求都可以通过Security验证。(/**/**)

如:

公共的Security配置

package com.central.workflow.config;import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;@Configuration
public class CustomSecurityConfiguration extends WebSecurityConfigurerAdapter {@Overrideprotected void configure(HttpSecurity http) throws Exception {http.authorizeRequests().antMatchers("/**/**").permitAll().anyRequest().authenticated().and().csrf().disable(); // 禁用CSRF保护}
}

package com.central.workflow.config;import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;@Configuration
public class CustomSecurityConfiguration extends WebSecurityConfigurerAdapter {@Overrideprotected void configure(HttpSecurity http) throws Exception {SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();successHandler.setTargetUrlParameter("redirectTo");http.headers().frameOptions().disable();http.csrf().disable().authorizeRequests().antMatchers("/**/**").permitAll().anyRequest().authenticated().and().httpBasic();}
}

flowable 6.6.0 以下版本

1. 找到项目maven目录

2.重写SecurityConfiguration

不能建相同包名,类名

package org.flowable.ui.modeler.conf;

package com.central.workflow.config;import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;/*** 重构FlowableSecurity*/
@Configuration
@EnableWebSecurity
public class FlowableSecurityConfiguration {@Configuration@Order(1)public static class ApiWebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter {@Overrideprotected void configure(HttpSecurity http) throws Exception {SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();successHandler.setTargetUrlParameter("redirectTo");http.headers().frameOptions().disable();http.csrf().disable().authorizeRequests().antMatchers("/**/**").permitAll().anyRequest().authenticated().and().httpBasic();}}}
3.可选配置
/* Licensed under the Apache License, Version 2.0 (the "License");* you may not use this file except in compliance with the License.* You may obtain a copy of the License at**      http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing, software* distributed under the License is distributed on an "AS IS" BASIS,* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.* See the License for the specific language governing permissions and* limitations under the License.*/
package com.central.workflow.config;import org.flowable.ui.common.service.idm.RemoteIdmService;
import org.flowable.ui.modeler.properties.FlowableModelerAppProperties;
import org.flowable.ui.modeler.servlet.ApiDispatcherServletConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;@Configuration
@EnableConfigurationProperties({FlowableModelerAppProperties.class})
@ComponentScan(basePackages = {// "org.flowable.ui.modeler.conf",// 不引入 conf"org.flowable.ui.modeler.repository", //"org.flowable.ui.modeler.service", // 流程设计服务// "org.flowable.ui.admin.repository", //// "org.flowable.ui.admin.service", // 流程部署服务// "org.flowable.ui.modeler.security", //授权方面的都不需要// "org.flowable.ui.common.conf", // flowable 开发环境内置的数据库连接// "org.flowable.ui.common.filter", // IDM 方面的过滤器// "org.flowable.ui.idm.conf", // IDM 配置"org.flowable.ui.common.service","org.flowable.ui.common.repository",
//        "org.flowable.ui.common.security",//授权方面的都不需要"org.flowable.ui.common.tenant"},excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = RemoteIdmService.class), // 移除RemoteIdmService
})
public class FlowableConfig {@SuppressWarnings({"rawtypes", "unchecked"})@Beanpublic ServletRegistrationBean modelerApiServlet(ApplicationContext applicationContext) {AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();dispatcherServletConfiguration.setParent(applicationContext);dispatcherServletConfiguration.register(ApiDispatcherServletConfiguration.class);DispatcherServlet servlet = new DispatcherServlet(dispatcherServletConfiguration);ServletRegistrationBean registrationBean = new ServletRegistrationBean(servlet, "/**/**");registrationBean.setName("Flowable Modeler App API Servlet");registrationBean.setLoadOnStartup(1);registrationBean.setAsyncSupported(true);return registrationBean;}
}

flowable 6.6.0版本以上版本(包括6.6.0)

1. 找到项目maven目录

2.重写ModelerSecurityConfiguration

在自己项目里面建相同包名,类名

package org.flowable.ui.modeler.conf;

package org.flowable.ui.modeler.conf;import org.flowable.ui.common.security.SecurityConstants;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;/*** 说明:重构ModelerSecurity* from: fhadmin.cn*/
@Configuration(proxyBeanMethods = false)
@EnableWebSecurity
public class ModelerSecurityConfiguration {@Configuration@Order(SecurityConstants.MODELER_API_SECURITY_ORDER)public static class ModelerApiWebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter {@Overrideprotected void configure(HttpSecurity http) throws Exception {SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();successHandler.setTargetUrlParameter("redirectTo");http.headers().frameOptions().disable();http.csrf().disable().authorizeRequests().antMatchers("/**/**").permitAll().anyRequest().authenticated().and().httpBasic();}}}

相关文章:

flowable 去掉自带的登录权限

重写Security配置,使所有请求都可以通过Security验证。(/**/**) 如: 公共的Security配置 package com.central.workflow.config;import org.springframework.context.annotation.Configuration; import org.springframework.se…...

第T8周:猫狗识别

>- **🍨 本文为[🔗365天深度学习训练营](https://mp.weixin.qq.com/s/0dvHCaOoFnW8SCp3JpzKxg) 中的学习记录博客** >- **🍖 原作者:[K同学啊](https://mtyjkh.blog.csdn.net/)** 🍺 要求: 了解mode…...

第十七周:机器学习

目录 摘要 Abstract 一、MCMC 1、马尔科夫链采样 step1 状态设定 step2 转移矩阵 step3 马尔科夫链的生成 step4 概率分布的估计 2、蒙特卡洛方法 step1 由一个分布产生随机变量 step2 用这些随机变量做实验 3、MCMC算法 4、参考文章 二、flow-based GAN 1、引…...

算法4之链表

概述 链表的题目没有太难的算法,纯看熟练度,是必须会。面试笔试不会是直接挂的,或者给面试官留下不好的印象。 单双链表的反转,单链表实现队列,K个一组反转链表。 单链表反转 链表节点的定义 Data public class Li…...

掌握未来技术:KVM虚拟化安装全攻略,开启高效云端之旅

作者简介:我是团团儿,是一名专注于云计算领域的专业创作者,感谢大家的关注 座右铭: 云端筑梦,数据为翼,探索无限可能,引领云计算新纪元 个人主页:团儿.-CSDN博客 目录 前言&#…...

挖矿病毒的处理

前阶段生产服务器又中挖矿病毒了,紧急处理了一波 现象 执行 top命令,查看哪里cpu占用较高 CPU 彪满下不来 解决 1、杀掉进程 kill -9 pid 2、但是,过一会又不行了,说明有定时任务在定时执行这个病毒 3、先找到病毒文件&…...

JVM(HotSpot):GC之G1垃圾回收器

文章目录 一、简介二、工作原理三、Young Collection 跨代引用四、大对象问题 一、简介 1、适用场景 同时注重吞吐量(Throughput)和低延迟(Low latency),默认的暂停目标是 200 ms超大堆内存,会将堆划分为…...

appium文本输入的多种形式

目录 一、send_keys方法 二、press_keycode方法 三、subprocess方法直接通过adb命令输入 一、send_keys方法 这个是最常用的方法,不过通常使用时要使用聚焦,也就是先点击后等待: element wait.until(EC.presence_of_element_located((By…...

springboot095学生宿舍信息的系统--论文pf(论文+源码)_kaic

学生宿舍信息管理系统 摘要 随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了学生宿舍信息管理系统的开发全过程。通过分析学生宿舍信息管理系统管理的不足,创建了一个计算机管理学生宿舍信息管理系统的方…...

使用SQL在PostGIS中创建各种空间数据

#1024程序员节|征文# 一、目录 1. 概述 2. 几何(Geometry)类型 创建点 创建线 创建面 3. 地理(Geography)类型 地理点(GEOGRAPHY POINT) 地理线串(GEOGRAPHY LINESTRING&#xff…...

ArkTS 如何适配手机和平板,展示不同的 Tabs 页签

ArkTS(Ark TypeScript)作为HarmonyOS应用开发的主要语言,提供了丰富的组件和接口来适配不同设备,包括手机和平板。在展示不同的Tabs页签以适应手机和平板时,ArkTS主要依赖于布局和组件的灵活性,以及响应式设…...

Docker下载途径

Docker不是Linux自带的,需要我们自己安装 官网:https://www.docker.com/ 安装步骤:https://docs.docker.com/engine/install/centos/ Docker Hub官网(镜像仓库):https://hub.docker.com/ 在线安装docker 先卸载旧的docker s…...

Windows: 如何实现CLIPTokenizer.from_pretrained`本地加载`stable-diffusion-2-1-base`

参考:https://blog.csdn.net/qq_38423499/article/details/137158458 https://github.com/VinAIResearch/Anti-DreamBooth?tabreadme-ov-file 联网下载没有问题: import osos.environ["HF_ENDPOINT"] "https://hf-mirror.com" i…...

MySQL 9从入门到性能优化-慢查询日志

【图书推荐】《MySQL 9从入门到性能优化(视频教学版)》-CSDN博客 《MySQL 9从入门到性能优化(视频教学版)(数据库技术丛书)》(王英英)【摘要 书评 试读】- 京东图书 (jd.com) MySQL9数据库技术_夏天又到了…...

ARM学习(33)英飞凌(infineon)PSOC 6 板子学习

笔者来聊一下psoc62 系列板子的知识 1、PSOC62板子介绍 Psoc6-evaluationkit-062S2 与RT-Thread联合推出的一款32位的双core的板子,基于CortexM4以及CortexM0。 管脚兼容Arduio。板载DAP-Link,可以支持调试以及串口,无需外接2MB的Flash以及…...

华为原生鸿蒙操作系统的发布有何重大意义和影响:

#1024程序员节 | 征文# 一、华为原生鸿蒙操作系统的发布对中国的意义可以从多个层面进行分析: 1. 技术自主创新 鸿蒙操作系统的推出标志着中国在操作系统领域的自主创新能力的提升。过去,中国在高端操作系统方面依赖于外国技术,鸿蒙的发布…...

API 接口:连接生活与商业的数字桥梁

在当今数字化高速发展的时代,API(Application Programming Interface,应用程序编程接口)接口正以前所未有的深度和广度影响着我们的日常生活与商业决策。 一、API 接口在日常生活中的应用 智能出行 地图导航应用通过接入各种交通数…...

IEC101 JAVA开发记录

目录 JAVA Demo 仿真工具 平衡式与非平衡式 帧格式 固定帧格式 可变帧格式 单字节 控制域 主站到子站 子站至主站 位组成 链路地址 应用服务数据单元(ASDU) 类型标识TI 可变结构限定词(VSQ) 传送原因(COT) 信息体元素 带品质描述词的单点信息(SIQ) 带品…...

降压恒压150V供电 负载固定5V 持续0.6A电动车仪表供电芯片SL3150H

一、供电能力 高电压输入:SL3150H具备150V的供电能力,这意味着它可以在电动车的复杂电气环境中稳定工作,无论是面对高电压的输入还是电压波动较大的情况,都能保持稳定的输出。固定输出电压与电流:在输出方面&#xff…...

QT 从ttf文件中读取图标

最近在做项目时,遇到需要显示一些特殊字符的需求,这些特殊字符无法从键盘敲出来,于是乎,发现可以从字体库文件ttf中读取显示。 参考博客:QT 图标字体类IconHelper封装支持Font Awesome 5-CSDN博客 该博客封装的很不错…...

XCTF-web-easyupload

试了试php,php7,pht,phtml等,都没有用 尝试.user.ini 抓包修改将.user.ini修改为jpg图片 在上传一个123.jpg 用蚁剑连接,得到flag...

React Native 开发环境搭建(全平台详解)

React Native 开发环境搭建(全平台详解) 在开始使用 React Native 开发移动应用之前,正确设置开发环境是至关重要的一步。本文将为你提供一份全面的指南,涵盖 macOS 和 Windows 平台的配置步骤,如何在 Android 和 iOS…...

系统设计 --- MongoDB亿级数据查询优化策略

系统设计 --- MongoDB亿级数据查询分表策略 背景Solution --- 分表 背景 使用audit log实现Audi Trail功能 Audit Trail范围: 六个月数据量: 每秒5-7条audi log,共计7千万 – 1亿条数据需要实现全文检索按照时间倒序因为license问题,不能使用ELK只能使用…...

HTML 列表、表格、表单

1 列表标签 作用:布局内容排列整齐的区域 列表分类:无序列表、有序列表、定义列表。 例如: 1.1 无序列表 标签:ul 嵌套 li,ul是无序列表,li是列表条目。 注意事项: ul 标签里面只能包裹 li…...

04-初识css

一、css样式引入 1.1.内部样式 <div style"width: 100px;"></div>1.2.外部样式 1.2.1.外部样式1 <style>.aa {width: 100px;} </style> <div class"aa"></div>1.2.2.外部样式2 <!-- rel内表面引入的是style样…...

IT供电系统绝缘监测及故障定位解决方案

随着新能源的快速发展&#xff0c;光伏电站、储能系统及充电设备已广泛应用于现代能源网络。在光伏领域&#xff0c;IT供电系统凭借其持续供电性好、安全性高等优势成为光伏首选&#xff0c;但在长期运行中&#xff0c;例如老化、潮湿、隐裂、机械损伤等问题会影响光伏板绝缘层…...

OpenLayers 分屏对比(地图联动)

注&#xff1a;当前使用的是 ol 5.3.0 版本&#xff0c;天地图使用的key请到天地图官网申请&#xff0c;并替换为自己的key 地图分屏对比在WebGIS开发中是很常见的功能&#xff0c;和卷帘图层不一样的是&#xff0c;分屏对比是在各个地图中添加相同或者不同的图层进行对比查看。…...

高效线程安全的单例模式:Python 中的懒加载与自定义初始化参数

高效线程安全的单例模式:Python 中的懒加载与自定义初始化参数 在软件开发中,单例模式(Singleton Pattern)是一种常见的设计模式,确保一个类仅有一个实例,并提供一个全局访问点。在多线程环境下,实现单例模式时需要注意线程安全问题,以防止多个线程同时创建实例,导致…...

逻辑回归暴力训练预测金融欺诈

简述 「使用逻辑回归暴力预测金融欺诈&#xff0c;并不断增加特征维度持续测试」的做法&#xff0c;体现了一种逐步建模与迭代验证的实验思路&#xff0c;在金融欺诈检测中非常有价值&#xff0c;本文作为一篇回顾性记录了早年间公司给某行做反欺诈预测用到的技术和思路。百度…...

BLEU评分:机器翻译质量评估的黄金标准

BLEU评分&#xff1a;机器翻译质量评估的黄金标准 1. 引言 在自然语言处理(NLP)领域&#xff0c;衡量一个机器翻译模型的性能至关重要。BLEU (Bilingual Evaluation Understudy) 作为一种自动化评估指标&#xff0c;自2002年由IBM的Kishore Papineni等人提出以来&#xff0c;…...