我嘗試使用Facebook身份驗證http://landlordscores.co.uk/account/login.aspx,但在用Facebook登錄後,回調頁面顯示「Invalid signed request。(Invalid signature。)」。應用程序ID和密碼是正確的,沒有其他信息似乎被記錄。每當我嘗試使用Facebook登錄時都會發生這種情況。Facebook API - 無效的簽名請求。 (無效簽名。)
編輯: 爲了打電話,我使用了幾乎與樣本一樣的確切代碼。 在標記:
<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();
}
}
你可以發佈你用來打電話的代碼嗎? – bkaid 2011-06-11 15:31:34
謝謝,我添加了一個代碼示例 – Echilon 2011-06-13 17:18:37
當你說你正在使用示例代碼...你在哪裏得到你的示例?您似乎沒有使用Facebook C#SDK(您的問題有此SDK標記),並且您的代碼不使用Facebook推薦的JavaScript SDK /註冊插件https://developers.facebook.com/docs/guides/網絡/#登錄 – 2011-06-26 13:45:27