WebSecurity 설정 관련해서 문의드립니다
안녕하세요
아래와 같이 설정을 하고 테스트를 하고 있습니다.
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.mvcMatchers("/", "/info").permitAll()
.mvcMatchers("/user").hasRole("USER")
.mvcMatchers("/admin").hasRole("ADMIN")
.anyRequest().authenticated()
.and().formLogin()
.and().httpBasic();
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring()
.mvcMatchers( "/account/**") // fixme. 이건 왜 안되지?
.requestMatchers(
PathRequest.toStaticResources().atCommonLocations()
);
}
이 상태에서 /account/** 가 ignore 되어 있으므로 인가 Filter 적용이 안되어야 할텐데요
http://localhost:8082/account/ADMIN/A/B
이걸 2번 연속으로 수행하게 되면 로그인 페이지로 이동하게 됩니다.
서버 콘솔은 500 에러가 나오는데... 프론트 페이지는 로그인으로 이동하는것으로 나오는데요. 혹시 이유가 무엇일까요?