当前位置: 首页 > 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博客 该博客封装的很不错…...

JS动态调用变量

当存在多个变量checkbox1、checkbox2、checkbox3、checkbox4的变量时 -常规调用:if(条件A){this.$refs.checkbox1.check true }if(条件B){this.$refs.checkbox2.check true } 或者使用switch case-动态调用: var result 2 // 在dom渲染完成再给checkbox赋值this.$nextTick…...

django restful API

文章目录 项目地址一、django环境安装以及初识restful1.1 安装python 3.10的虚拟环境1.2 创建django工程文件1.3 创建一个book app1.4 序列化(Django JsonResponse)1.4.1创建一个Models1.4.2 创建django的超级用户admin1.4.3 添加serializers.py生成序列化器1.5 FBV创建视图1…...

在xml 中 不等式 做转义处理的问题

对于这种要做转义处理&#xff0c;<![CDATA[ < ]]>...

python——文件存储与写入path

path方法常常用来访问一个文件所在的地址&#xff0c;然后将地址储存在变量中。然后有不同的方法将文件内容进行处理&#xff0c;还可以将文件进行创建。 from pathlib import Path pathPath(xxxxxxx) 1.文件读取操作 (1)txt文件 常用read_text()读取文件内容&#xff0c; …...

AI 提示词(Prompt)入门 :ChatGPT 4.0 高级功能指南

这段时间 GPT4 多了很多功能&#xff0c;今天主要是增加了 GPTs Store 的介绍和 创建 GPTs 的简单方法&#xff0c;那么我们开始吧&#xff0c;文末有彩蛋。 这里主要讲解如下几个点&#xff1a; 1&#xff1a; ChatGPT 4.0 插件的使用 2&#xff1a;ChatGPT 4.0 高级数据分…...

C++:模板

目录​​​​​​​ 一.泛型编程 二.模板 函数模板 类模板 一.泛型编程 在C中&#xff0c;支持函数重载&#xff0c;如果我们通过函数重载实现通用的交换函数&#xff0c;写法如下&#xff1a; void Swap(int& left, int& right) {int temp left;left right;ri…...

假如浙江与福建合并为“浙福省”

在中国&#xff0c;很多省份之间的关系颇有“渊源”&#xff0c;例如河南与河北、湖南与湖北、广东与广西等等&#xff0c;他们因一山或一湖之隔&#xff0c;地域相近、文化相通。 但有这么两个省份&#xff0c;省名没有共通之处&#xff0c;文化上也有诸多不同&#xff0c;但…...

AI图片生成3D物体和2D视频提取3D动画

包括AI图片生成3D物体的网站&#xff1a; 第一个为Artefacts.AIhttps://app.artefacts.ai/starter 第二个为 https://3d.csm.ai/ 以下4个的视频教程连接https://www.youtube.com/watch?vmQQCyzTA_F8 第三个为Tripo AI: Tripo AI for Web 第四个为Meshy AI: Meshy - Free …...

Android 应用包名的定义 pm list packages查询的包名

问题 在AndroidManifest和build.gradle其实都有应用包名的定义&#xff0c;有时候发现两者不一样&#xff0c;那么最终编译到软件生效的是哪个呢&#xff1f; 现象 连接设备后&#xff0c;通过adb shell pm list packages 查询应用包名&#xff0c;所列的名称是在build.grad…...

递归相关练习

21. 合并两个有序链表 - 力扣&#xff08;LeetCode&#xff09; 重复子问题&#xff1a;将l1的头节点跟l2的头结点比较 得到一个较小的头节点l1 随后继续比较 将l1后面一个节点跟l2第一个节点比较 又得到一个较小的节点 不断下去 递归出口&#xff1a;当l1或者l2为空时候 返回…...