Facebook的API - 无效签名的请求。 (签名无效。) [英] Facebook API - Invalid signed request. (Invalid signature.)

查看:379
本文介绍了Facebook的API - 无效签名的请求。 (签名无效。)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在tryng http://landlordscores.co.uk/account使用Facebook的身份验证/login.aspx 但与Facebook登录后,回调页面显示无效签名的请求。(无效签名)。该应用程序ID和秘密是正确的,没有其他的信息似乎被记录。发生这种情况每次我试图与Facebook登录的时间。

编辑:
要拨打电话,我使用pretty多少确切的code作为样本。
在标记:

 < IFRAME SRC =<%= this.RegistrationUrl%GT;
                        滚动=自动
                        FRAMEBORDER =否
                        风格=边界:无
                        ALLOWTRANSPARENCY =真
                        WIDTH =100%
                        HEIGHT =500>
                  < / IFRAME>

在code-背后:

 公共字符串RegistrationUrl {
    得到
        {
    VAR URL =的String.Format(
    \"http://www.facebook.com/plugins/registration.php?client_id={0}&redirect_uri={1}&fields={2}\",
    FacebookApplication.Current.AppId,
    HttpUtility.UrlEn code(AppBLL.GetAbsoluteURL(〜/帐号/ fbregcallback.aspx)),
    HttpUtility.UrlEn$c$c(\"[{\\\"name\\\":\\\"name\\\"},{\\\"name\\\":\\\"email\\\"},{\\\"name\\\":\\\"location\\\"},{\\\"name\\\":\\\"password\\\",\\\"view\\\":\\\"not_$p$pfilled\\\"},{\\\"name\\\":\\\"captcha\\\"}]\")); this.RegisterUser.ContinueDestinationPageUrl = this.Request.QueryString [RETURNURL];
    this.hdnPassLength.Value = Membership.MinRequiredPasswordLength.ToString();
                            HttpUtility.UrlEn$c$c(\"[{\\\"name\\\":\\\"name\\\"},{\\\"name\\\":\\\"email\\\"},{\\\"name\\\":\\\"location\\\"},{\\\"name\\\":\\\"password\\\",\\\"view\\\":\\\"not_$p$pfilled\\\"},{\\\"name\\\":\\\"captcha\\\"}]\"));
    this.hdnPassLength.Value = Membership.MinRequiredPasswordLength.ToString();
    }
}


解决方案

也许你已经做到了这一点,但我有同样的问题,而我所要做的就是我的应用程序ID和机密添加到web.config中。

在web.config文件中,我的问题是在这条线。确保这些被填充,准确的应该解决的问题。

 < facebookSettings的appid =XXXXXXXXappSecret =XXXXXXXcookieSupport =真/>

希望这有助于!

I'm tryng to use Facebook authentication at http://landlordscores.co.uk/account/login.aspx but after logging in with facebook, the callback page displays "Invalid signed request. (Invalid signature.) ". The app ID and secret are correct and no other information seems to be logged. This happens every time I try to log in with facebook.

Edit: To make the call, I'm using pretty much the exact code as the sample. In the markup:

<iframe src="<%= this.RegistrationUrl %>"
                        scrolling="auto"
                        frameborder="no"
                        style="border:none"
                        allowTransparency="true"
                        width="100%"
                        height="500">
                  </iframe>

In the code-behind:

public string RegistrationUrl {
    get
        {
    var url = string.Format(
    "http://www.facebook.com/plugins/registration.php?client_id={0}&redirect_uri={1}&fields={2}",
    FacebookApplication.Current.AppId,
    HttpUtility.UrlEncode(AppBLL.GetAbsoluteURL("~/Account/fbregcallback.aspx")),
    HttpUtility.UrlEncode("[{\"name\":\"name\"},{\"name\":\"email\"},{\"name\":\"location\"},{\"name\":\"password\",\"view\":\"not_prefilled\"},{\"name\":\"captcha\"}]"));            this.RegisterUser.ContinueDestinationPageUrl = this.Request.QueryString["ReturnUrl"];
    this.hdnPassLength.Value = Membership.MinRequiredPasswordLength.ToString();
                            HttpUtility.UrlEncode("[{\"name\":\"name\"},{\"name\":\"email\"},{\"name\":\"location\"},{\"name\":\"password\",\"view\":\"not_prefilled\"},{\"name\":\"captcha\"}]"));       
    this.hdnPassLength.Value = Membership.MinRequiredPasswordLength.ToString();
    }
}

解决方案

Perhaps you have done this already but I have had the same issue and all I had to do was add my app ID and secret to the web.config.

In the web.config file, my issue was on this line. Ensuring these are populated and accurate should solve the issue.

<facebookSettings appId="xxxxxxxx"  appSecret="xxxxxxx"  cookieSupport="true" />

Hope this helps!

这篇关于Facebook的API - 无效签名的请求。 (签名无效。)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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