title: ModelState error on Facebook external authentication
body: <p>I am learning the ASP.NET Core 2.2 MVC Framework. I have built a simple App, gave it a name, and am currently working through Microsoft documentation to make it work. My current goal is to set up Facebook external authentication.</p>
  
  <p>I have the Visual Studio's template which includes individual user account authentication and I plan on deploying this application to Azure cloud. I followed all the steps to register my app through Facebook's developer page. I specifically do not want to hard code Facebook's App Id and the secret to the Startup file because I want to implement the Azure key vault to increase security. I'm choosing to use Azure key vault instead of local secrets because I want to deploy this solution to the cloud.</p>
  
  <p>The issue is that if I run the solution, I see the correct button show up to take me to Facebook's authentication. It routes me to their error page, and in the debugger, I see this error: </p>
  
  <blockquote>
    <p>Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker:Information:
    Executing handler method
    RecipeBox3._0.Areas.Identity.Pages.Account.ExternalLoginModel.OnPost
    with arguments (Facebook, /) - ModelState is Invalid</p>
  </blockquote>
  
  <p>There is no documentation for this error, and I am running in circles trying to find out the reason for this error. Is there any way I could get some assistance?</p>
  
  <p>I have tried tons of research into what Facebook needs to be passed; if they need more than the id and secret, then I can't find anything that says that. I have tried stepping through the steps to find out what data is being passed to Facebook with no luck, it is a lack of fundamental understanding of how ASP.Net Core handles identity and services.</p>
  
  <p>This is the bit in my Startup Config that I call my Facebook class which reads from Azure Key Vault</p>
  
  <pre><code> services.Configure&lt;Facebook&gt;(Configuration);
              services.AddTransient&lt;Facebook&gt;();
              services.AddAuthentication().AddFacebook(facebookOptions =&gt;
                          {
                              facebookOptions.AppId = Options.facebookID.ToString();
                              facebookOptions.AppSecret = Options.FacebookSecret.ToString();
                          });
  
              services.Configure&lt;RecipeBox3._0.Services.SendGrid&gt;(Configuration);
              services.AddTransient&lt;IEmailSender, EmailSender&gt;();
              services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
  </code></pre>
  
  <p>This is my Facebook class (case matches what is inside key vault exactly)</p>
  
  <pre><code>public class Facebook
  {
     public long facebookID { get; set; }
     public long FacebookSecret { get; set; }
  }
  </code></pre>