Search code examples
facebook-graph-apifacebook-access-tokenfacebook-sdk-3.0

Should I encrypt the Facebook access token when sending to server?


Should I encrypt the Facebook access token I recieve in my client application, if I want to send it to my server? Or is it linked to my app secret key and bundle identifier?


Solution

  • The Facebook access token is linked to your Facebook App ID and can't be used if the app bundle identifier is different from the one provided in the settings page of the app. On server-side, the access token can't be used without the application-specific secret key. So the answer is: your Facebook token is safe for Facebook-related requests, but pay attention if you are using it as a way of authenticating your users to your application, since the access token lasts for about 60 days and in the meantime might be stolen. For example, make sure you are using an HTTPS connection to prevent man-in-the-middle attacks.