Hey, did everyone had a share?
And let's have a little bit of the brief discussion about the passport, which we are about to use.
Now, do we really need to use passport?
That is the biggest question.
Probably not in this case.
We are just working with the Google itself and Google has a kind of a their own supported library in
the PM as well.
And that is fine up to the till there.
But when it comes to Facebook, LinkedIn, GitHub and a whole bunch of other types of log in Twitter
maybe that you want to have, then it comes the big problem that there are no such supported libraries
by those of many of these organizations.
The only which is really popular one and really hugely supported is the passport JRS.
So in case in your application you are planning that, I'll take the email password as well.
I'll take Google as well, I'll take Twitter and GitHub and whatnot.
Then it is it is something which makes sense to have the passport.
Yes, you can write all of this code on your own as well, but passport is going to make your life a
lot, lot easier.
One thing that you should always keep in mind while understanding the password is one thing that they
have written at the very top and a whole lot of developers have seen they miss it.
Passport is an authentication middleware.
This is the most important thing line here.
I cannot stress much more than this.
Passport is just a middleware.
Treat it as a middleware.
It's not going to do anything on its own.
It just enters in between and tries to do something in between there.
So that is the most important role that you have to work on with that.
Now, one thing also I have noticed that in case you are using passport, I will actually stop you bit
between the application where I will say, okay, this is all what we have to do and this is all what
we need password for.
And you can just go ahead and continue with your own flow now.
But in case you want to follow the entirety of the password recommended way, I will actually go ahead
and do that so we can see we have a whole lot of strategies and know it is not easy, like saying passport,
authenticate, LinkedIn and all of that.
It is way, way, not way, but yeah, a little bit more complicated than that.
And if I click on View All Strategies, this actually gives you that what all do I support it suppose
the HTTP builder method it supports the local which means the username password or the email password
and generates that token and all the things that we have studied.
It directly supports that and in fact it does actually remove a lot of your job as well.
You don't need to include JWT tokens and everything.
Password just does everything for you.
So we'll see that how it actually works on you can work with OD zero.
There is GitHub, there is Google Earth 2.2, which we are going to use.
We are not going to be using the regular OD zero, we are going to use auth to zero.
Remember there's the Google regular and there is a 2.0 also known as 20.
In this case, we'll be using the latest one, which is 20 and we have even the Spotify.
I didn't even knew that they actually provide these kinds of services.
So you can log in anybody with like crazy amount of options that they give you, I don't know, like
the developers, hats off to you guys.
So what we can see is if I go ahead and type on to the Google, there is a Google Earth and 2.0 which
we are going to use.
If I click on this, it shows me that how this is going to be done.
The documentation definitely can use a little bit of work because this actually makes beginners a bit
more confusing that how to use it, how not to use it.
All they mention is, Hey, you have to implement this strategy and then use authenticate request and
just do it like this and it all works.
So I definitely say that this is not one of the best documentation anybody can have, but this is all
what we are going to be doing.
So yes, it is tough, but spend a little time with the password.
Just try to read some of the examples and from the next video onwards I'll show you that how to actually
implement it.
Once you understand the Google part of implementation, you can actually really copy paste the exact
implementation for other authentication services as well.
Let's go ahead and catch up in the next video.