Files
spring-security/docs/modules/ROOT/pages/reactive/test/web/csrf.adoc
Rob Winch 2fb056b5c1 Merge Clean up Reference Documentation
Closes gh-9668
2021-12-13 16:57:36 -06:00

28 lines
420 B
Plaintext

= Testing with CSRF
Spring Security also provides support for CSRF testing with `WebTestClient` -- for example:
====
.Java
[source,java,role="primary"]
----
this.rest
// provide a valid CSRF token
.mutateWith(csrf())
.post()
.uri("/login")
...
----
.Kotlin
[source,kotlin,role="secondary"]
----
this.rest
// provide a valid CSRF token
.mutateWith(csrf())
.post()
.uri("/login")
...
----
====