title: What is injected to UseAuthorization Middleware from AddAuthentication Service?
body: <p>I Have a controller called Home and it contain 3 methods.</p>
  
  <pre><code>public class HomeController : Controller
      {
          public IActionResult Index()
          {
              return View();
          }
  
          [Authorize]
          public IActionResult Secret()
          {
              return View();
          }
  
          public IActionResult Authenticate()
          {
  
              return RedirectToAction(nameof(Index));
          }
      }
  </code></pre>
  
  <p>and in my ConfigureServices ,i have this code:</p>
  
  <pre><code> services.AddAuthentication("CookieAuth")
         .AddCookie("CookieAuth", config =&gt; {
               config.Cookie.Name = "Ali.Cookie";
               config.LoginPath = "/Home/Authenticate";
          });
  </code></pre>
  
  <p>and in my Configure,i have this code:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
  
              app.UseRouting();
  
              app.UseAuthorization();
  
              app.UseEndpoints(endpoints =&gt;
              {
                  endpoints.MapDefaultControllerRoute();
              });
          }
  </code></pre>
  
  <p>Now my question is, What is injected to UseAuthorization Middleware from AddAuthentication Service? and how that happened ?</p>