Spring Security + Ajax 호출 시 CSRF 관련 403 Forbidden 에러
Spring Security를 이용할 경우 Ajax의 POST 호출 시 403 Forbidden 에러가 발생합니다. 처음에는 Ajax 문제가 아니라 특정 URL(특히, REST로 만들어진 URL)에 대해 Path 권한 설정이 잘못되었나 생각하고 Path의 권한 설정 부분을 확인하였습니다. @Override protected void configure(HttpSecurity http) throws Exception { http .csrf() .and() .addFilterAfter(new CsrfCookieGeneratorFilter(), CsrfFilter.class)