# Testing with CSRF

Spring Security also provides support for CSRF testing with `WebTestClient`.
For example:

Java

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

Kotlin

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

[Testing Authentication](authentication.html)[Testing OAuth 2.0](oauth2.html)

