Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Learn about user authentication: what it is, how it works and why web sites use it.
-
0:00
[MUSIC]
-
0:04
Welcome to User Authentication with Express and Mongo DB.
-
0:08
In this course, I'll show you how to add a user sign up and log in form to a website.
-
0:13
This will let you password protect parts of a site and
-
0:16
limit access for only those visitors who have an account and are signed in.
-
0:21
And when you know who's signed in, you'll be able to customize the experience for
-
0:25
each of your site's visitors.
-
0:27
You're probably pretty used to creating accounts and logging into websites.
-
0:30
Maybe use social media sites like Facebook and
-
0:33
Twitter, e-commerce sites like Amazon or entertainment applications like Netflix.
-
0:38
They all require you to create an account with a username and password and
-
0:42
usually a bunch of other information, like your email home address and so on.
-
0:47
After you create an account, you use the service by logging into the site.
-
0:51
You type your username and password into a log in form.
-
0:55
This provides credentials to the web server to prove you are who you say you
-
0:58
are, once you're logged in or authenticated you can access pages and
-
1:03
information that other people can't like your Amazon order history or
-
1:06
direct messages on Twitter.
-
1:08
In fact, you're experiencing user authentication right now
-
1:12
here on Treehouse.
-
1:13
You had to sign up to join Treehouse, and you had to log in to access this course.
-
1:19
Because you're authenticated, we know who you are.
-
1:22
We can display your name, your picture, and
-
1:23
the number of points you've earned as a Treehouse student.
-
1:26
We know which course you're taking, and what video you'll be watching next.
-
1:30
And we can recommend other courses and
-
1:32
workshops based on what you've already watched here.
-
1:36
Authentication has two benefits.
-
1:38
First, it provides password protection to hide content from unauthorized users.
-
1:43
For example, only students who are logged in get to view this video and
-
1:47
take this course.
-
1:48
But more importantly, authentication lets us customize the learning experience for
-
1:53
you, because we know you're the one who's logged into this page right now.
-
1:58
Pretty cool, right?
-
1:59
To get the most from these lessons, you should be familiar with Node,
-
2:03
npm, Express, and Mongo, and have taken the prerequisites for this course.
-
2:07
See the teacher's notes on this page for
-
2:09
links to the courses you should have taken before this one.
-
2:12
Okay, let's get started.
You need to sign up for Treehouse in order to download course files.
Sign up