OAuthException with post action only in IE
In my fb application I calling a post action
$.post("http://localhost:3435/Home/Try?id=123&x=1");
My action
[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);
//...
}
I开发者_JAVA技巧n 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.
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.
You will need to manually maintain the signed_request for post backs or ajax requests.
Pass signed_request as a parameter to your ajax post request.
More details at http://facebooksdk.codeplex.com/discussions/251878 and http://facebooksdk.codeplex.com/discussions/250820
hmm check if IE has flash installed for x-domain communication, if not, try installing, also try hitting the apps.facebook.com/yourapp instead of going directly to the iframe
oh 1 other thing it could be if it's an iframe, is 3rd party cookies, try adding header('P3P: CP=HONK'); to your php code
精彩评论