I\'ve been writing a game for Facebook using Rails and jQuery. Since I started using the Facebook Javascript SDK, using localhost as an app domain seemed to work just fine.
You can still test your app without deploying it on a remote sever like heroku.
The trick is to update the etc/hosts
file this way:
127.0.0.1 mydomain.com
Then on the Facebook App's settings, type [http://] mydomain.com, without the "[" and "]"
It worked for me this way
I ran into an issue with my Rails app that I usually run with http://localhost:3000 because Facebook now requires the Valid OAuth redirect to use https.
To use https locally, I used [ngrok][1] which allows you to use https by providing a tunnel. To do this:
Try using the url with port, e.g.
http://localhost:8000/
I was having the same issue and found this solution right now.
Solution using Firebase
In order to get this working on localhost
, port 3000
I did the following:
localhost
to App Domainshttp://localhost:3000/
to Site URL by selected "+ Add Platform"Up to this point I had followed all previous answers submitted on here, but nothing worked.
So...
In the left hand menu, select "Add Product"
Add "Facebook Login"
You will be presented with a workflow carrousel, with defaulted domain http://localhost:3000/
, click "continue" until the end.
Select "Facebook Login > Settings" from the Product Menu.
Enter your Firebase OAuth redirect URI (found when enable Facebook Login in your firebase console https://console.firebase.google.com, example below)
Done.
For me it worked like this:
Configuring the facebook app dashboard:
*On the ' basic ' tab:
1) Leaving app domain empty.
2) Erasing any platform. Meaning: no website no canvas platform. (so no site-URL field to fill)
*On the 'advanced' tab:
3) I entered into the Valid OAuth redirect URIs:
http://localhost/myappfolder/redirect.php
4) regarding my code, insdie my c:/xampp/htdocs/localhost/myappfolder/index.php (this file makes the loginURL):
$helper = new FacebookRedirectLoginHelper('http://localhost/myappfolder/redirect.php');
inside the redirect.php file:
$helper = new FacebookRedirectLoginHelper('http://localhost/myappfolder/redirect.php');
and I got a session! finally! no need to hang myself in the end :P