跳到主要内容

测试 CSRF

QWen Max 中英对照 Testing CSRF Testing with CSRF

Spring Security 也提供了对使用 WebTestClient 进行 CSRF 测试的支持 —— 例如:

import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf;

this.rest
// provide a valid CSRF token
.mutateWith(csrf())
.post()
.uri("/login")
...
java