I am trying to run facebook App from my localhost .I made the canvas URL and secure Canvas URL to http://localhost/myapp and https://localhost/myapp .but the link http://localhost/myapp doesn't even work at my localhost.I enable mode_ssl and php_openssl extentions as well.I read different tutorials on internet but all invain. Anyone who already tested facebook apps on localhost.
Thanks
If you want to do it properly, try following this tutorial:
http://www.phpjoel.com/2011/04/07/installing-ssl-using-openssl-on-a-wamp-localhost/
The issue isn't anything to do with Facebook, so just concentrate on getting it without facebook first.
I haven't bothered making a self signed certificate to test facebook apps, what I have done though is make sure secure browsing is turned off on facebook. Then you should be able to hit the http://localhost/myapp and it won't redirect you.
Related
I'm developing a PHP app on my local computer and trying to use the public data API. The key has been generated and works well online, but as soon as I try to execute it on my localhost it returns
Access Not Configured. Please use Google Developers Console to activate the API for your project.
I have added these lines to the 'allowed referers' section in the developers console.
http://127.0.0.1
127.0.0.1
http://localhost/
localhost
http://myIpAddress
myIpAddress
None of them seem to help. This is the query sending via GET:
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=######&fields=items%2Fsnippet&key=#######
My issue had nothing to do with the cases described here, but might help others.
I had a scenario where the API worked well online but not on localhost (WAMP), after migrating from old API.
The fix had to do with cURL, and I really can not explain why it did work online, I am not an expert, it's something related with SSL.
Basically, you need to turn of SSL verification, by using
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
According to your answer #neki-doar-fraer, i make the explanation more clear for other viewers of this post :
From the doc of YouTube API
Use a server key if your application runs on a server. Do not use this
key outside of your server code. For example, do not embed it in a web
page. To prevent quota theft, restrict your key so that requests are
only allowed from your servers' source IP addresses.
Use a browser key if your application runs on a client, such as a web
browser. To prevent your key from being used on unauthorized sites,
only allow referrals from domains you administer.
From the Google Developer Console, assuming you have already created a project, select the project you are working on.
Then from the side menu on the left select "APIs & Auth", then "APIs". From that screen you have to search for the YouTube API and then click the "On" button next to it.
I figured it out. I was using the browser key. Did not know there is a difference. Generated the server key and everything works.
I have always edited my HOSTS file to point the domain to LOCALHOST when testing things locally https://en.wikipedia.org/wiki/Hosts_(file)
I'm working with the PHP SDK on localhost. I've looked at other questions posted on here like this:
Can't login to website using facebook's api's
Domains, urls, login urls all match. The app secret and id match, sandbox was never turned on (double checked to make sure). I had trouble moving it to a new laptop, cuz the folder i put it in was called something else. After i changed that it worked fine.
The problem I'm having is, I as the owner of the app can log in and it does what i want it to do, but if i have a friend, or another user try to log in, it asks for permissions, then shows the "An error has occured, Please try later" facebook error page. Not entirely sure why its doing this, because i havn't hardcoded my info into it at all.
I've used different browsers, cleared cookies, nothing seems to work. Any ideas would be helpful.
EDIT: i've also tried destroying the session before login, didn't help.
Thank you.
Other people cannot access your app 'on localhost' if they are not using your computer, which is the local host.
If you want other people to be able to use your app, they'll need a copy of your code, running on their local machine, or you'll need to make it available via a publicly accessible IP and/or domain name.
I'm having a little problem with the whole Facebook app development.
I created an facebook application and gave it an IP for my server.
I set my .php script file on the server and set the secret key and appId.
When I click on the app on my Facebook account to reach it, I get an "Uploading (0%)" text on the bottom of the browser and eventually I get a message:
"This webpage is not available".
When I used the "Heroku" hosting service, I got an app.
I think the problem is the communication between Facebook and my server but I don't know what.
I tried almost everything.
Can somebody help me?
If you issue a request to your application from the linter tool?
http://developers.facebook.com/tools/debug
If you run your own application url through there and don't see any activity then Facebook just cant access your server and you need to do some work with your firewall.
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.
How do I keep my applications settings on Facebook, so that it supports subdomains?
I just integrated a question and answer type forum on a school community and its available at http://swades.engr.scu.edu/askswades/
Thus here were my settings on Facebook :
Site URL : http://swades.engr.scu.edu/
Site Domain : scu.edu
I am not able to get it working this way. What am I doing wrong? I double checked the API settings on code, and its all right.
Will be great if someone can help me! Thanks in advance!!
This is setup correctly and should be working. Without seeing errors, its hard to know what's broken.
As long as you only implement Facebook Authentication on URLs which are a subdomains of your Site Domain, all is well. The Site URL is for linking purposes, it does not tie FB Auth to that URL.
You can check Auth is working by calling FB.login() in JS in any page which is being served on a subdomain of scu.edu: https://developers.facebook.com/docs/reference/javascript/FB.login/
Facebook says that all subdomains will work, but you can try adding swades.engr.scu.edu also to your list of domains.