title: InvalidOperationException: No IAuthenticationSignInHandler is configured to handle sign in for the scheme: MyCookieAuthenticationScheme
body: <p>I am trying to follow the instructions <a href="https://docs.microsoft.com/en-us/aspnet/core/security/authentication/cookie?tabs=aspnetcore2x" rel="noreferrer">here</a> to add Cookie Authentication to my site.</p>
  
  <p>So far I have added the following:</p>
  
  <blockquote>
    <p>Invoke the UseAuthentication method in the Configure method of the
    Startup.cs file:</p>
  </blockquote>
  
  <pre><code>app.UseAuthentication();
  </code></pre>
  
  <blockquote>
    <p>Invoke the AddAuthentication and AddCookie methods in the
    ConfigureServices method of the Startup.cs file:</p>
  </blockquote>
  
  <pre><code>services.AddAuthentication("MyCookieAuthenticationScheme")
      .AddCookie(options =&gt; {
      options.AccessDeniedPath = "/Account/Forbidden/";
      options.LoginPath = "/Account/Unauthorized/";
  });
  </code></pre>
  
  <p>In my login code I then have</p>
  
  <pre><code>await HttpContext.SignInAsync("MyCookieAuthenticationScheme", principal);
  </code></pre>
  
  <p><code>principle</code> is a <code>ClaimsPrincipal</code>.</p>
  
  <p>When I login to my site and call the line above I get the error:    </p>
  
  <blockquote>
    <p>InvalidOperationException: No IAuthenticationSignInHandler is
    configured to handle sign in for the scheme:
    MyCookieAuthenticationScheme</p>
  </blockquote>
  
  <p>What have I missed out?</p>