[英]Camunda BPM : CSRFPreventionFilter: Invalid HTTP Header Token
我從 camunda BPM 開始,所以我使用https://start.camunda.com/創建 camunda spring 引導應用程序。 我已經使用虛擬/虛擬憑據創建了管理員用戶,我將 spring 安全選項設置為在開始時關閉。
當我啟動應用程序時,每當我使用我的信用時,我都會收到以下錯誤:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.