title: User.Identity.IsAuthenticated always false in .net core custom authentication
body: <p>Can anyone please check below code and let me know why I'm getting always false (User.Identity.IsAuthenticated)??. I'm getting cookie on my browser properly and 
   able to get value from Claim but "User.Identity.IsAuthenticated" always false.</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; Login(string phoneNumber, int otp, string returnUrl)
      {
          if (this.accountService.ValidateOTP(phoneNumber, otp))
          {
              var claims = new List&lt;Claim&gt;
              {
                  new Claim(ClaimTypes.MobilePhone, phoneNumber),
                  new Claim(ClaimTypes.Name, phoneNumber)
              };
              var userIdentity = new ClaimsIdentity();
              userIdentity.AddClaims(claim);
              ClaimsPrincipal userPrincipal = new ClaimsPrincipal(userIdentity);
  
              await HttpContext.Authentication.SignOutAsync("MyCookieMiddlewareInstance");
              await HttpContext.Authentication.SignInAsync("MyCookieMiddlewareInstance", userPrincipal,
                  new AuthenticationProperties
                  {
                      ExpiresUtc = DateTime.UtcNow.AddMinutes(20),
                      IsPersistent = false,
                      AllowRefresh = false
                  });
  
              if (string.IsNullOrWhiteSpace(returnUrl))
              {
                  return RedirectToAction("Create", "Ad");
              }
              else
              {
                  return Redirect(returnUrl);
              }
          }
  
          return BadRequest();
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/haWGZ.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/haWGZ.jpg" alt="enter image description here"></a></p>