1
00:00:00,300 --> 00:00:03,390
All right, guys, welcome to a brand new module.

2
00:00:03,420 --> 00:00:08,640
And in this module, we're going to tackle the topic of authentication.

3
00:00:09,030 --> 00:00:15,290
And it's something that is often thought of as incredibly complicated, but it doesn't have to be.

4
00:00:15,330 --> 00:00:21,750
And we're going to take it step by step from beginning to end so that you get an overview of the entire

5
00:00:21,750 --> 00:00:24,510
process of setting up authentication from scratch.

6
00:00:25,230 --> 00:00:27,610
So why do we need to authenticate?

7
00:00:28,110 --> 00:00:35,730
Well, as we're creating our website or web app for users to use, then these users are going to start

8
00:00:35,730 --> 00:00:38,430
generating data in the website.

9
00:00:38,730 --> 00:00:40,710
They might like certain posts,

10
00:00:40,920 --> 00:00:43,080
they might interact with other users,

11
00:00:43,230 --> 00:00:46,880
there might be messages created or recipes created.

12
00:00:46,920 --> 00:00:49,860
There's always going to be some user data created.

13
00:00:50,400 --> 00:00:57,150
And in order to associate those pieces of data with individual users, we need to create an account

14
00:00:57,150 --> 00:01:02,610
for each user. So that they would sign up to our website using a username and a password

15
00:01:02,910 --> 00:01:09,450
and we would essentially create kind of like an ID card for them to uniquely identify them on our database

16
00:01:09,750 --> 00:01:14,520
and to save all of the data that they generate onto that account.

17
00:01:15,060 --> 00:01:20,670
So the next time that they come back onto the website, they'll be able to use their username and password

18
00:01:21,000 --> 00:01:28,110
and log in to our website and be able to access all of those possibly private pieces of information.

19
00:01:28,470 --> 00:01:33,510
So this way, you don't end up with everybody being able to see, you know, what private messages you're

20
00:01:33,510 --> 00:01:37,280
sending around on Facebook or see your direct messages on Twitter.

21
00:01:37,650 --> 00:01:39,030
So that's pretty simple.

22
00:01:39,270 --> 00:01:45,420
Now, the other reason why you might want to add authentication to your website is to restrict access

23
00:01:45,630 --> 00:01:49,770
to certain areas of the website depending on the status of the user.

24
00:01:50,040 --> 00:01:57,570
So, for example, if you were Spotify or Netflix and you charge a subscription for accessing certain

25
00:01:57,570 --> 00:02:03,210
parts of the website, then once the user pays, you have to update their account in your database to

26
00:02:03,210 --> 00:02:09,930
say that they have paid and they'll be allowed to access the TV shows or songs that they're entitled

27
00:02:09,930 --> 00:02:10,229
to.

28
00:02:10,770 --> 00:02:16,550
So those are some of the reasons why you might want to add authentication to your website.

29
00:02:16,860 --> 00:02:21,030
But authentication can be done in a number of ways.

30
00:02:21,030 --> 00:02:27,690
Creating a website where we sign up and log in users seems simple enough, but the difficult part of

31
00:02:27,690 --> 00:02:32,750
authentication comes from how secure you're going to make your website.

32
00:02:32,840 --> 00:02:38,100
But so we're going to learn how to progress from essentially a website that's basically secured with

33
00:02:38,100 --> 00:02:45,210
a Cheeto to something that is a lot more serious and more consistent with industry standards of good

34
00:02:45,210 --> 00:02:46,810
security on a website.

35
00:02:47,160 --> 00:02:50,600
So the structure of our website is really, really simple.

36
00:02:51,000 --> 00:02:59,760
It has a homepage which has two buttons that allows you to either go towards register or go towards

37
00:02:59,760 --> 00:03:00,300
login.

38
00:03:00,480 --> 00:03:06,120
And once the user has been registered or logged in and they have been authenticated, then they are

39
00:03:06,150 --> 00:03:08,630
able to access the secrets page.

40
00:03:09,150 --> 00:03:15,090
So I've kept the remainder of the website pretty simple because we're going to be focusing on a pretty

41
00:03:15,090 --> 00:03:16,130
complex topic.

42
00:03:16,230 --> 00:03:23,010
So I've created some starting files for you to download so that we can focus our efforts on learning

43
00:03:23,010 --> 00:03:27,160
authentication and not get distracted by things like bootstrap and styling.

44
00:03:27,600 --> 00:03:33,750
So once you're ready, head over to the next lesson and download the starting files, and then we're going

45
00:03:33,750 --> 00:03:35,940
to get started with authentication.

46
00:03:36,270 --> 00:03:37,350
So I'll see you there.

