inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của dawonhyun6078

dawonhyun6078 dawonhyun6078

@dawonhyun6078

Số lượng đánh giá đã viết
-
Xếp hạng trung bình
-

Bài viết 1

Hỏi & Đáp

스프링 시큐리티 문의 (webSecurityConfigurerAdapter 취소선)

authenticationManager 빈을 하나 생성하셔서 사용하시면 될 것 같습니다. @Bean AuthenticationManager authenticationManager(AuthenticationConfiguration authConfiguration) throws Exception { return authConfiguration.getAuthenticationManager(); } @Bean public SecurityFilterChain configure(HttpSecurity http) throws Exception { AuthenticationManager authenticationManager = authenticationManager(http.getSharedObject(AuthenticationConfiguration.class)); http.~~~ .addFilter(getAuthenticationFilter(authenticationManager)); return http.build(); } private AuthenticationFilter getAuthenticationFilter(AuthenticationManager authenticationManager) { AuthenticationFilter authenticationFilter = new AuthenticationFilter(authenticationManager); return authenticationFilter; } 또는 @Bean public SecurityFilterChain configure(HttpSecurity http) throws Exception { http.~~~ .addFilter(getAuthenticationFilter(http)); return http.build(); } private AuthenticationFilter getAuthenticationFilter(HttpSecurity http) { AuthenticationFilter authenticationFilter = new AuthenticationFilter(http.getSharedObject(AuthenticationConfiguration.class)); return authenticationFilter; } 이렇게 추가하시고 AuthenticationFilter에서는 @RequiredArgsConstructor public class AuthenticationFilter extends UsernamePasswordAuthenticationFilter{ private final AuthenticationManager authenticationManager; //attemptAuthentication //successAuthentication } 이렇게 적용해보시면 될 듯합니다.

Lượt thích
0
Số bình luận
1
Lượt xem
1866