# 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 AuthenticationTesting OAuth 2.0