title: Problems with AuthenticateAsync with Facebook login in ASP.NET Core
body: <p>I have a problem enabling Facebook auth in my ASP.NET Core web app. I'm using ASP.NET Core Authentication but <em>not</em> Identity. The auth is configured in Startup like this:</p>
  
  <pre class="lang-cs prettyprint-override"><code>services
      .AddAuthentication(options =&gt;
      {
          options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
      })
      .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
      .AddFacebook(options =&gt;
      {
          options.ClientId = "clientid";
          options.ClientSecret = "secret";
          options.CallbackPath = "/signinfacebookcallback";
      });
  </code></pre>
  
  <p>As shown in the code, I want to use cookie auth, but also allow people to sign in with Facebook. Once they have been successfully signed in, I want to set the auth cookie.</p>
  
  <p>To show the challenge, I have the following action:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[HttpGet]
  [Route("signinfacebook")]
  public ActionResult SignInFacebook()
  {
      return Challenge(FacebookDefaults.AuthenticationScheme);
  }
  </code></pre>
  
  <p>This redirects the user to the Facebook login screen. Once they sign in, the user is redirected to the URL specified in config:</p>
  
  <pre class="lang-cs prettyprint-override"><code>[HttpGet]
  [Route("signinfacebookcallback")]
  public async Task&lt;ActionResult&gt; SignInFacebookCallback()
  {
      var result = await HttpContext.AuthenticateAsync();
      if (!result.Succeeded) return Redirect("/login/");
  
      ...
  }
  </code></pre>
  
  <p>When I debug the code, <code>result.Succeeded</code> returns false and the <code>AuthenticationResult</code> object doesn't contain more information on why <code>Succeeded</code> is false.</p>
  
  <p>I verified that the app id and secret are correct.</p>
  
  <p>What could be the issue here?</p>