简体   繁体   English

Graph API需要OAuth吗?

[英]is OAuth required in Facebook Graph API?

i have a problem .. i want to get all the feeds from a facebook page using fb graph API without OAuth but i have a problem 我有一个问题..我想使用不带OAuth的FB图形API从facebook页面获取所有提要,但是我有一个问题

https://graph.facebook.com/[page ID]/feed
i get the following response 

{
   "error": {
      "type": "OAuthAccessTokenException",
      "message": "An access token is required to request this resource."
   }
}

while i check another page it gets right response 当我检查另一页时,它得到正确的响应

https://graph.facebook.com/[another page ID]/feed

{
   "data": [
      {
...

why it's asking for an access token for a page ... and it doesn't do that for another page ? 为什么要为一个页面请求访问令牌……而对另一个页面却没有呢?

EDIT 编辑

i checked the first page Graph call 2 days ago and it was working 100% 我在2天前检查了第一页的Graph调用,它的工作效率为100%

You should always be including an OAuth access token (whether it's a user's, if you're working directly on behalf of a user, or your app's, if you're not doing something in a user's context). 您应该始终包含OAuth访问令牌(如果您是直接代表用户工作,则是用户的令牌,如果您不是在用户的上下文中做某事,则是应用程序的令牌)。 Otherwise you might not be able to access all of the things that you should be able to access. 否则,您可能无法访问您应该能够访问的所有内容。

I am not sure whether or not you need OAuth but here is how you can get the access token . 我不确定是否需要OAuth,但这是获取访问令牌的方法

More Resources: 更多资源:

http://developers.facebook.com/docs/api http://developers.facebook.com/docs/api

Yes, OAuth is the only supported form of authentication. 是的,OAuth是唯一受支持的身份验证形式。 However, some pages don't require it, such as fan pages (eg https://graph.facebook.com/cocacola/feed ) 但是,某些页面不需要它,例如粉丝页面(例如https://graph.facebook.com/cocacola/feed

EDIT : Facebook has apparently changed their policy on this endpoint. 编辑 :Facebook显然已经改变了在此端点上的政策。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM