I have an weird issue with facebook connect.
I've tried to run the basic example for JS & PHP SDKs.
While I connect to FB account via connect page, on my localhost it works well but in my web server it's getting refreshed non-stop.
The example is from here: https://github.com/facebook/php-sdk/tree/master/examples
(with JS).
What may be the reason for it?
Check your app URL on your Facebook application settings. This has to match the URL of the script hosting your app. Otherwise it'll try to switch to the correct one.
Related
I'm using facebook's php sdk for a login system on localhost. It was working fine without any problems. But when i try to login now, after clicking the login button it just brings me back to the same page without actually logging me in and changes the url to something like this:
http://localhost/test.php?code=AQA6J5GuQQFCpc9mkOOmuR2...etc
I have double-checked all the code and all the source php sdk files needed. They are all there and haven't been changed from the last time i was able to successfully login. But for some reason it isn't working. Can someone please help me out.
As far as I can see Facebook requires the registration of your web site for the ap, to prevent hackers.
Therefore I don't think it can ever work if your running it on localhost, it would have to run on a domain name.
I have been working on a website that has a mobile version. Integrated into the site is a bit of code that allows users with FB to register without having to fill out a form. If the user meets any of the following conditions all is well
Uses ANY desktop browser
Users ANY mobile browser
The FB just works. However as soon as I do an 'Add to Homescreen' with IOS to make the app look and perform like a native app, when anyone uses the FB signup I get the
'Given URL is not permitted by the application configuration: One or more of the given URL's is not allowed by the Apps settings. It must match the Website URL or the Canvas URL, or the domain must be a subdomain of one of the App domains'
I am assuming that once you use the add to home screen, and the app gets its own instanced browser, the URL changes, likely some form of localhost derivation maybe?
I can't find any definitive answers to fixing this, and was wondering if anyone else had experienced this HTML5 IOS app problem?
Looks like the dev of the extension I was using will be working on a different authentication flow, so not giving this any more dev time
I am starting my first Facebook app, hosted on Heroku. I have set up an app on Heroku for production and a separate app running locally on my own machine for development. Currently, the app (which has very little functionality) runs on localhost just fine. But I don't understand if the app should be able to run like a typical canvas app on the localhost with Facebook functionality. For example, will the Requests Dialog run in a canvas app locally. Should I be able to use that functionality locally as I develop? If so, what steps do I need to take to get that working?
The differences
The only real difference between a standalone site and a canvas app (or page tab) you'll see is that you won't have a signed_request passed in when you load your page.
App dialog will still work, but in popup instead of directly on the page. Plus, you'll be able to login user like you would if you set your local dev URL (eg http://localhost:5000) in the Facebook app settings under "Website with Facebook Login" (or mobile web).
There's also some stuff you won't be able to test on the server like realtime update where facebook send a request to your site to notify an update.
There may be some other things, but this is what I can think about right now.
Working locally
So, what I usually do, is develop it locally. To manage the missing signed_request, I only provide a stub one or I just don't count on it being present so my app can run out of facebook too.
For login methods, I tend to rely only on the JS SDK as most of server side login through a canvas app will rely on the signed_request - and enaway, I found the UX login better via the JS SDK.
Then, I only setup two FB app, one staging and one for release. The staging app point to my locals urls so my Facebook will allow connection from it.
At this point, it should mostly work fine out of the box!
But I don't understand if the app should be able to run like a typical canvas app on the localhost with Facebook functionality
Your app should behave the same way whether it is on localhost or on the final production server.
Facebook dialogs (requests, messages..) should display on your local (dev) machine as they do on the live server. In my case to make this work I setup a secondary "facebook app" with different values for App Domains, Site URL and Canvas URL.
This allows you to run your app from localhost. If you app is canvas-only it will run inside an iframe (which points to Site URL) but will be displayed within Facebook.
Also, make sure you're including Facebook's JS API if you want to see any of the Facebook modal boxes rather than pop-up windows.
The only difference you should notice is that if you share a page from your localhost dev site via the FB API, Facebook won't be able to crawl your site and get any icon, image or description should it need to.
i am using Facebook connect user authentication for my website.i followed some simple tutorials but i couldn't able to make it.since i am using codeigniter and testing it on localhost.i need to know whether Facebook allow to redirect back on localhost or not.if it does then how to work with Facebook connect on local machine.please let me know if you have any solution.
You have to put localhost in your app settings in all the places where it want’s to know stuff like login URL, website, etc. – then it should work perfectly fine. (Except for those functions that actually need Facebook to connect your server, like deauthorize URL – put pure redirects happen client side, so there’s no problem there.)
I run a pure PHP project (so I don't know how you do this with CodeIgniter) and I got Facebook Connect working doing these 2 (that I remember; if don't, tell me and I revise :)
edited hosts file (c:\Windows\System32\drivers\etc\hosts or /etc/hosts) to redirect 127.0.0.1 to domain name you use
set <base href=".."> meta to
"http://{$_SERVER["HTTP_HOST"]}/"
then handle the URI you pass to Facebook Connect properly using the domain you set.
To test, access using http://<the-domain-name-set-in-hosts> and test normally. I guess that's it, and it's working here.
I am currently in the process of creating a mobile version of my web app.
The app is being developed with Facebook's PHP Client Library.
The issue:
I am using the following mobile url to allow users to log in using the mobile devices:
http://m.facebook.com/tos.php?api_key=APIKEY&v=1.0&next=http%3A%2F%2Ftweelay.net%2Fm.php&cancel=http%3A%2F%2Ftweelay.net%2Fm.php
APIKEY being my app's actual Facebook API key.
In the url I am telling Facebook to redirect the user back to http://tweelay.net/m.php when the user signs in or clicks cancel on the log in screen. I am pulling my hair trying to figure out why it keeps sending the user to http://m.tweelay.net/m.php which is currently an invalid end point.
I have gone through all of my app's settings on Facebook and I cant find any that reference http://m.tweelay.net and going through all of my source code I cant find any that reference the m. sub-domain either.
Any ideas? Is there a setting I'm missing? Maybe a Flag in the library?
I've seen Facebook do this when detecting the mobile browser type and also sometimes randomly through Firefox (it can also happen when trying to get to facebook.com). I've managed to reset it sometimes, but it's not a guaranteed fix.
If you want to be sure the user makes it to your correct site I suggest creating the subdomain and redirecting traffic to your usual site, it's what I did and now I don't worry about it reverting back.