You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
418 B
28 lines
418 B
= 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") |
|
... |
|
---- |
|
====
|
|
|