Firebase Authentication

Samuel Overton
Feb 23, 2017 · 4 min read

Hello iOS Engineers,

It’s a great day to learn about Firebase Authentication. In my first article, I briefly explained authentication and why it is useful in an application. Today we will find out more about authentication and how we can use it in our app.

What is authentication?

Authentication is the process of granting a user access to an operating system. To give access, the user inputs their credentials and the application compares that information to the database’s data. If the user is in the database, then they can use the app and if not then they are denied access. We use a ton applications now, and most if not all have an authentication process. I want you to experiment and see how many applications ask for a username and password. That process is authentication.

Why should we care about authentication?

We should care about authentication because it benefits us as developers and our customers. Let us think about how the customer uses the authentication method.

1. The user provides a new username and password for the application.

2. The app has created a unique profile just for that user in the database.

3. The user has access to their data only.

That is just a basic outline of how the user will use authentication. Mostly every app works like the list above. There are apps that the user may interact with differently but this a basic outline. As for us developers, authentication is also beneficial. Let us think about why we would use authentication.

1. Authentication helps with security because the user can save data to the database that they only have access to use.

2. When the user signs into the application, we create a database structured just for that user.

3. Managing all of the app’s data is easier because we can associate users with the data. For example, let’s say we have an app that stores our pictures in a database. With no authentication method, we would not know which user was providing uploading the pictures. Having that information is important because if the user wanted to see the picture they uploaded, we wouldn’t know because the data is not connected to any user. With authentication, we can create a unique ID in our database for that person. Every time that user uploads any pictures, it would associate the upload with that person’s unique ID.

Firebase Authentication

We understand the basics of authentication so now we can discuss Firebase Authentication. With Firebase we don’t have to create our own authentication library from scratch. We can use the infrastructure that Firebase formed to make a great user experience for our users. There are three authentication methods that we can use in Firebase. The three methods are email and password, services, and anonymous.

1. Email and password are what we see in almost every app we use daily. Before you can use most apps, you are asked to provide a username and password.

2. Services is something that has been around for a little while now. The app that you are using will ask if you want to sign in using Facebook, Google, Twitter, etc. Services allow the user to choose if they want to log in with a service they are already using on their device. It makes the process of setting up their account fast and straightforward.

3. Anonymous authentication provides the user with a temporary account. If the user signs up later, they will still have access to their data.

What apps should have authentication?

I believe all app will benefit having authentication. Like I said before this is an excellent way to organize your data. One thing you do not want to do is have no way of holding your data. Authentication is the starting point in an app create the initial data for the user. Unless you have another way of getting that data authentication would be the best solution for the job.

Is setting up authentication for iOS hard?

Configuring authentication isn’t hard with Firebase. You first have to setup your environment to incorporate Firebase into your app. I did create a tutorial showing you how setup Firebase on your app. You can find the video here. In the coming days, I will also create a tutorial on how to setup authentication within your app. There are tons of new content coming down soon. Thank you for your time.

Lastly, understand that you only fail when you stop trying. And remember it’s always a great day to be a iOS Engineer.

RESOURCE:

Google Firebase

Samuel Overton

Written by

Mastering #javascript while creating resources for #devs to level up in their careers. I'm a 3X national 🏈 champion learning to be a champion of life 🏆😀.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade