Skip to content

Commit

Permalink
[fix] SecurityConfig csrf 설정 비활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
SoulTree-Lovers committed Aug 21, 2024
1 parent 9a5516a commit cdc3f3c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.core.env.Environment;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
Expand All @@ -29,6 +30,7 @@ public SecurityConfig(Environment env) {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.csrf(AbstractHttpConfigurer::disable) // csrf 설정 비활성화
.authorizeHttpRequests(authorizeRequests ->
authorizeRequests
.requestMatchers("/swagger-ui/**", "/v3/api-docs/**").hasRole("ADMIN")
Expand Down

0 comments on commit cdc3f3c

Please sign in to comment.