创建Facebook测试用户时访问令牌的问题 [英] Problem with access token while creating Facebook Test Users
问题描述
我正在为我的Facebook应用程序创建测试用户。他们在11月的这篇博文中发布了这个功能(http://developers.facebook.com/blog/post/429),并在这里记录( http://developers.facebook.com/docs/test_users/ )。我在其他地方找不到答案...
I'm trying to create test users for my Facebook application. They announced this functionality in this blog post in November (http://developers.facebook.com/blog/post/429) and it is documented here (http://developers.facebook.com/docs/test_users/). I could not find the answer to this elsewhere...
根据文档,您可以使用Graph API创建与特定应用程序关联的测试用户应用程序访问令牌。这链接到Autenticating as an Application一节,并描述了这个CURL脚本:
According to the documentation, "You can create a test user associated with a particular application using the Graph API with the application access token." This links to the section "Autenticating as an Application" and describes this CURL script:
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
到目前为止,很好。我跑了这个,得到以下内容:
So far, so good. I ran this and get the following:
access_token=1182...18|nTI...r5Q
所以现在我想把这个标记POST到图api测试用户的URL:
So now I want to POST this token to the graph api test user URL:
POST /1182...18/accounts/test-users?installed=true&permissions=read_stream&access_token=1182...18|nTI...r5Q
当我这样做(都使用Facebook的PHP SDK,只是打入浏览器)我得到:
When I do this (both using the Facebook PHP SDK and just typing it into the browser) I get:
{
"error": {
"type": "OAuthException",
"message": "Invalid OAuth access token."
}
}
所以问题是:
So the questions are:
感谢您的帮助。
推荐答案
这是一些工作代码,这将允许您使用PHP SDK创建测试用户。
Here is some working code that will allow you to create a test user with the PHP SDK.
这篇关于创建Facebook测试用户时访问令牌的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!