Facebook login worked on localhost but not on hosting - facebook

We have a website that uses Facebook for login, when we run it locally used to work fine. We had a Facebook application with App Domains and Site URL pointing localhost and worked just fine.
However, when we moved into production, we uploaded the site to our hosting and changed the setting in the FB app to match this change.
Now we put "xxxx.com" in App Domains and "https://www.xxxx.com/" in Site URL (it works in both HTTP and HTTPS).
However, when trying to log in I get a 401 error.
I tried every different combination in the FB app that I could think of but still it's not working.
It can't be the code because used to work fine running it in localhost with the app set-up pointing to localhost but I can't make it work on our hosting...
Any ideas?

HTTP Error 401 - Unauthorized
The error code says it all.

See if setting App Domains to blank will help.

If your using an iPhone app go to settings and go to wifi. Click on your wifi. Now go down to renew lease. Click on that. This will solve the problem. I had the same thing happen to me and nobody had an answer. It took me an hour of messing with my phone to find this solution. Hope this was helpful for you.

Related

Have no idea why Facebook login doesn't work

Have no idea why Facebook login doesn't work. Tried all answers to similar questions.The weirdest thing is that there is another app with same settings which works just fine. Maybe there is some kind of update I don't know about.. App runs locally on http://127.0.0.1:8000
Added facebook login product and in value OAuth redirect URLS entered everything possible: localhost, http://127.0.0.1, http://127.0.0.1:8000
Made app public, tried also creating test app. In app domains it's localhost and in Site Urls I tried both localhost and localhost:8000
EDIT: FB init doesn't even work. So no response to debug or something
And anyways I get this error:
Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings.
Id and code is correct. The same works on different project(Checked id, all comas and etc). What else could be theoretically wrong? At least does the error mean what it says The domain of this URL isn't included in the app's domains. ?
Same problem here, Just started happening with no warning.
I was using .Net Identity 2.0 with Microsoft.Owin.Security.Facebook 3.0.1 however it seems Facebook may have deprecated support for this.
The only symptom I got when debugging is that the call to AuthenticationManager.GetExternalLoginInfoAsync() returns a null which is extremely not useful.
In the end I upgraded to the release candidate using the NuGet Package Manager Console command "Install-Package Microsoft.Owin.Security.Facebook -Pre"
If you're using .Net with this package then I recommend you test this solution in a staging environment first and see if it fixes the issues (and that it doesn't cause any new issues).
it's the FACEBOOK APP PLATFORM in settings
I had my disabled and kept getting error
I enabled the app platform and it works.
enter image description here

FB.init() callback stopped been called

I know that there are similar question, but I think that my situation might be different.
I have two facebook applications. One is for develop - it works in sandbox mode and works with localhost. The other one is for production, with the sandbox mode off and an active ssl.
I haven't used develop app for some time, and now I've found that FB.init() is not called anymore. However, in Google Chrome browser everything works fine, and production server works in all browsers. What can be the reason of this problem? Did Facebook got some king of update or something like that? Maybe it stopped to work because develop app needs SSL too?
Took me some time, but I figured it out. Now to use your develop non ssl applications on facebook, first you have to go into Security tab in facebook account settings and set Secure Browsing to disabled.
What I can't understand, why I haven't got any notification from facebook about this issue? If there was some kind of notification, then it was too hidden.

Facebook auth works fine on localhost but from my host it wont return user info

I am trying to use the Facebook plugin for cakephp written by webtechnick in a canvas app on facebook.
It works fine when my app points to localhost, and I can see all the info about myself using the api('/me') call.
But on my dreamhost server /me returns null, from the same browser, and localhost is still showing /me fine. Other api calls work fine as well, the app id and secret are correct, and I have tried increasing the CURL timeout settings in the sdk.
Are there any settings within the facebook app settings which would always allow localhost, but require more details about the url of my app? I can't see any that seem relevant, and I can't find any other support queries of a similar nature.
Did you update the "website" address in the facebook developer settings for your app to point to your updated domain address?
It turns out that the appID and appSecret were wrong - I had inadvertantly copied another config onto the live site.
Hope this helps others in the future!

php-sdk sometimes doesn't connect to facebook but rarely and for no apparent reason

I have been using php-sdk to connect to facebook for a while and I never had any problems, but now, I can't connect from my computer.
But other people can connect from their computers, I asked a lot of people to confirm and they all said it worked fine..
..can facebook put a ban on my ip or something ?
It's not a ban, it happens when the auth cookie get's messed up on your local machine. It either just hangs when you try log in or continuously redirects.
My suggestion would be to create a page, include the PHP FB SDK make the following call:
$facebook->destroySession();
That should get it working again. (well, it does for me)

Custom facebook page tab issue

So, for whatever reason, some people can't see the custom facebook page tab. Not sure why, especially when I can see it just fine.
Link: http://on.fb.me/rKNxUS
Let me know if you need more info.
Do you have a https version of the page tab? If they're account always uses ssl and you don't you might run into issues. Other times I've seen resetting the app secret help with issues like this.
It shows a standard browser error page to me. "This webpage is not available Google Chrome's connection attempt to incontrolwebsites.com was rejected. The website may be down, or your network may not be properly configured."
May it be possible you didn't upload the webpage to the production server?
If it opens correctly from your machine: check that you don't have a custom DNS setting to point to your local webserver instead of the production server.