Spring Boot中集成Spring Security 专题
check to see if spring security is applied that the appropriate resources are permitted: @Configuration public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { @Override public void configure(WebSecurity web) throws Exception { http .csrf().disable() .exceptionHandling() .authenticationEntryPoint(unauthorizedHandler) .accessDeniedHandler(accessDeniedHandler) .and() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() .authorizeRequests() // .antMatchers("/actuator/**").permitAll() .antMatchers("/actuator/**").hasAuthority("ADMIN" )