打开图表调用生成OAuth异常 [英] Open Graph calls generating OAuth Exception

查看:107
本文介绍了打开图表调用生成OAuth异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



据我所知,我有正确的元标记存在。当我将URL粘贴到Open Graph Debugger中时,它会返回正确的信息(标题,描述,图像等),并且没有错误。



我有版本我的开发应用程序已启用Open Graph,我有一个动作(读取)和一个对象(文章)定义。



相关实现是一个网站,不是Facebook的应用程序。在Facebook上,应用程序的类别是其他。我在另一个线程中遵循了一些建议,并将其改为Game,但这并没有起作用,所以我已经改变了。



我的网页应用用户Facebook并收到一个代码,然后我交易一个 access_token ,非常标准。我要求以下权限:




  • publish_stream

  • publish_actions

  • offline_access



但是,当我尝试发出一个动作发出呼叫时,我收到一个OAuthException,没有真正的调试方式。



某些怪物:




  • 图形API似乎不符合文档中指定的URL格式: me / [app_namespace]:[action_type] 。在我的情况下,这将是我/'。 FB_APP_NAMESPACE。 ':read ,其中FB_APP_NAMESPACE之前定义为Facebook应用程序设置中定义的命名空间。 API和Graph API Explorer都抛出一个错误,指出它不明白给定的操作。似乎正在尝试读取命名空间作为动作。

  • 如果我从url中删除命名空间,它会报告传递的操作与 og:type 在url中定义,因为url中的 og:type 包含与我删除的相同的命名空间。

  • 如果我从元标记中删除 命名空间,然后再次尝试,我会收到一个无法调试的通用OAuthException。

  • 我看看我的Facebook应用程序提供的代码示例,该操作似乎是 news.reads 而不是读取

  • 如果我使用该操作,图形API返回一个错误,表示我的ID未经授权使用打开的图形,因为它不是我的应用程序的管理员,开发人员或测试人员。不幸的是,我是应用程序的创建者,这意味着图形API正在撒谎,或者我对自己说谎。



我认为解决方案很简单 - 也许我已经忘记了一些东西,或者选择了某个类别不正确。无论如何,这是一个有点令人沮丧的,至少说!

解决方案

显然,Facebook的默认 如果您的申请/动作未提交,则无法使用。



我最终创建了自己的读取动作,并且首先尝试。去图。


I'm experiencing some problems getting an Open Graph implementation working.

As far as I can tell, I have the correct meta tags present. When I paste an URL into the Open Graph Debugger, it returns with the proper information defined (title, description, image, etc), and no errors.

I have version 3.1.1 of the Facebook PHP SDK.

I have Open Graph enabled for my development app, and I have an action (read), and an object (article) defined.

The implementation in question is a website, not a facebook application. On facebook, the app's "category" is "other". I followed some advice in another thread, and changed it to "Game", which did not work, so I have changed it back.

I authenticate my web app user with facebook and receive a code, which I then trade in for an access_token, pretty standard. I ask for the following permissions:

  • publish_stream
  • publish_actions
  • offline_access

However, when I attempt to make a call to publish an action, I receive an OAuthException, and have no real way of debugging it.

Some oddities:

  • The graph API doesn't seem to like the URL format specified in the documentation: me/[app_namespace]:[action_type]. In my case, this would be me/' . FB_APP_NAMESPACE . ':read, where FB_APP_NAMESPACE is defined earlier to be a namespace as defined in the facebook application settings. Both the API and the Graph API Explorer throw an error stating that it doesn't understand the action given. It seems to be trying to read the namespace as the action.
  • If I remove the namespace from the url, it reports that the passed in action doesn't match the og:type defined in the url, since the og:type in the url contains the same namespace I removed.
  • If I remove that namespace from the meta tag, and try again, I get a generic OAuthException that I can't debug.
  • When I look at the code sample provided in my facebook app, the action seems to be news.reads instead of just read.
  • If I use that action, the graph API returns an error saying that my ID is unauthorized to use the open graph, as it is not an admin, dev, or tester for my application. Unfortunately, I am the app creator, which means either the graph API is lying, or I am lying to myself!

I think the solution is pretty simple - perhaps I have forgotten something, or selected a certain category incorrect. Either way, this is a little frustrating, to say the least!

解决方案

Apparently, facebook's default read call isn't available to use if your application/action isn't submitted.

I ended up creating my own read action, and it worked on the first try. Go figure.

这篇关于打开图表调用生成OAuth异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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