【发布时间】:2020-05-09 13:33:48
【问题描述】:
我们有以下安全配置代码,
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception {
httpSecurity.cors().and().csrf().disable().authorizeRequests().antMatchers("/api/**").anyRequest()
.authenticated().and().exceptionHandling().accessDeniedPage("/").and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
}
GET /api/users
POST /api/users
GET /api/users/{userId}
我们需要在 Spring Boot 应用程序中限制以下请求(并非针对所有请求),并仅在属性中的给定 ipaddress (multiple ipaddress) 上允许这些请求。
【问题讨论】:
标签: spring-boot spring-security-rest