I want to log every login attempts on a Web App (Symfony 4.1) hosted on Azure.
Based on this question, to get the client IP, I'm using :
// $requestStack being Symfony\Component\HttpFoundation\RequestStack
$ip = $this->requestStack->getMasterRequest()->getClientIp();
However, the logs tell :
[2020-03-10 10:55:56] login_attempt.INFO: User 'username' successfully logged in from ip '172.16.1.1' [] []
As you can notice, this is a private IP. I tried to log in from differents connections, but I'm always getting that IP, 172.16.1.1
. Where does this IP come from and how to get the real public IP of the client ?