Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

Help on Facebook Graph API, returns "false" but UID is public

I really could not understand why on some Facebook objects (being more specific: user posts) the Graph API returns false when using an access_token obtained via OAuth by an application, but NOT by using a user access_token.

I have an example here: https://graph.facebook.com/10150158049595775?access_token=XXXXXXXXXX

This post is public, and I have no friends in common with this user.

If you try to access the url above by using a token obtained via the usual Facebook OAuth scheme, the server return "false".

If you use your user access token, for example the one that FB gives you by visiting the examples in this page http://developers.facebook.com/docs/reference/api/, the Graph API correctly gives you the users's post detail.

I believe it's not a matter of extended permissions required, first because the post above is public, and second, because for testing I've tried to make my application generate a token by asking ALL user permissions (yes, all permissions found on developers.facebook.com/docs/authentication/permissions/) and the answer was always "false".

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I suppose this post is "Available to everyone on Facebook", which may be the reason why Facebook is accepting a user access_token (i.e. viewing the post as a user) and not accepting an application access_token.

Also note that this would work without access_token (if you prepend the owner id):

https://graph.facebook.com/752020774_10150158049595775

I guess this is treated as "Publicly accessible"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...