최종 변경 : 2024.01.19
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http
.csrf((csrf) -> csrf.disable());
http
.formLogin((login) -> login.disable());
http
.httpBasic((basic) -> basic.disable());
http
.oauth2Login(Customizer.withDefaults());
http
.authorizeHttpRequests((auth) -> auth
.requestMatchers("/", "/oauth2/**", "/login/**").permitAll()
.anyRequest().authenticated());
return http.build();
}
}