SpringSecurity
-
[오류 기록] Custom WebSecurityConfigurerAdapter가 적용되지 않음Spring 2022. 6. 26. 07:32
문제 WebSecurityConfigurerAdapter을 상속받은 SecurityConfig 클래스에서 configure 메서드를 오버라이딩하여 인증을 선택적으로 적용하였다. "/" 은 permitAll을 적용한 url중 하나인데 /페이지에 접속하면 인증을 요구하였다. 원인 SecurityConfig 클래스가 포함된 oauth2 패키지가 @SpringBootApplication을 포함하고 있는 DeveloperCommunityApplication.kt 파일을 포함하는 프로젝트 패키지에 포함되어 있지 않았다. 따라서 ComponentScan의 적용 대상이 되지 않았다. 시도한 해결방법 oauth2 패키지를 developercommunity 패키지(프로젝트 패키지) 하위로 옮겼다. (애초에 왜 밖에다 만들..