Adding facebook login to my own website

less than 1 minute read

The official document ( is the best tutorial. But when you follow it, there's a few things you have to take notice.

First, you need to get your app id, if you don't have it. You can create an app by visiting app dashboard ( Fill all the details but make sure you set it to "Website" by clicking "+ Add Platform"

Then, you will try your test code. Unfortunately, it will be likely to fail, as you didn't set "App Domains" for your website. If you are smart enough to set it at the first time, then no problem.



The error message is like the above. So, you have to set app domains. You can set your production domain like "" but you would also need to test it on your local dev machine. For me, I use host file (C:\Windows\System32\drivers\etc\hosts)

[sourcecode language="bash"]    www.your_production_domain.local


And add the test domain to your app settings in the app dashboard.

Then it's done. It should log you successfully. If it doesn't, please let me know.