Rob Winch 39c43159f4 Convert to Asciidoctor Tabs
Closes gh-13403
2023-06-18 21:30:41 -05:00

32 lines
435 B
Plaintext

= Testing with CSRF
Spring Security also provides support for CSRF testing with `WebTestClient`.
For example:
[tabs]
======
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")
...
----
======