In Spring-Security with Java Config, why does httpBasic POST want csrf token?
CSRF protection is enabled by default with Java configuration. To disable it: @Configuration public class RestSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .csrf().disable() …; } }