Using Localhost For Facebook App Development
Note: This post was written in 2015 using an older version of ngrok. The current ngrok CLI uses different syntax: custom subdomains (-subdomain flag) are no longer available on the free plan, and the auth token command has changed to ngrok config add-authtoken <token>. The general approach of tunnelling localhost for Facebook OAuth is still valid — see the current ngrok documentation for up-to-date instructions. As a programmer you do develop every application on your machine first and then you test it on same machine and then you push it to remote test/production environment. You are developing a Facebook app and your requirement is user must login to use the app. Now you are ready with local environment, you have created a new project in your powerful IDE, you have downloaded the SDK, you are done with creating a new app in FB developer, now you are trying to add app domains to get access to FB's oAuth API. Hmm..... Something went wrong!... Facebook is not allowing you to use 'localhost' as app domain. Now what to do? Here is solution.