WEBVTT

00:03.870 --> 00:05.430
Hey, did everyone had a share?

00:05.430 --> 00:10.170
And let's have a little bit of the brief discussion about the passport, which we are about to use.

00:10.200 --> 00:12.270
Now, do we really need to use passport?

00:12.270 --> 00:13.470
That is the biggest question.

00:13.470 --> 00:15.090
Probably not in this case.

00:15.090 --> 00:19.890
We are just working with the Google itself and Google has a kind of a their own supported library in

00:19.890 --> 00:21.050
the PM as well.

00:21.060 --> 00:23.520
And that is fine up to the till there.

00:23.520 --> 00:28.770
But when it comes to Facebook, LinkedIn, GitHub and a whole bunch of other types of log in Twitter

00:28.770 --> 00:34.560
maybe that you want to have, then it comes the big problem that there are no such supported libraries

00:34.560 --> 00:36.840
by those of many of these organizations.

00:36.870 --> 00:42.210
The only which is really popular one and really hugely supported is the passport JRS.

00:42.210 --> 00:46.500
So in case in your application you are planning that, I'll take the email password as well.

00:46.500 --> 00:50.610
I'll take Google as well, I'll take Twitter and GitHub and whatnot.

00:50.610 --> 00:54.180
Then it is it is something which makes sense to have the passport.

00:54.210 --> 00:58.350
Yes, you can write all of this code on your own as well, but passport is going to make your life a

00:58.350 --> 00:59.690
lot, lot easier.

00:59.700 --> 01:03.840
One thing that you should always keep in mind while understanding the password is one thing that they

01:03.840 --> 01:07.740
have written at the very top and a whole lot of developers have seen they miss it.

01:07.770 --> 01:10.380
Passport is an authentication middleware.

01:10.380 --> 01:12.540
This is the most important thing line here.

01:12.540 --> 01:14.700
I cannot stress much more than this.

01:14.700 --> 01:16.830
Passport is just a middleware.

01:16.830 --> 01:17.940
Treat it as a middleware.

01:17.940 --> 01:19.770
It's not going to do anything on its own.

01:19.770 --> 01:23.850
It just enters in between and tries to do something in between there.

01:23.850 --> 01:26.850
So that is the most important role that you have to work on with that.

01:27.240 --> 01:32.170
Now, one thing also I have noticed that in case you are using passport, I will actually stop you bit

01:32.220 --> 01:36.900
between the application where I will say, okay, this is all what we have to do and this is all what

01:36.900 --> 01:38.430
we need password for.

01:38.730 --> 01:41.520
And you can just go ahead and continue with your own flow now.

01:41.520 --> 01:46.320
But in case you want to follow the entirety of the password recommended way, I will actually go ahead

01:46.320 --> 01:51.600
and do that so we can see we have a whole lot of strategies and know it is not easy, like saying passport,

01:51.600 --> 01:52.980
authenticate, LinkedIn and all of that.

01:52.980 --> 01:57.450
It is way, way, not way, but yeah, a little bit more complicated than that.

01:57.540 --> 02:02.280
And if I click on View All Strategies, this actually gives you that what all do I support it suppose

02:02.280 --> 02:08.280
the HTTP builder method it supports the local which means the username password or the email password

02:08.280 --> 02:10.830
and generates that token and all the things that we have studied.

02:10.830 --> 02:16.110
It directly supports that and in fact it does actually remove a lot of your job as well.

02:16.140 --> 02:18.870
You don't need to include JWT tokens and everything.

02:18.870 --> 02:20.520
Password just does everything for you.

02:20.520 --> 02:24.480
So we'll see that how it actually works on you can work with OD zero.

02:24.750 --> 02:29.160
There is GitHub, there is Google Earth 2.2, which we are going to use.

02:29.160 --> 02:33.660
We are not going to be using the regular OD zero, we are going to use auth to zero.

02:33.660 --> 02:37.830
Remember there's the Google regular and there is a 2.0 also known as 20.

02:37.830 --> 02:42.480
In this case, we'll be using the latest one, which is 20 and we have even the Spotify.

02:42.480 --> 02:45.660
I didn't even knew that they actually provide these kinds of services.

02:45.660 --> 02:51.660
So you can log in anybody with like crazy amount of options that they give you, I don't know, like

02:51.660 --> 02:53.910
the developers, hats off to you guys.

02:53.910 --> 02:59.400
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

02:59.400 --> 03:00.360
we are going to use.

03:00.390 --> 03:03.480
If I click on this, it shows me that how this is going to be done.

03:03.480 --> 03:08.460
The documentation definitely can use a little bit of work because this actually makes beginners a bit

03:08.460 --> 03:11.190
more confusing that how to use it, how not to use it.

03:11.280 --> 03:16.560
All they mention is, Hey, you have to implement this strategy and then use authenticate request and

03:16.560 --> 03:18.810
just do it like this and it all works.

03:18.810 --> 03:24.360
So I definitely say that this is not one of the best documentation anybody can have, but this is all

03:24.360 --> 03:25.500
what we are going to be doing.

03:25.500 --> 03:29.130
So yes, it is tough, but spend a little time with the password.

03:29.130 --> 03:34.200
Just try to read some of the examples and from the next video onwards I'll show you that how to actually

03:34.200 --> 03:34.770
implement it.

03:34.770 --> 03:40.140
Once you understand the Google part of implementation, you can actually really copy paste the exact

03:40.140 --> 03:42.900
implementation for other authentication services as well.

03:42.930 --> 03:45.150
Let's go ahead and catch up in the next video.
