开发者

Issue with access token provided by App

We recently launched a new app, and one of the features was to provide a discount if a user had liked a particular page. I had successfully tested the functionality on numerous accounts, and we went ahead with the launch. We used the graph API to retrieve a list of all pages they'd liked, and checked if the desired page was in there:

https://graph.facebook.com/me/likes?access_token=ACCESS_TOKEN

We've had some users contacting us and alerting us that they weren't seeing the discount even after they'd liked the page. We were able to request the details for one of those accounts, and observed the following.

When the app is authorised, Facebook sends them to our website with the access token in the HTTP request (开发者_开发问答which we pull for graph API calls).

https://example.com/?ref=ts

POST /?ref=ts HTTP/1.1
...
Set-Cookie: fbs_uid=%22uid3D%26access_token%3[ACCESS_TOKEN_REMOVED]%26expires%3D1318381200%26sig%3Dd0b6fdf09befedf022cdea8b58887348%22; expires=Wed, 12-Oct-2011 01:00:00 GMT; path=/

So you can see the access token in there. What's strange is that when we try to make the API call with the access token provided by Facebook, it returns an empty result (even though they've liked pages) again - this is only for certain accounts. What's even more confusing is that when we go to the Facebook Developers page while logged in as the same session (https://developers.facebook.com/docs/reference/api/) and click the /me/likes link, we get a complete list of the user's likes, but with a different access token.

So it appears that the access taken provided for Facebook is insufficient in pulling the data. This only affects certain accounts and not others, so I'm wondering if there's some form of configuration issue, but from where I stand I don't see any way of resolving it, since the data provided by facebook appears incorrect.

With the access token provided by Facebook, we don't get any errors (i.e. we don't get an "Error validating access token"), so the access token does validate.


Lint your access token that is not working and see what Facebook has to say about it. It might give you clues as to what is incorrect.

https://developers.facebook.com/tools/lint

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜