device facebook connect -> php server -> facebook?

hi,

anyone know how i would pass the authentication details of my facebook connect authentication to a php script on my server, which then did processing of some data from my phone to then communicate with facebook

i would not be calling the facebook graph api directly from my phone app, i’d be calling it from my webserver

ie

  1. fb connect on device
  2. post details & data to http://mysite.com/fbscript.php
  3. fbscript.php processes data and communicates with Facebook
  4. fbscript.php return response to device

thanks for any advice
j
[import]uid: 6645 topic_id: 5599 reply_id: 305599[/import]

I have seen this question asked a few times, and I can understand why there is a lot of confusion here. Its a bit of a computer security problem. While I can’t provide you with any lua code that does this, I can explain how the authentication scheme can work.

  1. The user logs into Facebook on their device via Facebook Connect.
  2. Facebook responds with an access token for the user
  3. The program running on the mobile device forwards the access token to your web server (in your case a PHP server).
  4. On the server side, the access token is used, to speak to facebook, doing a simple request for the “me” object, which tells us who that access token belongs to.
  5. The results in the me object can be used to determine/verify the user’s identity.
  6. Now the user is authenticated with the server, the server does work on behalf of the user and returns a response.

YOU MUST USE HTTPS to securely transmit the facebook access token. Otherwise, a man in the middle can steal someone’s access token and authenticate with your app (and possibly other things on facebook) as a different user.

Thats the jist of it, you can do some caching to optimize and not need to keep making slow requests to facebook. Or you can establish a session once you authenticate them the first time.
[import]uid: 38858 topic_id: 5599 reply_id: 23583[/import]