CSRF によるテスト
Spring Security は、WebTestClient
を使用した CSRF テストのサポートも提供します。例:
Java
Kotlin
import static org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf;
this.rest
// provide a valid CSRF token
.mutateWith(csrf())
.post()
.uri("/login")
...
import org.springframework.security.test.web.reactive.server.SecurityMockServerConfigurers.csrf
this.rest
// provide a valid CSRF token
.mutateWith(csrf())
.post()
.uri("/login")
...