为 Facebook 应用程序生成访问令牌
我已访问 身份验证 页面并成功生成了访问令牌,但我收到的令牌没有如果您访问 http://graph.facebook.com/<,请不要向我提供与自动生成的令牌相同的权限/a> 并单击示例对象。
这就是我正在做的事情:
我创建了一个应用程序并将其安装为页面选项卡。我目前可以查找喜欢页面选项卡的用户,并获取有关他们的基本信息,但我需要访问令牌来获取更多信息(例如上面链接中生成的令牌附带的权限)
访问令牌为 http://graph.facebook.com/ 上的示例生成的,这只是一个测试或者我可以生成一个提供相同权限而不要求用户共享其信息的令牌吗?
I have been to the Authentication page and successfully generated an access token, but the token I receive doesn't give me the same permissions as the token that is automatically generated if you visit http://graph.facebook.com/ and click on the example objects.
Here's what I'm doing:
I've created an app and installed it as a page tab. I can currently lookup the users who like the page tab, and get basic information about them, but I need an access token to get more information (such as the permissions that come with the token that is generated in the link above)
The access token that is generated for the examples at http://graph.facebook.com/, is that simply a test only token or can I generate one that gives the same permissions without asking the user to share their information?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这一切都取决于您正在寻找什么信息。看一下 https://developers.facebook.com/docs/reference/api/不同的权限的权限/,并找出你需要什么。
如果它只是一个应用程序令牌,那么您获得的令牌应该没问题。
如果没有,您需要首先对用户进行身份验证和授权。这意味着弹出一个身份验证对话框,并请求权限。您可以在这里找到更多信息:https://developers.facebook.com/docs/authentication/< /a>
如果您正在执行服务器端流程,请确保您正在发出两个请求,而不仅仅是在“代码”之后停止 - 它用于获取身份验证令牌,但不提供任何内容让您可以用它做任何事情。
This all depends on what information you are looking for. Take a peek at https://developers.facebook.com/docs/reference/api/permissions/ for the different permissions, and figure out what you need.
If it is just an app token, the one that you got should be ok.
If not, you need to authenticate and authorize your users first. This will mean popping up an auth dialog, and asking for permissions. You can find out more about that here: https://developers.facebook.com/docs/authentication/
If you are doing the server side flow, make sure you are making both requests, not just stopping after the "code" - it is used to get the auth token, but offers nothing in terms of letting you do anything with it.