title: No authentication handler is configured to handle the scheme: Automatic
body: <p>I updated ASP.NET 5 framework beta-8 packages with RC ones on previously working application. After I got it running next error occured in the startup process:</p>
  
  <blockquote>
    <p>InvalidOperationException: No authentication handler is configured to handle the scheme: Automatic
    Microsoft.AspNet.Http.Authentication.Internal.DefaultAuthenticationManager.d__12.MoveNext()</p>
  </blockquote>
  
  <pre><code>var defaultPolicy =
      new AuthorizationPolicyBuilder()
      .RequireAuthenticatedUser()
      .Build();
  
  services.AddMvc(setup =&gt;
  {
      setup.Filters.Add(new AuthorizeFilter(defaultPolicy)); // Error occurs here
  });
  </code></pre>
  
  <p>If anyone had similar problem, I'd appreciate your idea or solution on what might have gone wrong. Explanation of this exception is also appreciated.</p>
  
  <p><strong>Startup.cs</strong></p>
  
  <pre><code>using Autofac;
  using Autofac.Extensions.DependencyInjection;
  using Microsoft.AspNet.Authorization;
  using Microsoft.AspNet.Builder;
  using Microsoft.AspNet.Hosting;
  using Microsoft.AspNet.Http;
  using Microsoft.AspNet.Mvc.Filters;
  using Microsoft.Extensions.Configuration;
  using Microsoft.Extensions.DependencyInjection;
  using Microsoft.Extensions.PlatformAbstractions;
  using SuperUserMVC.Configuration;
  using SuperUserMVC.Extensions;
  using SuperUserMVC.GlobalModules;
  using System;
  
  namespace SuperUserMVC
  {
      public class Startup
      {
          public IConfigurationRoot Configuration { get; set; }
  
          // Entry point for the application.
          public static void Main(string[] args) =&gt; WebApplication.Run&lt;Startup&gt;(args);
  
          public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
          {
              var builder = new ConfigurationBuilder()
                  .SetBasePath(appEnv.ApplicationBasePath)
                  .AddJsonFile("appsettings.json");
  
              Configuration = builder.Build();
          }
  
          public IServiceProvider ConfigureServices(IServiceCollection services)
          {
              services.Configure&lt;AppSettingsBase&gt;(Configuration.GetSection("AppSettingsBase"));
              services.Configure&lt;ConnectionString&gt;(Configuration.GetSection("ConnectionString"));
  
              services.AddSqlServerCache(cache =&gt;
              {
                  cache.ConnectionString = Configuration.Get&lt;string&gt;("ASPState:ConnectionString");
                  cache.SchemaName = Configuration.Get&lt;string&gt;("ASPState:Schema");
                  cache.TableName = Configuration.Get&lt;string&gt;("ASPState:Table");
              });
  
              services.AddSession(session =&gt;
              {
                  session.IdleTimeout = TimeSpan.FromMinutes(120);
              });
  
              // Only allow authenticated users.
              var defaultPolicy = new AuthorizationPolicyBuilder()
                  .RequireAuthenticatedUser()
                  .Build();
  
              // Add MVC services to the services container.
              services.AddMvc(setup =&gt;
              {
                  setup.Filters.Add(new AuthorizeFilter(defaultPolicy));
              });
  
              var builder = new ContainerBuilder();
              builder.RegisterModule(new AutofacModule());
              builder.Populate(services);
  
              var container = builder.Build();
  
              return container.Resolve&lt;IServiceProvider&gt;();
          }
  
          public void Configure(IApplicationBuilder app, IHttpContextAccessor httpContextAccessor)
          {
              // Catch unhandled exception in pipeline.
              bool isProductionEnvironment = Configuration.Get&lt;bool&gt;("environmentVariables:isProductionEnvironment");
              app.UseCustomUnhandledException(isProductionEnvironment, Configuration.Get&lt;string&gt;("defaultErrorPagePath"));
  
              // Log requests.
              app.UseVisitLogger(isProductionEnvironment);
  
              // Session must be used before MVC routes.
              app.UseSession();
  
              // Configure the HTTP request pipeline.
              app.UseCookieAuthentication(options =&gt;
              {
                  options.AuthenticationScheme = "Cookies";
                  options.LoginPath = new PathString("/Account/Login/");
                  options.AccessDeniedPath = new PathString("/Account/Forbidden/");
                  options.CookieName = "MyCookie";
                  options.AutomaticAuthenticate = true;
                  options.SessionStore = new MemoryCacheSessionStore();
              });
  
              AutoMapperInitializer.Init();
              app.UseStaticFiles();
  
              // Route configuration.
              app.UseMvc(routes =&gt;
              {
                  routes.MapRoute(
                      name: "AreaDefault",
                      template: "{area:exists=Demo}/{controller=Home}/{action=Index}/{id?}"
                  );
  
                  routes.MapRoute(
                      name: "Default",
                      template: "{controller=Home}/{action=Index}/{id?}"
                  );
              });
          }
      }
  }
  </code></pre>