Let's look at the options for authenticating our users before we even touch the FIREBASE database side
of things.
Now, authentication is common across all of the firebase products, as in once you're authenticated,
you can have rules for that particular user that allow them to access certain parts of your firebase,
of your database, whatever it is, in certain ways.
So you have to be very careful with authorization and only allow people what they should be authorizing.
So never turn everything on and then remove functionality instead.
Add functionality as you require it, require it, but keep it very, very limited.
Otherwise you could end up with a massive firebase bill because users are abusing your service.
OK, so I'm on the FIREBASE Documentation website and that is at five based at Google dot com slash
docs and then select iOS.
And then if we scroll down, we can look at all the various products that we have at the site here.
Let's just look at analytics for now and an introduction.
OK, so it's going to say blah, blah, blah, you can do this, that and the other, how does it work?
Where does it work?
Let's just get started, shall we?
And let's click the iOS version.
Why are we on analytics?
Because I clicked the wrong thing, did I?
I'm sure I clicked authentication anyway.
Let's go to iOS and sign in with a pre-built UI, right?
So this is pretty new in Firebase as far as I'm concerned.
They provide you with UI that allows you to let users sign in with their Google account, their Facebook,
Twitter, phone, email, whatever it is doesn't matter.
And that's very, very handy because to implement these five things alone would take so much of our
time and effort as developers.
Much better if someone does it this way for us.
However, we are not going to do it that way.
Instead, we are going to do it manually so you can get a proper understanding of how the OS flow works.
And in most cases, once your app is has taken off and proven itself, you actually want more control
over the Sinon process.
I believe you can still have the Google buttons and Facebook buttons if you want to in your own design
file.
You don't have to use Google's pre-built UI.
Okay, so first of all, we have to set up the sign in methods.
We are going to just use an email address and password.
We are going to do that one.
We're not going to do this one, although I do like the authentication.
So if someone puts an email address in to register, they have to then go to their email inbox and click
the link they sent and then they'll be logged in automatically.
It's called What is it?
Magic link verification, something like that.
Very, very useful for making sure you have the correct email address.
And without having to bother about a password, you never, ever need a password, as it says there
in that line.
I actually have that running in one of my podcast apps that I produced.
So very useful.
You know, you've got the person's email address.
Great for marketing later on.
OK, there is some apple stuff that you need to comply with for Apple and Google and Facebook.
But let's just skip all of that.
We want to go to the firebase console and open the auth section.
So let's go ahead and do that.
I've opened it in a new tab to Chat V3.
And let's go over to authentication, which is at the top left there.
We have a whole bunch of stuff about how we get started.
Let's get started and see what happens.
There we go.
So all the off is currently disabled and Google do that in case they get service abuse, so leave everything
off until users ask for it.
We are just going to have email password.
There's the password, this link down there.
But we'll leave that off for now.
I'm going to hit save and we're done.
That is literally all we need to do.
If we tap uses, this will give us a list of users.
We have templates for the email addresses, password reset emails and what have you.
And then, of course, we have a usage report, which is very important if you want to actually make
money with your app.
So that's the email address password off set up.
Now we can get onto actually creating the auth controller.