如何获取访问令牌与测试用户的正确权限 [英] How to get an access token with the right permissions for a test User

查看:825
本文介绍了如何获取访问令牌与测试用户的正确权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的REST API项目的测试目的,我需要在FB的应用程序信息板中创建测试用户的测试访问令牌。

For test purpose of my REST API project I need to get test access tokens of the test user created in my app dashboard on FB.

我的应用程序请求用户电子邮件作为许可。

My application request the user email as a permission.

我检查创建的用户是否已经有应用程序安装。然而,当我点击这些测试用户的获取访问令牌按钮时,我只能获取一个access_token的基本信息,电子邮件不可用。

I check that the users created has the app already installed. Yet when I click on 'get access token' button for those test users, I can only get an access_token with basic infos, email is not available.

有没有办法获取访问令牌,并在我的应用程序信息板中创建测试用户的权限。

Is there a way to get an access token with the right permissions for the test users created in my app dashboard ?

感谢

推荐答案

在应用程式资讯主页中看来,这是无法实现的。解决方案是直接使用Graph API创建测试用户,如

Seems like this is not possible in the app dashboard. The solution is to use the Graph API directly to create Test Users, as descibed at

https://developers.facebook.com/docs/graph-api/reference/v2.0/app/accounts / test-users#publish

我可以使用

POST /{app-id}/accounts/test-users

令牌以及权限安装的请求正文中的字段。对于权限,您可以使用逗号分隔权限列表。

with an App Access Token and the fields in the request body for permissionsand installed. For the permissions you can use commas to separate the list of permissions.

这篇关于如何获取访问令牌与测试用户的正确权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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