I have a web app written in Java using Spring as a backend framework. This application is running on AWS ElasticBeanstalk with an Application Load Balancer. I was wondering how can I get the IP of all the users sending requests to my web app.
[EDIT 1] I noticed that just by doing this I correctly get my ip address.
@GetMapping
public String processData(HttpServletRequest request) {
String ipAddress = request.getRemoteAddr());
}
I don't know if there are particular cases in which this does not work.