【发布时间】:2011-06-11 12:50:39
【问题描述】:
我正在尝试在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\":\"email\"},{\"name\":\"location\"},{\"name\":\"password\",\"view\":\"not_prefilled\"},{\"name\":\"captcha\"}]"));
this.hdnPassLength.Value = Membership.MinRequiredPasswordLength.ToString();
}
}
【问题讨论】:
-
你能发布你用来拨打电话的代码吗?
-
谢谢,我已经添加了代码示例
-
当您说您正在使用示例代码时......您从哪里获得示例?您似乎没有使用 Facebook C# SDK(您的问题已标记此 SDK),并且您的代码未使用 Facebook 在developers.facebook.com/docs/guides/web/#login 推荐的 Javascript SDK/注册插件
-
@Echilon 你看过 Request.Params["signed_request"] 看它是否返回任何东西?还有你使用的是什么版本的 C# SDK?
-
您是否尝试过使用此页面上的示例代码:developers.facebook.com/docs/plugins/registration?如果您单击该页面上示例上的注册,您将收到一个回显响应,这可能有助于调试您的问题。
标签: asp.net api facebook facebook-c#-sdk