inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

안승현님의 게시글

안승현 안승현

@rabbit125834668

수강평 작성수
1
평균평점
5.0

게시글 1

질문&답변

Spring Boot 최신 3.XX 버전 Security 설정 공유드립니다.

boot 3.3.5 기준 @Configuration @EnableWebSecurity public class WebSecurity { private static final String[] WHITE_LIST = { "/users/**", "/**" }; @Bean public SecurityFilterChain config(HttpSecurity http) throws Exception { http .csrf(AbstractHttpConfigurer::disable) // CSRF 비활성화 .headers(headers -> headers .frameOptions(HeadersConfigurer.FrameOptionsConfig::disable) // X-Frame-Options 비활성화 ) .authorizeHttpRequests(authorize -> authorize .requestMatchers(WHITE_LIST).permitAll() // 특정 경로 허용 .anyRequest().authenticated()); // 나머지 요청은 인증 필요 return http.build(); } }

좋아요수
18
댓글수
7
조회수
10108