I’m sending data from an Android app to a php script which recieves the information and procces it, I’ve found a security issue: if someone discovered the url (for example: mydomain.com/recievedata.php), anyone would be able to send data to my system.
What’s the ideal method to ensure the client sending the data is the app?
Thanks!
One easy way that I’ve seen some companies do is to include a secret key. For example, you might have a
secret=3CH6knCsYmvA2va8GrHk4mf3JqmUctCMparameter to your POST data. Then all you need at the top ofreceivedata.phpisYou can easily generate the random string from random.org.
Of course, this is not the most secure method and that string might well be stored in plaintext in the APK (don’t use this to send launch codes!), but it’s easy and good enough to keep most people out. This might be adequate for, say, sending player scores for a game.