Facebook API:这个 facebookredirect.axd 来自哪里?

发布于 2024-11-09 02:54:08 字数 2092 浏览 0 评论 0原文

因此,我已经设置了所有内容来邀请用户访问我网站上的注册页面并跟踪他们的邀请代码,但现在每当用户接受邀请时,他们最终都会收到以下错误:

HTTP 错误 404.0 - 未找到

您正在查找的资源for 已被删除、更名或暂时不可用。

这是 URL:

http://www.facebook.com/dialog/oauth/?state=eyJyIjoiaHR0cDovL2FwcHMuZmFjZWJvb2suY29tL2Z pc2hhcndlLz9yZXF1ZXN0X2lkcz0xMDE1MDYzNzQzNDI4NTQ4NCwxMDE1MDYzNzU3NjA0MDQ4NCwxMDE1MDYzNzU4MDQ1NTQ4NCwxMD E1MDYzNzU5NzQ2MDQ4NCwxMDE1MDYzNzYxNDUyMDQ4NCwxMDE1MDYzNzYzMDg0NTQ4NCZyZWY9bm90aWYmbm90aWZfdD1hcHBfcmVxd WVzdCJ9&client_id=217174461634478&redirect_uri=http://www.fisharwe.com/facebookredirect.axd

为什么redirect_uri是http://www.fisharwe.com/facebookredirect.axd而不是我在代码中使用top.location.href="whatever.com"<设置的内容/代码>?

更新:

似乎这个问题已经以某种方式得到解决。但它仍然没有重定向到我网站的注册页面!以下是登陆页面的源代码:

UPDATE2:

这是我的 C# 代码:

    [CanvasAuthorize]
    public ActionResult Index()
    {
        var fb = new FacebookWebClient(FacebookWebContext.Current);
        dynamic requestInfo = fb.Get("/me/apprequests/");
        var b = requestInfo.Count;
        if (requestInfo.data.Count > 0)
        {
            var a = requestInfo["data"][0]["data"];
            //ViewData.Add("TrackingData", a);
            return Redirect(redirectUrl + "?code=" + a);
        }
        return RedirectToAction("Index", "Home");
    }

So I've set up everything to invite users to the registration page on my site and track their invitation code, but now whenever a user accepts the invitation they end up getting the following error:

HTTP Error 404.0 - Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

And here's the URL:

http://www.facebook.com/dialog/oauth/?state=eyJyIjoiaHR0cDovL2FwcHMuZmFjZWJvb2suY29tL2Zpc2hhcndlLz9yZXF1ZXN0X2lkcz0xMDE1MDYzNzQzNDI4NTQ4NCwxMDE1MDYzNzU3NjA0MDQ4NCwxMDE1MDYzNzU4MDQ1NTQ4NCwxMDE1MDYzNzU5NzQ2MDQ4NCwxMDE1MDYzNzYxNDUyMDQ4NCwxMDE1MDYzNzYzMDg0NTQ4NCZyZWY9bm90aWYmbm90aWZfdD1hcHBfcmVxdWVzdCJ9&client_id=217174461634478&redirect_uri=http://www.fisharwe.com/facebookredirect.axd

Why is the redirect_uri http://www.fisharwe.com/facebookredirect.axd and not what I've set in my code using top.location.href="whatever.com"?

UPDATE:

Seems like that problem has been resolved somehow. But it still does not redirect to the registration page of my site! Here's the source code of the landing page:

<html><head><script type="text/javascript">
top.location = "http://www.facebook.com/dialog/oauth/?state=eyJyIjoiaHR0cDovL2FwcHMuZmFjZWJvb2suY29tL2Zpc2hhcndlLz90eXBlPWRpc2NvdmVyeSJ9&client_id=217174461634478&redirect_uri=http://www.fisharwe.com/facebookredirect.axd";
</script></head><body></body></html>

UPDATE2:

This is my C# code:

    [CanvasAuthorize]
    public ActionResult Index()
    {
        var fb = new FacebookWebClient(FacebookWebContext.Current);
        dynamic requestInfo = fb.Get("/me/apprequests/");
        var b = requestInfo.Count;
        if (requestInfo.data.Count > 0)
        {
            var a = requestInfo["data"][0]["data"];
            //ViewData.Add("TrackingData", a);
            return Redirect(redirectUrl + "?code=" + a);
        }
        return RedirectToAction("Index", "Home");
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执手闯天涯 2024-11-16 02:54:08

你在 web.config 中设置了 http 处理程序吗?

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

have you setup the http handler in web.config?

<httpHandlers>
    <add verb="*" path="facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" />
</httpHandlers>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文