Firebase. Facebook sign-in method

Artem Diashkin
Sep 16, 2020 · 3 min read

You can let your users authenticate with Firebase using their Facebook accounts by integrating Facebook Login into your app. You can integrate Facebook Login either by using the Firebase SDK to carry out the sign-in flow, or by carrying out the Facebook Login flow manually and passing the resulting access token to Firebase.

First, we will need to add a new Application on our “Facebook for Developers” environment. If you have never done it before — no worries, I will guide you step by step.

1. Go to “Facebook for Developers” page

2. Click on “Get started” if you don't have an account:

3. Create your account:

4. Create an app:

5. Copy App ID and App Secret values…

…into Firebase Facebook sign-in method…

… and don’t forget to copy-paste OAuth redirect URI to your Facebook Login app’s Valid OAuth Redirect URIs settings:

And now we can use Facebook sign-in method in our Firebase application:

You can add additional scopes…

const facebookProvider = new firebase.auth.FacebookAuthProvider();
...
facebookProvider.addScope('email');
facebookProvider.addScope('user_birthday');
facebookProvider.addScope('user_friends');
...

… but note:

You can check Facebook permissions by this link:

Let’s test it out (gif)…

Happy coding!

LITSLINK Frontend Development

Your go-to place for frontend dev trends, know-hows, hacks and tricks.

Artem Diashkin

Written by

Java, Spring, Node.js, AdonisJs, React.js and Flutter developer

LITSLINK Frontend Development

Frontend development is key to user’s happiness & satisfaction. Read how Litslink’s engineering team is solving the hardest FE challenges for the most admirable startups in 2021.

Artem Diashkin

Written by

Java, Spring, Node.js, AdonisJs, React.js and Flutter developer

LITSLINK Frontend Development

Frontend development is key to user’s happiness & satisfaction. Read how Litslink’s engineering team is solving the hardest FE challenges for the most admirable startups in 2021.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store