获取一个Facebook页面的公开信息没有身份验证令牌 [英] Get a Facebook Page's public posts without an auth token

查看:173
本文介绍了获取一个Facebook页面的公开信息没有身份验证令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有可能(使用Facebook的图形API)来获得由的的Facebook页面

我想在一个Android应用程序,以显示该信息,并希望避免使用Facebook的Andr​​oid SDK,以避免显示的开销了 [应用]想访问你的公开个人资料和好友列表的消息,因为这很烦人,不准确的。

以下调用工作没有一个身份验证令牌,例如: https://graph.facebook.com/nike

但是这一次没有: https://graph.facebook.com/nike/posts

  {
   错误:{
      消息:访问令牌才能请求该资源。
      类型:OAuthException,
      code:104
   }
}

我能刮HTML关闭此页无身份验证令牌但这似乎是大材小用对于这样一个简单的任务:的 https://www.facebook.com/nike/posts

要总结一下:


  1. 这是真正的API的限制?


  2. 有没有办法用晚餐preSS了 [应用]想访问
    公开的个人资料和好友列表
    的信息获取的auth-令牌使用Android SDK没有额外的权限时?


  3. 使用服务器端的SDK是它也许可以吗?


修改:好像做,这是服务器端使用的一个长寿命的应用程序访问令牌


解决方案

  

这是真正的API的限制?


没有。


  

有没有办法用晚餐preSS的[应用]想访问你的公众形象和好友列表获得一个auth-令牌使用Android SDK没有额外的权限时消息?


是的。如果你正确地阅读文档(邮政),其明确提到任何有效访问令牌,需要获取详细信息*页的帖子。所以,你可以使用应用程序的访问令牌,你可以得到从没有的这里或简单的GET请求(服务器端) -

  GET / OAuth的/的access_token?
CLIENT_ID = {APP-ID}
&安培; client_secret = {应用秘密}
&安培; grant_type = client_credentials


  

使用服务器端的SDK是它也许可以吗?


取决于你,你想怎么实现。

*注:当然,你可以看到的信息是公共职位只(可能即使在用​​户登录超时可以看出);否则,你可能需要使用 read_stream 权限用户身份验证。

Is it possible (using the facebook graph API) to get the last 5 posts made by a Facebook Page?

I would like to display this information in an Android app and want to avoid the overhead of using the Facebook Android SDK to avoid showing the "[App] would like to access your public profile and friend list" message because it's annoying and inaccurate.

The following call works without an auth token for example: https://graph.facebook.com/nike

But this one doesn't: https://graph.facebook.com/nike/posts

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

I could scrape the HTML off of this page without an auth token but this seems like overkill for such a simple task: https://www.facebook.com/nike/posts

To summarize:

  1. Is this really a limitation of the API?

  2. Is there a way to suppress the "[App] would like to access your public profile and friend list" message when acquiring an auth-token with no extra permissions using the Android SDK?

  3. Is it perhaps possible using a server-side SDK?

EDIT: Looks like the best way to do this is server-side with a long-lived App Access token.

解决方案

Is this really a limitation of the API?

No.

Is there a way to suppress the "[App] would like to access your public profile and friend list" message when acquiring an auth-token with no extra permissions using the Android SDK?

Yes. If you read the documentation properly (Post), its clearly mentioned that any valid access token is required to fetch the details* of the posts of a page. So, you could use the App access token, which you could get without any authorization step- from here or a simple GET request (server-side)-

GET /oauth/access_token?
client_id={app-id}
&client_secret={app-secret}
&grant_type=client_credentials

Is it perhaps possible using a server-side SDK?

Depends on you, how you want to implement.

*Note: Of course, the posts that you can see would be the public posts only (that could be seen even if a user is logged-out); else you might require user authentication with read_stream permission.

这篇关于获取一个Facebook页面的公开信息没有身份验证令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆