Adding basic user forms authentication

Great! You have registered the Authentication Middleware and prepared the database. In the next step, you are going to implement basic user authentication for the Tic-Tac-Toe application.

The following example demonstrates how to modify the user registration and add a simple login form with a user login and password textbox for authenticating users:

  1. Add a new Model called LoginModel to the Models folder:
        public class LoginModel 
        { 
          [Required] 
          public string UserName { get; set; } 
          [Required] 
          public string Password { get; set; } 
          public string ReturnUrl { get; set; } 
        } 
  1. Add a new folder called Account to the Views folder, and add a new file called Login.cshtml within this new folder; it will contain the ...

Get Learning ASP.NET Core 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.