springboot 的F版本以后spring-boot-security不拦截设置

@SpringBootApplication
@EnableEurekaServer
@EnableWebSecurity
public class EurekaStarter extends WebSecurityConfigurerAdapter {
public static void main(String[] args) {
SpringApplication.run(EurekaStarter.class,args);
}

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable()
            .authorizeRequests()
            .antMatchers("/actuator/**").permitAll()
            .antMatchers("/eureka/**").permitAll()
            .anyRequest()
            .authenticated().and().httpBasic();
}
发布了52 篇原创文章 · 获赞 0 · 访问量 3991

猜你喜欢

转载自blog.csdn.net/qq_44813090/article/details/104245669
今日推荐