oauth2 (리소스 서버)와 올바르게 작동하는 스프링 부팅 응용 프로그램이 있습니다. 사용자 정의 configure(HttpSecurity http)
메소드가 없습니다. 전용oauth2를 사용하여 스프링 보안을위한 사용자 지정 구성을 추가 할 수 없습니다.
spring-boot-starter-security
spring-security-oauth2
spring-security-jwt
이 pom에 추가됩니다.
이제 보호되지 않아야하는 끝점을 추가하고 싶습니다. 그래서 (많은 SO 응답을 다음) 내가 추가 시작 :
@Configuration
public class Security extends ResourceServerConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
}
}
을하고 내가 가지고 :
Cannot apply org.springframework.security.config.[email protected]6513fd22 to already built object
전체 오류 :
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.IllegalStateException: Cannot apply org.springframework.security.config.[email protected]6513fd22 to already built object
그래서 내가 어떻게 추가 내 보안을 구성해야합니다 익명 액세스를위한 끝점?