JAVA-020 / Beginner
Disabling Spring Security CSRF (csrf().disable())
Why is this a problem?
Cross-site requests pass through session-cookie-based APIs.
How to fix it
java
http.csrf(csrf -> csrf.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()));
// Disable only for purely token-based (Bearer) APIs and document the reason