Creating and Signing-in/Signing-out users

ASP.NET Core Identity provides two core classes, namely UserManager and SignInManager, that can be used to register users and enable user sign-in and sign-out operations. We can add an Account controller and specify them in the constructor, which then is automatically dependency injected into the controller through the parameterize controller constructor and it can be used to perform these operations.

UserManager and SignInManager both are generic types and they take the type of the class that derives from IdentityUser (in our case, ApplicationUser). SignInManager internally uses AuthenticationManager and wraps most of the complex parts of the authentication.

Here is the AccountController class, having ...

Get Enterprise Application Architecture with .NET Core 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.