I’m developing an app including facebook’s single sign on procedure for user login.
The app contains a number of social interaction points that rely on providing the user with a list of their friends who are already using the app and displaying data from my backend to go with each friend.
I’m curious to what people thing is the best process for doing so…
A separated approach where my app loads the friend list from fb then queries my back end for the data i need to display along side each friend.
Or…
Pass the auth token to the server when the user first logs in and perform the friend lookups on the server and deliver the lot down to the user.
Obviously the 2nd should provide a smoother experience on the client side, providing the server doesn’t have any reason to be sluggish communicating with fb. However, is throwing the auth token up to the server a) secure? b) going to cause issues with synchronisation if a new token is issued on the server/client and not the other.
cheers
Ben
How about using ajax /
FB.apito get the list of friends, and sending the User IDs to the server for lookup. You can send the data using ajax and load the data back on your website asynchronously.The whole process is done async so it doesn’t affect the user’s experience of the site. Cache the data for the session so you don’t have to make repeat calls / lookups for the same data.