We have following security configure code,
@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}
We need to restrict below requests (not for all requests) in Spring Boot application and allow these requests only on given ipaddress (multiple ipaddress)
in properties.