강의

멘토링

커뮤니티

Inflearn Community Q&A

dingdong0814's profile image
dingdong0814

asked

Spring Security

6) Remember Me Authentication

UserDeailsService를 Autowired 하지 못하는 오류 문의드립니다.

Written on

·

1.7K

0

 
안녕하세요 7:26 강의 부분에서 UserDetailsService를 Autowired하였는데요.
 
Could not autowire. No beans of 'UserDetailsService' type found. 라고 뜨면서 빨간줄이 생겼습니다.
 
스프링 부트 최신 버전으로 사용하고 있어서 WebSecurityConfigurerAdapter 경우도 deprecated 되었지만..
버전의 문제인지 문의드립니다...
버전의 영향이 크다면 낮추고 진행해야 할까요?
spring-bootjavaSpring Security

Answer 3

3

최근 버전에서는 WebSecurityConfigurerAdapter 를 상속받지않고

SecurityFilterChain을 빈으로 등록하여 구현하므로 userDetailsService를 수동으로 설정하지 않아도 되는것 같습니다...

 

아래는 WebSecurityConfigurerAdapter 없이 설정하는 방법입니다.

https://spring.io/blog/2022/02/21/spring-security-without-the-websecurityconfigureradapter

0

bean 이 없어도 정상적으로 작동하네요 ...?

0

dingdong0814님의 프로필 이미지
dingdong0814
Questioner

일단 스프링 버전을 낮춰서 해결했습니다..!

dingdong0814's profile image
dingdong0814

asked

Ask a question