Understanding asp.net core identity template login

Viewed 504

In Visual Studio 2017, create a new ASP.NET Core Web Application (.NET Core) project, changing authentication to Individual User Accounts (so using ASP.NET Core Identity).

In the created project, there is an AccountController. In the [HttpGet] Login method, there is the following:

// Clear the existing external cookie to ensure a clean login process
await HttpContext.Authentication.SignOutAsync(_externalCookieScheme);

I'm just trying to understand the authentication process a bit better. So my questions are:

  1. What does this code do?
  2. Why is it included in this method?
  3. If I do not include this in my own login method, under what circumstances will I encounter a problem, and what will the problem be?
1 Answers
Related