Testing Facebook Authentication on Local Host (Laravel 4) - facebook

I am trying to set up Facebook authentication with hybridauth in Laravel 4. I would like to test the authentication on my localhost server.
The domain where I would like the authentication to occur on is at:
http://localhost:8888/crowdsets/laravel-master/public/fans/landing
I have included the base url in the config file as:
http://localhost:8888/crowdsets/laravel-master/public/fans/landing/auth/
In Facebook, for my app, I am trying to set up the local host as the Site Url and App Domain.
I used:
Site Url: http://localhost:8888
App Domain: localhost:8888
I am receiving the error from FB:
Error
App Domains: localhost:8888 is not a valid domain.
Do you have any idea what I should be using in order to test this authentication system on my localhost? I am using MAMP on a Mac OS X 10.7.5 machine.

I was able to get this working for my Rails app locally without using a virtual host. Here are the steps I used:
Go to http://developers.facebook.com/, create, and setup your app
When inside the dashboard, click "Settings"
Click "Add Platform"
Choose website (for authentication via the web app)
Add http://localhost:3000/ as "Site URL" (and "Mobile URL" if necessary)
Add localhost to "App Domains" above
Click Save
Whereas you have your App Domain as localhost:88888, I believe it should just be localhost.

Related

Facebook app: Cannot add localhost domain with my live server domain

Whenever I tried to add localhost domain with my live server domain in my facebook app domain it shows me error "App domains must match the domain of the Facebook Web Games URL (https), Mobile Site URL, Unity Binary URL, Site URL or Secure Page Tab URL. Please correct these domains: localhost".
Is it possible to add the localhost domain along with my live server domain?
A good way to solve this is to use a Test App: https://developers.facebook.com/docs/apps/test-apps/
Test Apps have different settings, so you can easily use localhost without an additional platform as workaround.

Testing "Facebook Login" locally

I am trying to locally test my "Continue With Facebook" button. I get this error telling me the URL is invalid. Below is how I have configured my app's OAuth settings. Based on all my research this is configured correctly but something is still wrong.
I am using npm http-server to run a local instance of my site. It is running on localhost:8080
As per the last image, it wont let me add domain such as "http://localhost:8080". It only lets me add "localhost"
If your actual production URL is domain.com then in FB > Settings > App Domains, add the additional URL local.domain.com. Then on your local machine in the /etc/hosts file (or Windows equivalent) add the entry:
127.0.0.1 local.domain.com
In a browser, navigate to local.domain.com and that URL will be served up by your local machine (i.e. localhost). This will keep Facebook Login happy while running a test / development version.
You'll also need to whitelist your machine's IP (in FB > Settings > Advanced > Security > Server IP Whitelist) and add an additional http://local.domain.com/callback (in FB > Facebook login > Settings > Valid OAuth redirect URIs).

Meteor accounts-facebook not working on server

I have followed the this tutorial (http://bulenttastan.net/login-with-facebook-using-meteor-js/) to setup Meteors accounts-facebook package. The application worked fine while working on the local environment(localhost).
Now that I have hosted the app on my server I have the following configuration on my Facebook Apps Dashboard.
But when I try to login from my application I receive the following error message:
"URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs."
My app is hosted on the port '3002' so, I have set the port along with the domain name on the Site URL section on facebook and with respect to the site URL I have also set the redirect URI as given on the image.
Thanks in Advance.
Found a Fix! Setting the ROOT_URL environment variable did the trick for me.

Facebook url not allowed with web, works with cordova

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.

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