views:

70

answers:

3

Just to be on the safe side, what's the best practice to ensure that only my application has access to my webservice, which is hosted on a public server? Should I implement I shared key or something?

My webservice is hosted on Googles App Engine and my Application runs on iPhones and iPads.

If you need further information, just ask.

Thanks, Henrik

+2  A: 

some sort of challenge/response authentication would be your best bet, but you could use something as simple as a key that's sent with every request. it might be quite easy for someone with a packet sniffer to reverse engineer that security though - i guess the amount of time you spend on it will relate to how much you really care :)

oedo
+1  A: 

You could program your app to only serve requests that include your iPhone's unique identier - see StackOverflow question [Unique identifier for an iPhone app]. The id could still be sniffed, so depending on your needs, you may need methods to counter that.

Bert F
+1  A: 

If you require your iphone app users to enter a loginid/password, then it is trivial to achieve what you want. But I assume you don't want that ..

Without that, there is no way to ensure you app has exclusive access to your web-services. People can always sniff HTTP traffic and spoof it. People can decompile/reverse-engineer your app to figure out the key/password.

See other discussions on StackOverflow - http://stackoverflow.com/questions/2578645/how-to-restrict-access-to-my-web-service and http://stackoverflow.com/questions/2601805/how-can-i-create-and-use-a-web-service-in-public-but-still-restrict-its-use-to-on

sri
+1 for pointing out the related/duplicate posts
slugster