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

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)

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

Sessions are Missing With Facebook PHP Sdk (Nginx Php-Fpm)

I have 2 different servers and one has login problem with facebook. After days and hours debugging , I realized that I can get only one session from facebook session array.
Server with Php-Fpm and Nginx has also memcached installed on server. But never record sessions on memcached.
PS: I realized that my facebook login doesn't work properly, when we installed ssl on our server. Till 19th of june, my facebook app summary doesn't show any active users.
I already asked a question before debugging my server, so this question different than this question but you could have some clues there.
Codeigniter getuser() returns 0 after facebook dialog
Array
(
[fb_318641601624810_state] => a44e40cd3f78e7bd3ff39308aebf32ef
)
Hosting from hostgator
Array
(
[69a781bf56f6d6bfec49fd65c890f879_fb_136649313157374_state] => 6df72b81b5be574ea5b263ef97225b3b
[fb_319000531588917_code] => AQCAGxOs9dtrS9ppFC6NhLOiWc1moSLPMl0JewkEYYrBWKP7PvL9hv_LuV6vv3pmBzmawpQ8J5aj3hl9ZEiHEWlm5hw9EroLH_JOVXv3YvJcZfdzknQ1QscPnEQr8DgYbFOH-_S193p7Fv2PNd0U3IR1zE1Jb9YOjHorzWjW5iyrGzu2mF3g7Nmg2ONEibmlNQUKUwljcUC7lyzxeC6qjHMEkYqDm3-f8xWx7OjVtQQzFoRZzXgTOislJ7-JQ0LHnu4kZjT46Q0K64Bvz040ab2hwoRjyiUIgWwFpctuYMtqYxxRnt2nJXNRCn8oigF_LB0
[fb_319000531588917_access_token] => CAAEiIRleVzUBACpazeUMcTvULMpPZADu5QwiPpAU0RUmHGIFNkWsvfQKPCvBpC3ZA8C1IfuALn0YVyobGffp52o1ZBJbpiPSx66ZBO6MGoEZBhRkLjsjIZASRxvNyLhj5mqddxbcREZCznuYyeVLZAa97IiHA9ZC3arkJZBThtuYylLym8jG8zdTtaHIoG0oKKeb8ZD
[fb_319000531588917_user_id] => 608666757
)
I start to compare php.ini confs but there is no luck, is it possible have problem like this? Or am I debugging wrong? Because I have been working on this for 2-3 days and I'm nearly getting crazy.
My testing page both of them are different apps for testing. These are not Codeigniter based testing pages they are simple php sdk's, I wanted to know that if the problem is with Codeigniter.
So the problem is my nginx site never get return access_token in session array.
You could compare my phpinfo files from here.
Compare Phpinfo files
I will be really happy if you could help me on debugging this problem, now nobody could sign up or login from my facebook login.
Just only one scenario works, if user already granted my app in past. User has to click login again after access token error.
After alot debugging and session handler tests. I realized that the main problem is PHP 5.5 still keeps state session. And query_string state code couldn't match state codes. So always CSRF problem on PHP 5.5.
I will install new server with php 5.4. Will keep you about this bug.

Facebook login worked on localhost but not on hosting

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.

Unable to pass FB OAuth for my application

We faced with issue originally on the BB app. We stuck in browser whenever we use auth URL:
http://www.facebook.com/dialog/oauth?scope=publish_stream%2Coffline_access&redirect_uri=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Flogin_success.html&response_type=token&display=touch&client_id=127229817336080
Interesting what is wrong with the response because even desktop browser stuck.
We submitted issue to FB but still are looking for workaround. Any thoughts/ideas are appreciated.
Nothing wrong here, I just authed your app without problems....
whats wrong ?
i just installed your app with 2 extra permissions (posting as me & offline access token)
(just remember offline access token will be not available try to use long time tokens )
Even we faced similar type of problems in authenticating our FB App. Authentication window use to hang up and nothing use to happen and symptoms were same as you are facing. Probably this may not be the answer to your problem but it might be worth knowing that FB SDK have such issues if your application runs on non-standard ports. The standard ports are 80 and 443. Once we started running our app on these ports the error was gone.

Blank popup with FB connect

I've implemented the facebook connect using Javascript SDK. The authentication works fine when the user I'm trying to authenticate is not logged into facebook. But when he's already logged into facebook the login popup never closes. The url of the popup starts with "http://static.ak.fbcdn.net/connect/xd_proxy.php#cb=....."
This happens both on Firefox 3.5 and on Chrome.
Any suggestions? Do I need to set any extra parameters while connecting to Facebook?
I've encountered the same error today, with my year old implementation. I've added the channelUrl tag to FB.Init(), without any luck; so I started the login procedure from scratch with the js sdk, oauth2 enabled: with some minor changes, everything started to work misteriously again. I've run my pages through the Facebook debug tool as well, it suggested some changes as well.
To sum up: basically, if Facebook Connect stops working, upgrade your code according to the latest documentation avaliable.
No special parameters are needed. This is probably a browser problem. Maybe you have a setting/plugin somewhere that does not allow Javascript to close a window for you.
The easiest way to test this is to post a link to your implementation so that other people (with other browser setups) can give it a try.