Overview of Adding User Registration2:56 with James Churchill
We're ready to start writing code! Let's start with providing users with a way to register with our web app by adding a "User Registration" page.
[MUSIC] 0:00 Welcome back, now that we've installed the necessary identity and 0:04 OWIN related NuGet packages, we're ready to start writing code. 0:08 The first thing that we need to do is provide users with a way to 0:12 register with our web app. 0:16 We'll accomplish by adding a user registration page. 0:17 Our user registration page will contain a relatively simple form. 0:21 We'll just need to prompt the user for their email address and password. 0:25 The password field will actually be two separate fields, one field for 0:30 their password, and another for confirming their password. 0:35 Confirming their provided password is necessary as users won't be able to see 0:38 the text that they're typing into the password input elements. 0:42 Hiding the text prevents prying eyes from spying the users password. 0:46 But don't make the mistake thinking that your users passwords are secure because 0:51 you can't see them displayed in the browser. 0:55 I know it's confusing, but these password input elements 0:58 are just masking the underlying text characters by replacing them with dots. 1:01 When we post the form to the server, our password will be sent in regular old text, 1:07 which is sometimes referred to as clear text. 1:13 This means that you could easily read the text if you're inspecting the post body 1:16 information or monitoring the HTTP traffic between the client and the server. 1:20 Monitoring traffic is often referred to as packet sniffing. 1:26 The way to protect your users passwords 1:31 is to encrypt all of the communication between the client and the server. 1:33 We'll see how to do that later in this course. 1:38 We'll be making a lot of changes to our web app in this section. 1:41 We'll start by adding the controller, view model, and view for 1:45 the user registration page. 1:49 Then we'll add some identity related classes to our project 1:51 that will support user registration. 1:54 Including the User, UserManager, and SignInManager classes. 1:56 Then we'll configure the Identity OWIN middleware component, so that Identity can 2:01 work with the requests and responses that flow to and from our web app. 2:06 Once we implement user registration, we'll work on some updates to the layout page. 2:11 We'll add register, sign in, and sign out buttons to the menu. 2:16 But the sign in sign out functionality won't be implemented until later. 2:20 If you have experience with ASP.NET MVC, the process of adding the controller, 2:25 view model, and view, should be familiar to you. 2:30 I'm going to rely on that familiarity a bit and 2:33 move through this part of the process fairly quickly. 2:36 I'll cover every step in the process, but I'll do so 2:39 without as much explanation as I would give in a beginner course. 2:42 If any part of what I'm about to show you is unfamiliar or 2:46 confusing at all, see the teacher's notes for 2:49 links to Treehouse resources that can help get you up to speed. 2:52
You need to sign up for Treehouse in order to download course files.Sign up