加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – Facebook API – 签名请求无效. (签名无效.)

发布时间:2020-12-16 03:52:09 所属栏目:asp.Net 来源:网络整理
导读:我尝试在 http://landlordscores.co.uk/account/login.aspx使用Facebook身份验证,但在登录Facebook后,回调页面显示“无效的签名请求.(无效签名.)”.应用程序ID和密码是正确的,似乎没有记录其他信息.每次我尝试使用Facebook登录时都会发生这种情况. 编辑: 为
我尝试在 http://landlordscores.co.uk/account/login.aspx使用Facebook身份验证,但在登录Facebook后,回调页面显示“无效的签名请求.(无效签名.)”.应用程序ID和密码是正确的,似乎没有记录其他信息.每次我尝试使用Facebook登录时都会发生这种情况.

编辑:
为了打电话,我使用了几乎所有的代码作为样本.
在标记中:

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

在代码隐藏中:

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":"captcha"}]"));       
    this.hdnPassLength.Value = Membership.MinRequiredPasswordLength.ToString();
    }
}

解决方法

也许你已经完成了这个,但我遇到了同样的问题,而我所要做的就是将我的应用ID和秘密添加到web.config中.

在web.config文件中,我的问题是在这一行.确保这些填充和准确应解决问题.

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

希望这可以帮助!

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读