It goes without saying that, in order to authenticate and authorize users, we need to provide some mechanism to register them to our application. ASP.NET Core makes this task easy by providing utility classes that we can use to make sure that user registration is secure.
Open (or create, if needed) the AccountController and add to the constructor the following dependencies:
- UserManager<User>: Provides the APIs for managing users in a persistence store
- SignInManager<User>: Provides the APIs for user logins
- IConfiguration: Provides the access point for the application configuration
Store each dependency in a class member. Your class should look similar to this:
[Produces("application/json")][Route("api/Account")] ...