How to do local development with Facebook app? - facebook

There are many similar questions on SO but Facebook constantly changes settings and protocols, so answers provided several years ago no longer work or can't be applied.
I attempt to add Facebook Login to my app using JS SDK. When I try it from http://127.0.0.1:8000/, popup tells me that I must add this address domain to "Application domains" in app settings. However, this can't be done for localhost. Here's what I tried so far:
Adding 127.0.0.1 or localhost to app domains, which gives an error message: "App domains must match the domain of the Secure Canvas URL, Mobile Site URL, Unity Binary URL, Site URL or Secure Page Tab URL. Please correct these domains: localhost".
Creating test app and changing Site URL to http://127.0.0.1:8000/, then adding 127.0.0.1 to app domains. This seemingly works, but after accessing settings page again settings remain unchanged and login doesn't work either.
What does seem to work is setting Site URL on main app, but this is undesirable - I want it to work with my production site URL and test apps are supposed to be used for development.

Related

Facebook App domain work with localhost and don't work with my website

I'm trying to add a Facebook sign in button to my website
What I've done so far is adding a Facebook app (type website) and choosing http://localhost/loginFB as path.
The app domain is the host of that site and is localhost
This all works great, but when I change my website to www.example.com/loginFB, and the app domain to www.example.com, I get below error if I try to sign in
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.
Do you have any solution for this?

unity webgl facebook login error

So I have a problem when I try login in to facebook with FB.login in javascript. I get a popup saying
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.
Ive seen a lot of people having this issue, and answer about it,
so Ive tried to changes the setting of my facebook app.
1) put localhost in app domains
2) add a website platform and localhost in url
3) enable embedded browser oauth login
4) add localhost in valid oauth redirect urls
and nothing worked. i tried also with http:// localhost instead of just local host.
Im using apache server to test my app,
you guys have any idea how to do it properly?

Facebook app error - Given URL is not allowed by the Application configuration

I've been doing a lot of facebook apps until now and everytime I had them on the same domain. No issues on any of them.
Now I started using another domain, I have the comodo SSL, but my apps are not working correct.
Evertything is setuped same like I did on the old domain.
Basically the first page of the app loads and than when I click to go to another page, I see in the link bar that it goes to:
http://domain.com/app_name/folder/request.php?code=AQCYkHOF0b3D755VtSWei498C13SvlF_bZ3GjUk8LnwBBQbaCAE9j1bPAkyyxId6hLbCv0-PuwfTkdjxn8sKmLnyL8ltYzg1nf5XD1lo1SPipHet-ZIMfuUWnqSmAJj9Mo2fB6mlUREBV7Lahh5k0MJTyERSDQ8IWrLJQqGmuq0oKe1L_IR1ZgIN1uLYmRXeq9ukRAFc463AcVXdIeLbkFmC2Y8nG8CdEshuA8oVWOgH9ezMFm0H8IVkcKKCJtDp9lSg6XxpL-5gHwPkxw5_e2xflEWrQp3NClBLNN9rOC4rY10yUqUrkTPMSAeGttnYwOo&state=ba25dbfe845349d548c04f6ba14deef8#_=_
redirects to the first page and in the console I get this message
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.
I get this message in the console and when I open the app on the first page.
In the facebook developers I setuped the:
- canvas page
- website
- page tab
Practically I did same like I was doing on the old domain, now if I move the app on the old domain and modify the path in the facebook devleopers is working fine.
Any thoughts?
You need to set the domains of the app in the developers site
If you try to run FB.init in the Javascript SDK from a page in a domain other that the ones you've set - you'll get this error
Note that you can only set domains that are mentioned in one of the following settings in the Facebook developers site:
Canvas URL
Website URL
Page Tab URL
Setting the domain should be as follow:
If your app loads from http://sub.domain.com/ you can put either domain.com or sub.domain.com - I recommended setting the highest level that you have administrative permissions for (if you're hosting on http://myaccount.some-service.cloud-provider.com don't put cloud-provider.com because if you do - all the other clients of that provider will be allowed to use your app id using the JavaScript SDK)

Windows Phone 8 C# facebook app registration

Hi I've created an app for Windows Phone 8 using the ContosoSocial Facebook login interface.
It uses the following call to do this:
FacebookSessionClient fb = new FacebookSessionClient(AppId);
fb.LoginWithApp("basic_info,publish_actions,read_stream", "custom_state_string");
This works fine when I use the default AppId but when I change it to the one given by Facebook following app registeration I get the following error:
Given URL is not premitted by the application cofiguration.: One or more of the given URL's is not allowed by the App's settings. It must match the website URL or Canvas URL, or the app domain must be a subdomain of one of the Apps domains..?
I've searched and this problem has come up on several occations and as far as I can work out it's to do with my app settings on Facebook.? Facebook asks for an App Domain which I've left blank as I'm not sure what this is or used for..? Do I need one..?
I've followed several tutorials Scrumptious but then all show a different app registration process on the screens than I'm faced with. A little research revealed that Facebook has recently changed the process which is making it even more confusing for me. I would appreciate some help here.
I want to create an app which will pull in a news feed direct into a panoramic item on the app's main screen.
Many thanks
EDIT: I've tried adding my web site URL to the app domain by I get the following error: This must be derived from Canvas URL, Secure Canvas URL, Unity Binary URL, Site URL, Mobile Site URL, Page Tab URL or Secure Page Tab URL. Check and correct the following domains: ***************
Below is the screen shot for configuring app:
Store ID, Application Name & Windows Store Beta ID removed, I'm now getting the following error:
App Not Setup: The developers of this app have not setup the app properly for Facebook Login. ?
Go to Advanced Settings in your developers.facebook.com/apps/ of your app and check that "Embedded browser OAuth Login" is enabled and set to Yes.

Given URL is not allowed by the Application configuration

I am trying to use the Facebook javascript sdk for my chrome extension. Since it is a chrome extension how do i integrate it with facebook? is it an app on facebook.com or a website?
Currently i have it as a website.
my site url on the settings is:
http://localhost/Users/home/Documents/facebook/
i have also enabled web sharing on my mac.
do i need to set the site domain as well? what am i doing wrong here?
Enter http://localhost/Users/home/Documents/facebook/ as your "Site Domain" on the developer app:
https://developers.facebook.com/apps/{api_key}/summary
Replace {api_key} with yours; or find a link at https://developers.facebook.com
Interestingly enough, Facebook lets you type anything into the domain so it can be an offline URL (such as localhost or a local port) and Facebook will redirect to it after authentication.
You can test Facebook applications locally if you add an entry to your hosts file which points to any subdomain of the root domain you gave Facebook. For example, if your domain is example.com, you can add entry to your hosts file pointing fbtest.example.com to localhost (127.0.0.1).
You can then test away locally without having to edit your Facebook app configuration (assuming your local server is set to serve the same content to all subdomains).
Alternatively, if it's important to have the exact domain, you can just add an entry for the root domain. It just means you won't be able to access the live site while testing.
In order to develop and publish a Facebook application, you must provide a web accessible URL that Facebook can query. If you have webspace you can upload to or make your IP available to the web for Facebook to call, it should solve your problems.
Facebook will allow you to put just about any valid url into the box, however when you go to use it for logins or general use, you will begin to notice errors, since Facebook's spider cannot fetch the url.
Check the 'Desktop Apps' section of https://developers.facebook.com/docs/authentication/
This explains how to do authentication where there's no server involved, it's aimed at desktop apps but a browser toolbar should work in a similar way