Link Facebook with Firebase

Why I need to link Facebook with Firebase?

Well, to achieve facebook authentification in your website easier!
Why I should use Firebase? That’s beyond this article, but you can read more out there. I will only argue saying that Authentification is a free feature supported by a giant like google and if your are starting your project and you want to achieve social auth you want to use it. Maybe some time ahead you want to support Linkedin, Google, etc. Firebase Auth is all-in-one solution. You dont need to battle with different libraries for each provider. It simplify your codebase. Brief. Let’s start.

Create a Firebase Account

Pretty straightforward. After your have your account created please visit your dashboard. The link is in the top-right corner of the screen.

Create a new project

Choice a name an country.

With your new or existing project open visit the Auth section.

Edit the auth method for the web app that you want to use. In this case, Facebook.

Paste your Facebook app credentials (id and api key)
Firebase also provide you with a callback url that you need to paste in your facebook app dashboard. Lets go there!.

First, enter in your facebook apps board and create your app.

Enter your app dashboard and add a product on the left nav. Select Authtentication.

Left everything by default and paste the callback URL from Firebase. You can specify multiple URLs there depends your needs.

Finally, copy your ID and API KEY from the main panel

And paste it in Firebase as I show you before

Further steps require you to implement the web code logic (just a few lines of code). For example if you have developers that will implement the social auth for you just provide them with the initialization code that you can extrat from the console.

To continue reading about implementation, you can check the official docs here.

Good luck!