Pra*_*kam 4 java spring business-process-management camunda spring-boot
我从 camunda BPM 开始,所以我使用https://start.camunda.com/创建 camunda spring boot 应用程序。我已经使用虚拟/虚拟凭据创建了管理员用户,我在那里设置了 kepy spring 安全选项作为开始。
当我启动应用程序时,每当我使用我的凭据时都会出现以下错误:
Login Failed :
CSRFPreventionFilter: Invalid HTTP Header Token
Run Code Online (Sandbox Code Playgroud)
我在 application.yml 中没有看到任何相关设置
看起来给定版本的 Camunda 存在错误。为了手动抑制 CSRFFilter 我添加了以下配置。之后它现在正在工作。
package com.example.workflow;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class CsrfAutoConfiguration {
private static final String CSRF_PREVENTION_FILTER = "CsrfPreventionFilter";
/**
* Overwrite csrf filter from Camunda configured here
* org.camunda.bpm.spring.boot.starter.webapp.CamundaBpmWebappInitializer
* org.camunda.bpm.spring.boot.starter.webapp.filter.SpringBootCsrfPreventionFilter
* Is configured with basically a 'no-op' filter
*/
@Bean
public ServletContextInitializer csrfOverwrite() {
return servletContext -> servletContext.addFilter(CSRF_PREVENTION_FILTER, (request, response, chain) -> chain.doFilter(request, response));
}
}
Run Code Online (Sandbox Code Playgroud)
礼貌:https : //forum.camunda.org/t/how-to-disable-csrfpreventionfilter/13095/8
| 归档时间: |
|
| 查看次数: |
1341 次 |
| 最近记录: |