公共内容无需客户端身份验证的 Facebook API [英] Facebook API without client authentication for public content

查看:27
本文介绍了公共内容无需客户端身份验证的 Facebook API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一位客户开发一个网站,该客户已经在 Facebook 上拥有其产品的照片,并且他希望在他的网站上复制相同的相册.我已经在使用 Facebook Connect,所以我放弃了 photos.getAlbumsphotos.get 的组合来动态制作画廊.

I'm developing a site for a client who already have the photos of his products on Facebook, and he wants the same albums to be replicated over his site. I was already using Facebook Connect, so I dropped a combination of photos.getAlbums and photos.get to dynamically make the galleries.

到目前为止一切顺利,但后来我意识到,如果没有用户通过 FBC 登录,则不会创建会话并且 API 变得不可用,即使对于公开可用的内容也是如此.显然,我想向所有人展示这些专辑,而不仅仅是向关联其帐户的人展示.

So far so good, but then I realized that if there's no user logged trough FBC, no session is created and the API becomes unusable, even for content that is publicly available. I obviously want to show the albums to everyone and not just the people who connect their accounts.

Facebook API 中的所有函数都是这样工作的吗?对于这种情况,最好(更容易实施)的解决方法是什么?

Is this how all functions in the Facebook API work? What's the best (easier to implement) workaround for this situation?

推荐答案

截至 2010 年 9 月,您现在可以像应用程序一样进行身份验证,无需关联用户.有关详细信息,请参阅 http://developers.facebook.com/docs/authentication/.或者您可以运行此示例代码以获取访问令牌:

As of September 2010, you can now authenticate just as an application, with no associated user. See http://developers.facebook.com/docs/authentication/ for details. Or you can run this example code to get an access token:

curl -F grant_type=client_credentials \
 -F client_id=your_app_id \
 -F client_secret=your_app_secret \
 https://graph.facebook.com/oauth/access_token

这篇关于公共内容无需客户端身份验证的 Facebook API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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