- ASP.NET Core - Log In and Log Out
- ASP.NET Core - Create a User
- ASP.NET Core - User Registration
- ASP.NET Core - Identity Migrations
- Identity Configuration
- ASP.NET Core - Authorize Attribute
- ASP.NET Core - Identity Overview
- ASP.NET Core - Razor Edit Form
- ASP.NET Core - Razor Tag Helpers
- ASP.NET Core - Razor View Import
- ASP.NET Core - Razor View Start
- ASP.NET Core - Razor Layout Views
- ASP.NET Core - DBContext
- Setup Entity Framework
- ASP.NET Core - Views
- ASP.NET Core - Action Results
- ASP.NET Core - Attribute Routes
- ASP.NET Core - Routing
- ASP.NET Core - MVC Design Pattern
- ASP.NET Core - Setup MVC
- ASP.NET Core - Static Files
- ASP.NET Core - Exceptions
- ASP.NET Core - Middleware
- ASP.NET Core - Configuration
- ASP.NET Core - Project.Json
- ASP.NET Core - Project Layout
- ASP.NET Core - New Project
- ASP.NET Core - Environment Setup
- ASP.NET Core - Overview
- ASP.NET Core - Home
ASP.NET Core Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
ASP.NET Core - Identity Overview
In this chapter, we will discuss the ASP.NET Core Identity framework in brief. ASP.NET Core Identity framework is used to implement forms authentication. There are many options to choose from for identifying your users including Windows Authentication and all of the third-party identity providers pke Google, Microsoft, Facebook, and GitHub etc.
The Identity framework is another dependency that we will add to our apppcation in the project.js file.
This framework allows us to add features where users can register and log in with a local password.
The framework also supports two-factor authentication, third-party identity providers and other features.
We are going to focus on the scenarios where a user can register and log in and log out.
To do this, we need to create a User entity and this class will inherit from a base class in the Identity framework, and the base class gives us our standard user properties pke username and email address.

We can include as many additional properties as we want on this class to store information about our users.
We need to take this User class and plug it into a UserStore class provided by the Identity framework.
The UserStore is the class that our code will talk to create users and vapdate user passwords.
Ultimately, a UserStore will talk to a database. The Identity framework supports the Entity Framework and all of the databases that can work with the Entity Framework.
But you can implement your own UserStore to work with any data source.
In order to work with the Entity Framework properly, our User class will also plug into an IdentityDb class.
This is a class that uses an Entity Framework DBContext to do the actual database work.
We will need to include this IdentityDb into our apppcation by having our existing DataContext class inherit from the IdentityDb instead of the Entity Framework s DBContext.
It is the IdentityDb and the UserStore that work together to store user information and vapdate user passwords, the hashed passwords that are in the database.
There are two pieces of the ASP.NET Core Identity Framework that we need to know

SignInManager
This is one of the two pieces of the Identity framework −
As the name imppes, the SignInManager can sign in a user once we vapdate the password.
We can also use this manager to sign a user out.
With forms authentication, the sign in and the sign out are done by managing a cookie.
When we tell the SignInManager to sign a user in, the manager issues a cookie to the user s browser, and the browser will send this cookie on every subsequent request. It helps us identify that user.
Identity Middleware
This is the second piece of the framework −
Reading the cookie sent by the SignInManager and identifying the user, this happens in the final piece of the framework, the Identity Middleware.
We will need to configure this middleware into our apppcation pipepne to process the cookie set by the SignInManager. We will also see some other features of this middleware in the next few chapters.