Microsoft Identity Model Sample Project

This is a step by step guide to creating a Web Application following the guide at https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-2.2&tabs=visual-studio with custom authentication. It fills in many of the blanks in the Microsoft Page.

In Visual Studio create a new project as show below;

Creating new ASP.NET Core Web Application – first screen (change WebApplication1 to WebApp1)
Select Web Application and hit “Change Authentication” Button
Change to Individual User Accounts
Completed Application Screen – you are now ready to run your App
Hitting F5 (or run) will run the application, users and user DB will not be created until you Register a User.
Once you register a user, the Identity tables will be created and you can close the App and go back to Visual Studio

Once you have completed this you can use View -> SQL Server Object Explorer and go to the database for this application and view the AspNetUsers table. The created user should be in this table. Note that the password is a Hashed Password. Raw passwords are NOT stored in the database.
Once created you can get to the configuration files in Solution Explorer under Startup.cs Configuration and ConfigureServices will be where you will find all the services. You should look at these pages and get an idea of the code that is in these files. Note that you can right click on code and view the code or the code definition files.

Congratulations on getting this far. At this point you have a working web application (that does nothing) but allows the user to create a login (Register) and use it to login to the application. You will next want to make this application follow YOUR rules for YOUR specific requirements. This can be specific page level access and even field level access on a page. You will need to configure and create all of this. Jump to https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-2.2&tabs=visual-studio#scaffold-register-login-and-logout and start by scaffolding (a great thing as it writes a lot of code for you) using Scaffold Identity into a Razor project using Identity.

Continue to Microsoft Identity Model Sample Project Part 2