Camunda BPM:CSRFPreventionFilter:无效的 HTTP Header 令牌
Camunda BPM : CSRFPreventionFilter: Invalid HTTP Header Token
我开始使用 camunda BPM,所以我使用 https://start.camunda.com/ 创建 camunda spring 启动应用程序。我已经创建了具有 dummy/dummy 凭据的管理员用户 我有 kepy spring 安全选项 as off there as start.
启动器设置一目了然:
当我启动应用程序时,每当我使用我的信用时都会收到以下错误:
Login Failed :
CSRFPreventionFilter: Invalid HTTP Header Token
我在 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));
}
}
礼貌:
https://forum.camunda.org/t/how-to-disable-csrfpreventionfilter/13095/8
我开始使用 camunda BPM,所以我使用 https://start.camunda.com/ 创建 camunda spring 启动应用程序。我已经创建了具有 dummy/dummy 凭据的管理员用户 我有 kepy spring 安全选项 as off there as start.
启动器设置一目了然:
当我启动应用程序时,每当我使用我的信用时都会收到以下错误:
Login Failed :
CSRFPreventionFilter: Invalid HTTP Header Token
我在 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));
}
}
礼貌: https://forum.camunda.org/t/how-to-disable-csrfpreventionfilter/13095/8