Facebook url not allowed with web, works with cordova - facebook

We've got a combination phonegap/web app, and am trying to get facebook logins working.
Everything works fine with phonegap, but with the web, Facebook returns the familiar (to many) Given URL is not allowed by the Application configuration...
I've tried using localhost in the Facebook settings, as well as setting up a host on my local machine which used the same URL as our heroku development box (except it has https, which I don't, of course).
I didn't include the port number in the website with facebook login, when using the host as heroku, but tried both with and without on localhost.
Things I've tried
locally - http:localhost:3000 // the app
on facebook
website with facebook login -> http://localhost, http://localhost:3000
app domains -> localhost
locally - http://our-dev-site.herokuapp.com:3000 //the app
on facebook
website with facebook login => http://our-dev-site.herokuapp.com, http://our-dev-site.herokuapp.com:3000
app domains -> our-dev-site.herokuapp.com
I'm really not sure what else to try here.
Is there somewhere in the facebook responses that they tell you what URL they are expecting?
-------------- update --------------------
I forgot that our javascript files are actually being served on another port number. The domain for the app is localhost:3000, but the javascript is served from localhost:8080. Not sure if this could be part of the problem.

Related

Not a valid domain facebook on localhost

I cannot seem to run the facebook app on localhost. Whenever I try my domain, i get the error " App domains must match the domain of the facebook web games URL(https). Please connect these domains: localhost.
Your facebook app domain should be from App Url.
So change your App url to - http://localhost:port_num
Will work.

The redirect_uri URL is not supported

I am using facebook app on two servers, dev and live. The dev server is hosted at test.testdev.com and live server is hosted at test.testlive.net. Earlier it was working properly on both the servers but now it works only on dev.
When I try to access it on live server it displays the following error:
redirect_uri URL is not supported
My Facebook app is configured as follows:
Site URL: http://testlive.net/
App Domains: testlive.net testdev.com
I tried using different settings but it didn't worked for me. What may be reason behind this? Also should the redirect_uri start with http/https ?
I found the answer to my question. For live server the redirect_uri was not configured properly i.e. redirect_uri was //test.testlive.net whereas it should have been started with http/https like http://test.testlive.net.
So in future if you face this issue make sure your redirect_uri should start with http or https

How can I test my facebook app with localhost

Now I'm trying to use the sample code in facebook PHP SDK.
Though I can use localhost to view my web on Google Chrome broser,when I fill the URL
(I use APPSERV as my server)
localhost in the "Secure Canvas URL" blank, it always says server connection denied.
(I'm not sure if the message in English is correct.It shows "伺服器拒絕連線"on my broswer)
Thanks for everyone who answers my question.
You can not develop your facebook app on your localhost without SSL anymore.
Facebook made Secure Browsing default and no way to undo it.
So if you want to test your own app on localhost you have to self signed your app.
https://www.facebook.com/notes/facebook-engineering/secure-browsing-by-default/10151590414803920

Given URL is not allowed by the Application configuration

I've been testing my app using my company's domain (which has ssl installed) and works like a charm.
now, I want this app to have its own domain, server and SSL certificate. I purchased a Godaddy SSL certificate(Standard (Turbo) SSL) and asked my hosting to install it, which they did and seems to be working ok...
now when I change the Facebook App settings to my new server, it just fails to load, and the console just outputs "Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. "
Im completely lost on what to do... the settings are like this
Im loading FB using the facebook-actionscript-api 1.8.1
Namespace: myfbapp
App domains: myfbapp.com www.myfbapp.com
Sandbox: disabled
Canvas URL: http://www.myfbapp.com
Secure c url: https://www.myfbapp.com
needed to get a dedicated IP for my game and attach the SSL to it

Use facebook login in localhost

I am doing a project and need to use the facebook API as user login.
The document are clear the usage of the login button of login with facebook.
However, when I test the button on localhost, it gives nothing to me, no error page, no popup windows.
I am using xampp for my local development and the site url that I fill in app setting is http://localhost:8880/atrain/
can someone help? I have searched the internet and change the hosts file but still unsuccessful.
Set up your local server to use the standard http port (80) and use a virtual host with a TLD. It can be a fake TLD such as:
localhost.dev
How you actually accomplish this depends on what type of web-server you are using.