FB API调用时,无法代表此用户调用API [英] 'Cannot call API on behalf of this user' on FB API call

查看:260
本文介绍了FB API调用时,无法代表此用户调用API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在facebook API通话中遇到问题。我正在使用Koala进行服务器端api通话,但最近进入api通话的问题。所以我试图绕过考拉电话,并使用call进行原始的api http呼叫,但无效。



当我从开发机器卷曲时,它的工作正常。



curlhttps://graph.facebook.com/me?oauth_token=my_token



它返回配置文件的详细信息,但是从生产机器完成的同样的事情,它抛出异常



{error {message:无法代表此用户调用API,type:OAuthException,code:200}}


解决方案

我发现问题的根源(至少在我们的网站上)。在Facebook的开发者控制台( https://developers.facebook.com/apps),我们的应用程序显示无效的隐私权政策,因此,Facebook自动将我们的应用程序置于沙箱模式。



更新我们的隐私政策和(更重要的是)从Sandbox模式中删除我们的应用程序,导致此错误停止。



其他用户似乎取得了一些成功, ()可以登录到他们的应用程序https://groups.google.com/forum/#!topic/django-social-auth/XaE5dFXEqhA



祝你好运! :)


I am having trouble with facebook API call. I am using Koala for server side api call but recently came into issue making api call. So I tried to bypass koala call and did raw api http call using call but to no avail.

When I do curl from development machine it works fine.

curl "https://graph.facebook.com/me?oauth_token=my_token

It returns profile details, but the same thing done from production machine, it's throwing the exception

{"error":{"message":"Cannot call API on behalf of this user","type":"OAuthException","code":200}}

Does anyone had the same issue? Like to hear from you guys.

解决方案

I found the source of the problem (on our site, at least). In Facebook's developer console (https://developers.facebook.com/apps), our app was showing an invalid privacy policy. Due to this, Facebook had automatically placed our app into Sandbox Mode.

Updating our privacy policy and (more notably) removing our app from Sandbox Mode caused this error to cease.

Other users seem to have had some success with removing regional (country-specific) restrictions on who can and cannot log in to their app (https://groups.google.com/forum/#!topic/django-social-auth/XaE5dFXEqhA)

Best of luck! :)

这篇关于FB API调用时,无法代表此用户调用API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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