Iam searching for an good implementation to protect my Backend written in PHP.
Scenario:
Server 1 (www.domain.com) Servers only JS/HTML to the Client
Server 2 (www.domain2.com) Is Running an PHP Server wich is responding to Server 1 with JSON Data (rendered by an Javascript Template engine on Sevrer1).
How can i stop others to grab the JSON Response from Server1? I know i can add somekind of API key but it is stored in JS (everyone can read it), i know i could check if the request is from Server 1 IP, but it is not a big deal to fake such a request.