Facebook domain name when using localhost

From the tutorial here:
http://ankurm.com/blog/api/using-localhost-for-facebook-app-development/1091/

I tried setting up a local development area for my Facebook application. But when I put " http: // localhost: 85 / my_app / " as my domain name, Facebook says

Application domains: http: // localhost: 85 / app-name / "should not contain protocol information.

Also, when I put "localhost: 85 / my_app /" as my domain name, I get an error message:

Application Domains: localhost: 85 / my_app / is not a valid domain.

+80
facebook
Nov 14 '12 at 10:08
source share
15 answers

My decision:

  1. Leave application domains blank
  2. (Products) Facebook login> Settings
  3. Add http://localhost:85/my_app/ to the Valid OAuth redirect URIs field
  4. Save changes
+55
May 12 '14 at 13:20
source share

It looks like the protocol has been changed.

Here is my solution (I tested on April 3, 2015 and works well):

In Settings โ†’ Basic tab

  • Application domain: localhost
  • Click " + Add Platform " and select " Website "
  • Site URL: http: // localhost: <port> / (<port> your port number)
  • Save changes
+55
Apr 03 '15 at 7:30
source share
  • Leave application domains blank
  • Go to the site using Facebook Login
  • Add http://localhost:port_number/
  • Save the changes and try again. For more information, visit

http://developers.facebook.com/docs/samples/canvas/ Happy coding :-)

+44
Mar 13 '13 at 22:23
source share

This has changed over the years, but I just got it to work with the webapp, which I run on localhost. This is what I did:

  • Go to https://developers.facebook.com/apps
  • Select your application.
  • Choose Settings> General in the left navigation bar.
  • Click the Add Platform button at the bottom of the page.
  • Click Website
  • Enter http://localhost:8080/ for the site URL.
  • Click the quick launch button in the far right corner of the URL of the site you just entered.
  • A new tab will open. On this tab, scroll down to the โ€œTell us about your websiteโ€ section and enter http://localhost:8080/ again for the website URL.
  • Press "Next".
  • Tried to log in again, and it worked this time.

Good luck

+30
Jul 09 '16 at 19:23
source share

2018 working solution

It took me a long time to figure this out, so I will share my decision.

I tried all the suggested answers, but nothing worked, and in the end all I had to do was go to https://developers.facebook.com/apps/YOUR_APP_ID/fb-login/settings/ and add my full url to call back in the Valid OAuth redirect URI field.

In my case, using ruby โ€‹โ€‹on rails, my URL looked like this http://localhost:3000/user/auth/facebook/callback .

And right after I added it, it worked! Hope this helps someone else run into this issue.

+29
Oct 10 '17 at 3:44 on
source share

This is what I did before.

If you are using Windows, you need to modify the host file. The location of the host file will be in %SystemRoot%\System32\drivers\etc\

Add a new line to the host file as follows:

 127.0.0.1 localhost.YOUR-SITE-NAME.com 

Save the host file.

Go to the FB application settings control panel and enter localhost.YOUR-SITE-NAME.com in the Apps domain field. Save changes.

Now download the local environment, for example localhost.YOUR-SITE-NAME.com , from your browser.

NB. Change the SITE NAME to your domain name.

+11
Jan 05 '14 at 15:16
source share

Working solution (August 2018)

First, select your application on the developer toolbar .

Then make sure your application is in development mode , as it allows localhost over HTTP. To do this, click on the switch located in the upper right corner of the page of your application.

Finally, follow the notes below, as they can cause problems if filled incorrectly:

  • Settings > Basic > App Domains must be empty
  • Products > Facebook Login > Settings > Valid OAuth Redirect URIs must be empty
+6
Aug 10 '18 at 12:21
source share

You can leave it blank or use localhost , http://localhost:85/my_app/ is the URL

+5
Nov 14 '12 at 10:30
source share

When I wrote this tutorial, at that time the port was allowed in the application domain. And I really can run the application with 81 ports (Wamp Server). Now it looks like facebook does not allow port in url. You can use localhost in the application domain.

I will update the information as soon as possible. I am trying to find a solution.

A workaround is to use localtunnel http://progrium.com/localtunnel/

+3
Nov 16 '12 at 15:44
source share

You must create a tunnel to share the local host; Ngrok is the easiest way to do this.

+1
05 Oct '13 at 13:02
source share

https://ngrok.com

Follow the link https://ngrok.com/ to download ngrok and extract this file. Open cmd (search for cmd) Go to the directory where ngrok is extracted. Open ngrok from the command line ex: c: /ngrok/ngrok.exe [port] or cd c: / ngrok, then ngrok 80 (ngrok [port]) You will get

ngrok

 Tunnel Status online Version 1.3/1.3 Forwarding http://3ahsdfhska.ngrok.com -> 127.0.0.1:80 Forwarding https://3ahsdfhska.ngrok.com -> 127.0.0.1:80 Web Interface http://127.0.0.1:4040 # Conn 0 Avg Conn Time 0.00ms 

Dont FORGET to make sure your Wamp server is open on the same port ... (how to check -> goto-> wampicon-> apache-> httpd.conf look for the port or 80 (by default) use 80 for ngrok.exe)

http://3ahsdfhska.ngrok.com

there will be a URL to access your local hosting

+1
Oct. 31 '13 at 18:34
source share

If you get protocol errors, you not only need to DELETE Http: //, but also if there is any backslash at the end of the web address, you must delete it too, or it will not work. I did it and it worked perfectly! Holla!

0
Jul 12 '13 at 21:16
source share

Discarding another solution into the mixture:

I installed my site according to the instructions, then added a second application (Facebook Canvas) and installed it for http://localhost:XXXXX . Now I can access FB both locally and in production.

0
Dec 04 '15 at 17:26
source share

I am developing locally and I am using this URL: localhost/fb

Then I had to add a site with the following URL: http://localhost

In the "Application Domains" section, I added localhost .

Now it works. The only problem I am facing is that you have to use this URL in all your scripts. For example.

 $loginUrl = $helper->getLoginUrl('http://localhost/fb/login-callback.php', $permissions); 

You cannot use 127.0.0.1 here ...

0
May 31 '17 at 19:07
source share

I tried all the solutions mentioned here, but none of them worked.

My problem was solved by copying the "OAuth redirect URI" from firebase to the Facebook application "Valid OAuth redirect URI"

I left all domains empty

0
Jul 28 '19 at 1:27
source share



All Articles