title: How to disable csrf in Spring using application.properties?
body: <p>The following property exists:</p>
  
  <p><code>security.enable-csrf=false</code></p>
  
  <p>BUT csrf protection is still on if I add the property to <code>application.properties</code>.</p>
  
  <p>What works is to disable it programatically.</p>
  
  <p>But I'd prefer properties configuration. Why could it not be working?</p>
  
  <pre><code>@Configuration
  public class AuthConfig extends WebSecurityConfigurerAdapter {
      @Autowired
      private UserDetailsService userDetailsService;
  
      @Override
      protected void configure(AuthenticationManagerBuilder auth) throws Exception {
          auth.userDetailsService(userDetailsService).passwordEncoder(new BCryptPasswordEncoder());
      }
  
      @Override
      protected void configure(HttpSecurity http) throws Exception {
          super.configure(http);
          http.csrf().disable();
  
      }
  }
  </code></pre>