来自应用程序的图形

来自应用程序的图形

本文介绍了访问“公共"来自应用程序的图形 API 资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个尝试使用公共"Facebook 内容的网络应用程序.

I am creating a web application that is trying to use "public" Facebook content.

它不是传统的Facebook 应用程序",因为我实际上并没有注册 Facebook 用户来使用它,但用户将全部位于服务器端.

It is not your traditional "Facebook Application" because I'm not actually signing up Facebook users to use it, but the users will be all server-side.

我已经到了必须对某些公共"内容使用access_token"的地步,并且我已经能够生成应用程序 access_token 但这不适用于我的公共数据我有兴趣访问.

I've come to a point in which I am having to use an "access_token" for certain "public" pieces of content and I have been able to generate a app access_token but this does not work for the public data I'm interested in accessing.

access_token 是通过

access_token's created via

https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=APP_SECRET&grant_type=client_credentials

不为

https://graph.facebook.com/chickfila/notes?access_token=CODE_FROM_ABOVE

无需在此处登录即可公开访问...

which is publicly accessable w/o login here...

http://www.facebook.com/ChickfilA?sk=notes

有什么办法可以给应用本身一个用户级别的 access_token?

Any way to give an app itself a user-level access_token?

推荐答案

我遇到了与公开事件数据非常相似的问题.我必须做的是为应用程序管理员创建一个离线访问令牌.

I had a very similar problem with publicly available event data. What I had to do was to create an offline access token for the admin of the application.

因此,使用您的管理员登录并打开以下 URL(将 APP ID 替换为您的 ID,最终您需要更多权限,但 read_stream 和 offline_access 应该可以解决问题):

So, log in with your admin and open the following URL (replace APP ID with your ID and eventually you need more permissions, but read_stream and offline_access should do the trick):

https://graph.facebook.com/oauth/authorize?client_id=APPID&scope=offline_access,read_stream&redirect_uri=http://www.facebook.com/connect/login_success.html

这会给你一个代码,你将把它粘贴到以下 URL(带有你的 APP ID 和 SECRET)中:

This will give you a code, that you will paste in the following URL (with your APP ID and SECRET):

https://graph.facebook.com/oauth/access_token?client_id=APPID&redirect_uri=http://www.facebook.com/connect/login_success.html&client_secret=SECRET&code=CODE

这将为您提供一个永远有效(或直到您更改密码)的访问令牌.

This will give you an access token that should work forever (or until you change your password).

这篇关于访问“公共"来自应用程序的图形 API 资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 04:04