views:

107

answers:

1

I want to offer a "highscore" list for friends in my app (at this point iPhone/iPad), so that if the user connected to facebook, he will get a list with his/her friends scores.

Connecting is easy, retrieving friends is easy, but figuring out the best way to store the scores is not.

As it seems I need to the store the scores on my own server server, no big deal. But what is considered a reasonable safe way to transfer the data? When communicating with facebook, authentication is clear - but communicating with my server basically anyone could post scores for another user if I send user id and score. Obfuscation might help a bit, but is there any better way to make sure that the data comes from the fb-logged-in person?

Scores can also go down, so changing scores for other persons won't necessary help them.

Thanks :)

A: 

You can try sending the Facebook session information to your server, and then seeing if you can perform a simple Facebook API read operation using that session. If successful, then that's the actual user. If not, then it isn't.

Yuliy
I don't think sending user credentials or session info to a third party server and then initiating fake calls is acceptable for users, and it might get blocked easily. Thinking about sending tokens around to sign the data and storing device ids as well, so attacks could be spotted more easily. Manipulation of one's own score is harmless (and fairly easy anyway), I just want to shut the door towards attacks on other people scores (which seems unluckly anway, but don't want to make it plain easy).
Eiko
I can't think of any nicer methods of proving that the phone has a session with Facebook (short of something more invasive, like having the app phone home a confirmation key/nonce to a service via facebook or something crazy like that)
Yuliy
It indeed seems to be ok to send session data around. Just can't get it to work :-|
Eiko