I am having a real hard time to figure this out. Spent around 4 hours crawling the web no SO post to save me.
Imagine a scenario:
I have already written a chrome extension, that captures some particular actions on the webpage (mainly a button click). That action triggers a function, that captures the some user info and button info (all present on the page itself) and displays it
Now i want that the plugin should be able to update this into a database setup on a remote server.
Since I am fluent in PHP (and thus MySQL is good choice), I am looking for a solution to make sure that the updates are made ONLY AND ONLY from the extension itself.
For this I think the best option would be to run a GET/POST request something like http://remoteserver.tld/update-db.php?id=XXXX&action=YYYYY&foo=bar.... etc. But what happens if the user opens/passes post vars to this url outside plugin?
The data will still be updated and integrity will be lost!
The next best idea was to include keys with request, but again the extensions are written in JS, almost anyone can sniff out the keys.
Guide me to the best method to update the database on the remote server and make sure the action is authenticated.
Cheers!