A website requests a URL from a remote RESTful API which then returns a JSON object with sensitive data.
How can I protect that call coming from the "client"? If I send any headers or post data for authentication (keys, credentials, etc.) it's still gonna be visible to the user and defeats the purpose.
Basically, how can I make sure that someone can't call the same URL I'm calling through AJAX in their browser and protect the sensitive data? If I use post parameters, they'll be visible in the javascript code.
$.post({
url: ...,
username: ...,
password: ...,
key: ...,
...
});