Setup of Firebase Authentication tutorial (step by step)

AndroidCrypto
4 min readDec 24, 2023

--

The Firebase environment needs a setup for each product, and in this article I’m setting up the Authentication product. It is part 2 of an article series about the setup of the most used Firebase products. It is based on the first tutorial “Setup of a Firebase project tutorial (step by step)” — please check that you are ready to add a product to a project. There is no code for an Android app (see the links to my other articles for this topic.

What is Firebase ? Firebase is a set of backend cloud computing services and application development platforms provided by Google. It hosts databases, services, authentication, and integration for a variety of applications, including Android, iOS, JavaScript, Node.js, Java, Unity, PHP, and C++. (source: Wikipedia).

Authentication is “an end-to-end-user identity solution in under 10 lines of code”. As most of the Firebase applications have to do with storage it is meaningful to know that the acting user is allowed to do so.

We use the link https://firebase.google.com/ to login to Firebase and click on “Go to console”, select the project you already have setup and then choose the Authentication product:

A notice about the product appears:

The next step is about selecting the sign-in methods you are going to accept:

In my tutorial I’m using “Email/Password , “Anonymous” and “Google account”. Click in the “Native providers” section on “Email/Password”:

Click on the switch to enable “Email/Password” (please don’t use “Email link” at this time as it requires more setup steps). Click on “Save”.

At this time “Email/Password” the only enabled provider, click on “Add new provider” for the next step and choose “Anonymous”:

Click on the switch to enable “Anonymous” and on “Save” for the next step. In the overview click on “Google”:

As for the other providers, click on the switch to enable Google as log-in provider. There is a note regarding the “SHA-1 release fingerprint” — we do this in a few moments. You can change the “Public-facing name” — I leave it with the default value. The point is to provide a “Support email” — just use the default value of the Firebase Google account. Now it is time to click on “Save”:

If you read this red written message “Can’t enable Google sign-in” you are encountering a real problem. Another project with the same Package name exists that will prevent you from using Google authentication in this project. You have to change the package name of your app to use Google Authentication.

Now we are ready — we enabled three Sign-in providers (“Email/Password”, “Google” and “Anonymous” for Firebase Authentication.

Update 2023–11–27: As Google changed a setting you may encounter problems when using Firebase UI. Please go to “Settings” and disable the option “Email enumeration protection”. If not doing so you can’t sign-in but only sign-up users in Firebase UI Auth module (it was not updated so far).

If you just needed an authentication service for your project you are ready to download the “google-services.json” file, move it to your app folder and start developing your app.

Article series about Firebase:

  1. Setup of a Firebase project
  2. Setup of Firebase Authentication (this article)
  3. Setup of a Firebase Realtime Database
  4. Setup of a Cloud Firestore Database
  5. Setup of Firebase Storage
  6. Finish the setup of the Firebase project for an Android app tutorial (step by step)
  7. Finish the setup of the Firebase project for a Web app tutorial (step by step): will follow soon
  8. Firebase tutorial for an Android app (Java): will follow soon
  9. Firebase tutorial for a Web app (Javascript): will follow soon

--

--