Существует следующее свойство:
security.enable-csrf=false
НО защита csrf все еще включена, если я добавляю свойство в application.properties.
Что работает, так это отключить его программно.
Но я бы предпочел настройку свойств. Почему это может не работать?
@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();
}
}
Подробнее здесь: https://stackoverflow.com/questions/448 ... properties