Facebook SDK 4.2.1-权限“允许"后出现HTTP 404错误 [英] Facebook SDK 4.2.1 - http 404 error, after permissions 'allow'

查看:88
本文介绍了Facebook SDK 4.2.1-权限“允许"后出现HTTP 404错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Facebook权限页面上单击允许"后,我遇到了HTTP 404错误的小问题.

I have small problem with http 404 error, after click on 'allow' on facebook permissions page.

当我在浏览器中键入 http://localhost:port 地址时,出现相同的错误:

When I type http://localhost:port address in browser, I get same error:

找不到/facebookredirect.axd/[应用名称]/default.aspx

cannot find /facebookredirect.axd/[app name]/default.aspx

在授予权限后(出现404错误),当我想使用我的应用程序时,我正在从我的个人资料中运行它.一切都很好,应用程序运行良好.

After granting permissions (and after 404 error), when I want to use my app, I'm running it from my profile. Everything is fine and app works well.

推荐答案

前段时间我遇到了类似的问题,我更改了web.config文件,请参见以下内容:

I had a similar problem some time ago, I changed my web.config file, see the following:

我将此添加到system.web中的httpHandlers部分:

I added this to the httpHandlers section in system.web:

<add verb="*" path="facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web"/>

并将其添加到system.webServer中的handlers部分:

And added this to the handlers section in system.webServer:

<add name="facebookredirect" verb="*" path="facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web"/>

最后,我在后面的代码中设置了网址(应该将其发回到原始应用的网址,您会看到添加的变量取决于用户单击的内容):

And lastly I set the Url's in the codebehind (this should post back to the original app url and you'll see the variables added depends on what the user clicks):

CanvasAuthorizer cAuthorizer = new CanvasAuthorizer();
cAuthorizer.ReturnUrlPath = HttpUtility.UrlEncode("?allow=true");
cAuthorizer.CancelUrlPath = HttpUtility.UrlEncode("?allow=false");

确保在配置文件中设置您的Facebook设置,例如:

Make sure you are setting your facebook settings in the config file, e.g:

<facebookSettings appId="0000000" appSecret="0000000000" canvasPage="http://apps.facebook.com/xxxxx/" canvasUrl="http://xxxxxxx" secureCanvasUrl="https://xxxxxxx"/>

我不确定是否使用相同的SDK版本,但请尝试一下.

I'm not 100% sure if I used the same SDK version, but give it a try.

这篇关于Facebook SDK 4.2.1-权限“允许"后出现HTTP 404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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