I know that there are already a lot of questions about this but I didn't find any answers that suits me...
I am creating a site where you can identify yourself to access a specific page. I am doing the authentication with Angular (so, by calling a REST API). I'm planning to use SSL to avoid sniffing but I'd like to prevent a user to make a tons of call to the REST API to find the password of someone (using brute force for example).
So I told myself that I could simply put a maximum number of attempt by 15' for a specified account, but I don't want an account to be blocked for the real user because someone else is trying to hack it. So I'd like to identify attempts with the IP address of the user but apparently, the only IP I can trust is $_SERVER["REMOTE_ADDR"] but I also read that if the user uses a proxy, the IP will be the proxy one so it's not really what I want. I guess that a good hacker could easily change its proxy IP and then be able to resume his attack...
So what would be the best way to prevent that ?