예제 앱을 기반으로 스프링 부트 - 보안 프로젝트를 만들었지 만 나머지 컨트롤러는 제대로 작동하지만 나머지 리소스에 액세스 할 수는 있지만 보안 기능이 전혀 작동하지 않는 것 같습니다 그래서 아래 명시된 바와 같이 중단 점을 추가하면 중단되지 않습니다. 이유를 모르겠다.스프링 보안 - 인증이 작동하지 않음
@Configuration
@EnableWebSecurity
public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// @formatter:off
auth.inMemoryAuthentication() // breakpoint here
.withUser("roy")
.password("spring")
.roles("ADMIN");
// @formatter:on
}
@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
}
여기 Codio와 호스팅 및 편집 가능한 전체 프로젝트입니다 : http://bit.ly/1uFI0t5
@EnableAutoConfiguration 주석을 추가하십시오. –
그래, 내가 그 – xybrek