Goal:
- Allow users to authenticate via client side facebook login within a mobile application.
- Use the access token provided by facebook login to authenticate on a SmartFox server that I am hosting.
Details: I've done quite a bit of research and the best answers I have found are in these two articles:
- Design for Facebook authentication in an iOS app that also accesses a secured web service
- Get application id from user access token (or verify the source application for a token)
Issue:
- SmartFox Server's custom login extension makes a synchronous decision about a users credentials. This prevents me from completing step 4 in the first article linked above- our server can't wait for a response from facebook to validate the user's access token before sending a reply to the client (logged in vs. invalid credentials).
Intuitions:
- My first thought is to let the user join a lobby as a guest then use regular server commands to validate the access token. Once the access token is validated, the user is then logged into the actual game. I haven't researched this deeply yet, but I'm working on it.
Solved: After implementing the method described above (which worked), I realized that the server could in fact handle querying fb api before returning a login result. Hope this helps someone in the future :)