title: Using SignInManager without calling app.UseIdentity()
body: <p>I need to use basic SignIn mechanism to log in user to my website:</p>
  
  <pre><code>var result = await _signInManager.PasswordSignInAsync(username, password, false, lockoutOnFailure: false);
  </code></pre>
  
  <p>Unfortunately it throws an error:</p>
  
  <blockquote>
    <p>No authentication handler is configured to handle the scheme: Identity.Application</p>
  </blockquote>
  
  <p>The reason probably is: I'm not calling <code>app.UseIdentity();</code> in <code>Startup.cs</code>.</p>
  
  <p>I'm not calling it, because I want to configure cookies on my own. So instead of <code>UseIdentity</code> I use this:</p>
  
  <pre><code>        app.UseJwtBearerAuthentication(new JwtBearerOptions
          {
              AutomaticAuthenticate = true,
              AutomaticChallenge = false,
              TokenValidationParameters = tokenValidationParameters
          });
  
          app.UseCookieAuthentication(new CookieAuthenticationOptions
          {
              AutomaticAuthenticate = true,
              AutomaticChallenge = false,
              AuthenticationScheme = "Cookie",
              CookieName = "access_token",
              TicketDataFormat = new CustomJwtDataFormat(
                  SecurityAlgorithms.HmacSha256,
                  tokenValidationParameters)
          });
  </code></pre>
  
  <p>If I call <code>app.UseIdentity();</code>, <code>PasswordSignInAsync</code> works correctly, but <code>CookieAuthentication</code> behaves like it is configured in <code>UseIdentity</code> (it redirects to <code>/Account/Login</code>, this behaviour is disabled in my configuration).</p>
  
  <p>As I see in <a href="https://github.com/aspnet/Identity/blob/4ef80fabf66624b464e77ac9dd6e8c4461759e0c/src/Microsoft.AspNetCore.Identity/BuilderExtensions.cs" rel="nofollow noreferrer">source code</a>, <code>UseIdentity</code> doesn't do more than I do (it simply use <code>UseCookieAuthentication</code>, so similarly as I do). Why then, my soultion causes problems?</p>
  
  <p>What should I do to make <code>PasswordSignInAsync</code> work witout using <code>app.UseIdentity()</code>?</p>