Facebook API - Bad signed request. (Invalid signature.)

I try 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 application identifier and secret are correct, and no other information appears to be logged. This happens every time I try to log in using facebook.

Edit: To make a call, I use exactly the exact code as a sample. In the markup:

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

In code:

 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(); } } 
+6
source share
3 answers

You may have already done this, but I had the same problem, and all I had to do was add my application id and secret to web.config.

In the web.config file, my problem was on this line. Ensuring their filling and accuracy should solve the problem.

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

Hope this helps!

+4
source

I think you will find that this is due to cookies.

I played with different examples of websites that are in sdk. I cleared my cookies and then I stopped this error.

+1
source

You should check your app’s settings on facebook. Take care of the urls and other settings.

-2
source

Source: https://habr.com/ru/post/890285/


All Articles