File tree 1 file changed +3
-0
lines changed
src/main/java/gdsc/konkuk/platformcore/global/configs
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 19
19
import org .springframework .security .web .SecurityFilterChain ;
20
20
import org .springframework .security .web .access .AccessDeniedHandler ;
21
21
import org .springframework .security .web .authentication .UsernamePasswordAuthenticationFilter ;
22
+ import org .springframework .web .cors .UrlBasedCorsConfigurationSource ;
22
23
23
24
@ Configuration
24
25
@ EnableWebSecurity
@@ -30,6 +31,7 @@ public class SecurityConfig {
30
31
private final CustomAuthenticationFailureHandler customAuthenticationFailureHandler ;
31
32
private final CustomOAuthUserService customOAuthUserService ;
32
33
private final GoogleOidcConfig googleOidcConfig ;
34
+ private final UrlBasedCorsConfigurationSource corsConfigurationSource ;
33
35
34
36
@ Bean
35
37
@ Order (2 )
@@ -40,6 +42,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws
40
42
response .setStatus (HttpServletResponse .SC_FORBIDDEN );
41
43
42
44
httpSecurity
45
+ .cors (cors -> cors .configurationSource (corsConfigurationSource ))
43
46
.csrf (AbstractHttpConfigurer ::disable )
44
47
.sessionManagement (session -> session
45
48
.sessionCreationPolicy (SessionCreationPolicy .STATELESS ))
You can’t perform that action at this time.
0 commit comments