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

Camunda rest api鉴权

对于rest api 不能没有限制的任何人随意调用,需要提供账号信息。

一:工作流引擎增加过滤器

/*** 对/engine-rest/*进行鉴权,防止非法攻击* 客户端调用需要配置用户凭证否则报错401* camunda.bpm.client.basic-auth.username=* camunda.bpm.client.basic-auth.password=*/
@Configuration
public class AuthFilterConfig implements ServletContextInitializer {@Overridepublic void onStartup(ServletContext servletContext) throws ServletException {FilterRegistration.Dynamic authFilter = servletContext.addFilter("camunda-auth", ProcessEngineAuthenticationFilter.class);authFilter.setAsyncSupported(true);authFilter.setInitParameter("authentication-provider","org.camunda.bpm.engine.rest.security.auth.impl.HttpBasicAuthenticationProvider");authFilter.addMappingForUrlPatterns(null,true,"/engine-rest/*");}
}

二:客户端配置账号

camunda:bpm:client:base-url: http://localhost:8080/engine-restmax-tasks: 1worker-id: springboot-camunda-clientasync-response-timeout: 20000lock-duration: 10000basic-auth:username: adminpassword: 123456
http://www.lryc.cn/news/276722.html

相关文章:

  • 【PostgreSQL】在DBeaver中实现序列、函数、视图、触发器设计
  • PyQt5-小总结
  • vue父组件给子组件传值,子组件不渲染的原因及解决方法
  • 【数据库】MySQL锁
  • mongodb学习篇
  • kubernetes存储类迁移-备份恢复
  • python智能手机芯片
  • 混淆技术概论
  • pytest安装失败,报错Could not find a version that satisfies the requirement pytest
  • 使用 Maven 的 dependencyManagement 管理项目依赖项
  • 三英战吕布web3游戏项目启动全流程
  • TS中的类
  • 玩转硬件之玩改朗逸中控设备
  • 根据MySql的表名,自动生成实体类,模仿ORM框架
  • Mac上安装tensorflow介绍留存
  • 【赠书第16期】码上行动:用ChatGPT学会Python编程
  • LeetCode 每日一题 2024/1/1-2024/1/7
  • 7+单细胞+空转+实验验证,如何根据内容开展相关经验给你启发
  • Verifiable Credentials可验证证书 2023 终极指南
  • R语言【sp】——SpatialPoints():创建类SpatialPoints或SpatialPointsDataFrame的对象
  • 【Verilog】期末复习——简要说明仿真时阻塞赋值和非阻塞赋值的区别。always语句和initial语句的关键区别是什么?能否相互嵌套?
  • 分享一个idea插件MyBatisX的Bug
  • Linux网络
  • Copilot 插件的使用介绍:如何快速上手
  • kubesphere和k8s的使用分享
  • macos m1如何安装指定版本的redis
  • python 多线程 守护线程
  • 以unity技术开发视角对android权限的讲解
  • 910b上跑Chatglm3-6b进行流式输出【pytorch框架】
  • 2024年江苏省职业院校技能大赛高职学生组软件测试—任务五接口测试题目