Spring Securirty 6 ์ด์ ๋ฒ์ ์์ h2-console 403 ์๋ฌ ๋๋ ๋ฌธ์
BACKEND/Spring
2023. 1. 23. 17:41
๊ธฐ์กด์ ํ๋ ๊ฒ ์ฒ๋ผ http.requestMatchers("/h2-console/**").permitAll() ๋ก h2-console์ ๋ํ ์ ๊ทผ์ ํ์ฉํด์ฃผ๋ ค๊ณ ํ์ง๋ง ๊ณ์ํด์ 403(forbidden) ์๋ฌ๊ฐ ๋ฌ๋ค. ๊ตฌ๊ธ๋ง์ ํตํด ํด๊ฒฐํ ๊ฒฐ๊ณผ @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http.authorizeHttpRequests() .requestMatchers("/users/**").permitAll() .and() .authorizeHttpRequests(auth -> auth .requestMatchers(AntPathRequestMatcher.antMatcher("/h2-console/..