File tree Expand file tree Collapse file tree 2 files changed +0
-20
lines changed
java/com/rightmark/global/config Expand file tree Collapse file tree 2 files changed +0
-20
lines changed Original file line number Diff line number Diff line change 11package com .rightmark .global .config ;
22
3- import jakarta .servlet .http .HttpServletResponse ;
43import org .springframework .context .annotation .Bean ;
54import org .springframework .context .annotation .Configuration ;
65import org .springframework .security .authentication .AuthenticationManager ;
@@ -42,24 +41,6 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
4241 .cors (cors -> cors .configurationSource (corsConfigurationSource )) // CORS 설정 추가
4342 .sessionManagement (sm ->
4443 sm .sessionCreationPolicy (SessionCreationPolicy .STATELESS )) // 세션 미사용
45-
46- // FE 배포로 인한 우회 인증
47- .formLogin (form -> form .disable ())
48- .httpBasic (basic -> basic .disable ())
49-
50- .exceptionHandling (ex -> ex
51- .authenticationEntryPoint ((req , res , e ) -> {
52- res .setStatus (HttpServletResponse .SC_UNAUTHORIZED ); // 401
53- res .setContentType ("application/json;charset=UTF-8" );
54- res .getWriter ().write ("{\" message\" :\" UNAUTHORIZED\" }" );
55- })
56- .accessDeniedHandler ((req , res , e ) -> {
57- res .setStatus (HttpServletResponse .SC_FORBIDDEN ); // 403
58- res .setContentType ("application/json;charset=UTF-8" );
59- res .getWriter ().write ("{\" message\" :\" FORBIDDEN\" }" );
60- })
61- )
62-
6344 .authorizeHttpRequests (auth -> auth
6445 .requestMatchers (
6546 "/api/users/register" , "/api/users/login" ,
Original file line number Diff line number Diff line change @@ -170,7 +170,6 @@ spring:
170170 user-name-attribute : id
171171
172172server :
173- forward-headers-strategy : framework
174173 jackson :
175174 property-naming-strategy : SNAKE_CASE
176175
You can’t perform that action at this time.
0 commit comments