CanvasAuthorizer Authorize() 在 facebook C# sdk 上未返回 true
我下载了 Facebook C# SDK 4.1.1,并将其合并到一个小型 ASP.NET 3.5SP1 Web 项目中。当我从 VS Studio 2008 运行该应用程序时,它允许我安装 Facebook 应用程序。当我登录 Facebook 时,我可以看到我的应用程序已安装,就像我在主页左侧导航上看到的那样。
当我单击该应用程序时,它会在我的 Facebook 应用程序 iframe 上显示 default.aspx 页面。看起来好像成功了,对吧?不,不是,因为当我在本地主机上调试页面时,我看到 CanvasAuthorizer 应用程序上的 Authorize() 返回 FALSE。
我在 IIS 5.0 中创建了一个 Web 应用程序,以便默认的 vs studio 调试器不会干扰。
这是我设置的 Facebook 设置和其他相关信息。
非常感谢任何帮助!
谢谢!
画布页 “http://apps.facebook.com/mynewapp/”
画布 URL http://localhost/MyNewApp/
画布 FBML/iframe iframe
我的页面加载:
protected void Page_Load(object sender, EventArgs e)
{
fbApp = new FacebookApp();
authorizer = new CanvasAuthorizer(fbApp);
authorizer.Perms = requiredAppPermissions;
if (authorizer.Authorize())
{
ShowFacebookContent();
}
}
以下是我的 web.config 的相关部分:
I downloaded the Facebook C# SDK 4.1.1, and incorporated it on a small ASP.NET 3.5SP1 web project. When I run the application from VS Studio 2008, it allowed me to install my Facebook application. When I log onto facebook, I can see that my app installed, as I see it on my home page left nav.
When I click on the app, it displays the default.aspx page on my facebook app iframe. Looks like it worked, right? No it doesn't because when I debug the page on localhost, I see that the Authorize() on the CanvasAuthorizer app returns FALSE.
I created a web app in IIS 5.0 so that the default vs studio debugger doesn't interfere.
Here are they facebook settings I have set and other relevant information.
Any help is greatly appreciated!
Thanks!
Canvas Page
"http://apps.facebook.com/mynewapp/"
Canvas URL
http://localhost/MyNewApp/
Canvas FBML/iframe
iframe
My Page Load:
protected void Page_Load(object sender, EventArgs e)
{
fbApp = new FacebookApp();
authorizer = new CanvasAuthorizer(fbApp);
authorizer.Perms = requiredAppPermissions;
if (authorizer.Authorize())
{
ShowFacebookContent();
}
}
Here are the relevant sections of my web.config:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现问题:
http://adamyoung.net/IE-Blocking-iFrame-Cookies
该问题仅发生在 IE 中。 IE 阻止 iframe cookie...必须设置标头以允许 cookie。
Found out the issue:
http://adamyoung.net/IE-Blocking-iFrame-Cookies
The issue was only happening in IE. IE blocks iframe cookies...have to set the header to allow cookies.