ASP.NET Core Identity is a membership system that adds login functionality to ASP.NET Core apps.
Identity can be configured using a SQL Server database to store user names, passwords, and profile data. Alternatively, another persistent store can be used, for example, Azure Table Storage.
Also add this line before calling UseMvc in Configure method:
app.UseAuthentication();
After that you can inject SignInManager and use it in your controllers:
public async Task<IActionResult> OnPostAsync(string returnUrl = null)
{
var user = new IdentityUser { UserName = Input.Email, Email = Input.Email };
var result = await _userManager.CreateAsync(user, Input.Password);
if (result.Succeeded)
{
_logger.LogInformation("User created a new account with password.");
await _signInManager.SignInAsync(user, isPersistent: false);
return LocalRedirect(returnUrl);
}
// If we got this far, something failed, redisplay form
return Page();
}