title: .NET Core Cookie Authentication SignInAsync not working
body: <p>I have a cookie authentication based core project using the AspNetCore.Authentication.Cookies but I can't seem to make the user to authenticate. I have read similar threads but none of the solutions provided seem useful. </p>
  
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; CookieAuth(ITwitterCredentials userCreds)
  {
      var claims = new[] {
          new Claim("AccessToken" , userCreds.AccessToken),
          new Claim("AccessTokenSecret", userCreds.AccessTokenSecret)
      };
  
      var principal = new ClaimsPrincipal(new ClaimsIdentity(claims, "CookieAuthentication"));
  
      await HttpContext.Authentication.SignInAsync("CookieAuthentication", principal);
  
      return Ok();
  }
  </code></pre>
  
  <p>and startup.cs configure method</p>
  
  <pre><code>app.UseCookieAuthentication(new CookieAuthenticationOptions()
  {
      AuthenticationScheme = "CookieAuthentication",
      LoginPath = new PathString("/"),
      AccessDeniedPath = new PathString("/"),
      AutomaticAuthenticate = true,
      AutomaticChallenge = true
  });
  </code></pre>
  
  <p>The user does not seem to authenticate as <code>HttpContext.User.Identity.IsAuthenticated</code> always returns false.</p>
  
  <p>Any idea why this might not be working?</p>