开发者

Facebook php offline use from iOS Authentication

The current flow of our iOS application and server was to a开发者_Python百科uthentication within the app and send the token to the server for offline processing.

I ran into this error message when testing:

{
   "error": {
      "type": "OAuthException",
      "message": "Invalid access token signature."
   }
}

(I am using the github iOS SDK btw)

I am not sure if it is token difference between a user token and an app token? I am not sure why the token I get from the iOS Facebook SDK can't be used by the Php Facebook SDK:

Once they have authenticated within the iOS app can I use the PHP SDK to avoid re-authenticating the user server-side? I need offline access.

Thank you


Have you asked for the offline_access permission? You can do this with scope during the login event. This should grant a long life token that you should be able to use. You should be able to use a token from different sources (javascript,php etc...) anywhere as access to the graph is source agnostic and doesn't really take into account where the token came from only if it is valid and authorized.


The issue was an obvious one, the token length varies and the db varchar length wasn't long enough, pumped it up to 256.

Seem to be an issue with newer Facebook account holders strangely enough.

And yes you can pass a token from the iOS device to the server, just make sure your permissions are set up correctly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜