Assuming I have the following class code:
@EnableWebSecurity
@Configuration
public static class ApiWebSecurityConfigurationAdapter extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/api/**").hasIpAddress("runtime other device ip");
}
}
at runtime, when a request is entering the system, I want to validate it came from "runtime other device ip", which can be different at time the request retrieved.
Please assume I have a utility that can retrieve this "runtime other device ip" Utility.getOtherDeviceIP();
Any ideas?
Thanks