How to authenticate users using React and Firebase

Authenticating users is very hard to implement from scratch and you’ll have to write long lines of code in order to implement it but firebase makes it simple. In this article we will learn how to authenticate email and password using Firebase. We will start by setting up a project. After that, we will register a user and then we will log in with the same credentials to demonstrate the authentication.

Web app setup

Click on the Web icon as shown in the figure to create your web app. Name your app. I’ve named it similar to the project name. Click on ‘Also setup firebase hosting for this app’ if you wish to host it or else you can host it manually later. Next, Click on Register app.

Using the script tags for setting up firebase is usually not preferred because you’ll have to edit files. Usually, we install the packages through the terminal. For now, just click on Continue to the console.

Now, you’ll see a similar page to the one which appeared when you created the project initially. Click on the Authentication present in the side bar on the left side. Alternatively, you can even click on Authentication card which is purple in color.

Click on Get started.