OAuthException仅在IE中具有后处理功能 [英] OAuthException with post action only in IE

查看:75
本文介绍了OAuthException仅在IE中具有后处理功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的fb应用程序中,我调用了后期操作

In my fb application I calling a post action

$.post("http://localhost:3435/Home/Try?id=123&x=1");

我的动作

[HttpPost]
public ActionResult Try(string id, int x)
{
  //post on my wall
  var client = new FacebookWebClient();
  dynamic parameters = new ExpandoObject();
  //...
  dynamic result = client.Post("me/feed", parameters);
  //...
}

在FF和chrome中,此功能按预期工作.张贴到墙上.但是在Internet Explorer中,我遇到了一个例外. (OAuthException)必须使用活动访问令牌来查询有关当前用户的信息.

In FF and chrome this works as expected. Posts to wall. But in Internet Explore I get an exception. (OAuthException) An active access token must be used to query information about the current user.

在类似问题中的一些答案建议从FacebookSetting获取acces令牌,但是在调试时似乎为空.我觉得这很奇怪,因为它可以在FF和Mozilla中使用.

Some answers in similar question suggested to get the acces token from the FacebookSetting, but this seems to be null when debugged. I find this very strange since this works in FF and Mozilla.

推荐答案

您需要为回发或ajax请求手动维护signed_request.

You will need to manually maintain the signed_request for post backs or ajax requests.

将signed_request作为参数传递给您的ajax发布请求.

Pass signed_request as a parameter to your ajax post request.

更多详细信息,请参见 http://facebooksdk.codeplex.com/discussions/251878 http://facebooksdk.codeplex.com/discussions/250820

More details at http://facebooksdk.codeplex.com/discussions/251878 and http://facebooksdk.codeplex.com/discussions/250820

这篇关于OAuthException仅在IE中具有后处理功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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