ASP.Net Core 1.0.0-preview2 infinite redirect loop
<p>I get infinite redirect loop when I publish application like this:</p>

<p><code>/Account/Login?ReturnUrl=%2FLPanel3%2FHome%2FError%3FReturnUrl%3D%252FLPanel3%252FHome%252FError%253FReturnUrl%253D%25252FLPanel3%25252FHome%25252FError%25253FReturnUrl%25253D%2525252FLPanel3%2525252FHome%2525252FError%2525253FReturnUrl%2525253D%252525252FLPanel3%252525252FHome%...</code> </p>

<p>But on my Account controller I have [AllowAnonymous] and it doesn't help. My Startup looks like this:</p>

<pre><code>public class Startup
{
    public Startup(IHostingEnvironment env)
    {
        var builder = new ConfigurationBuilder()
            .SetBasePath(env.ContentRootPath)
            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
            .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); 

        if (env.IsDevelopment())
        {
            builder.AddUserSecrets();

            builder.AddApplicationInsightsSettings(developerMode: true);
        }
        builder.AddEnvironmentVariables();
        Configuration = builder.Build();

    }

    public IConfigurationRoot Configuration { get; set; }

    // This method gets called by the runtime. Use this method to add services to the container.
    public void ConfigureServices(IServiceCollection services)
    {

        services.AddAuthorization(options =&gt;
        {
            options.AddPolicy("AdministratorOnly", policy =&gt; policy.RequireRole("Administrator", "Create", "Access", "Manage"));
            options.AddPolicy("Manage", policy =&gt; policy.RequireRole("Create", "Access", "Manage"));
            options.AddPolicy("Access", policy =&gt; policy.RequireRole("Access"));
        });
        services.AddApplicationInsightsTelemetry(Configuration);

        services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
            options.UseSqlServer(Configuration.GetConnectionString("Connection")));

        services.AddIdentity&lt;ApplicationUser, IdentityRole&gt;(options =&gt;
        {
            options.Cookies.ApplicationCookie.CookieName = "Cookie";
            options.Cookies.ApplicationCookie.ExpireTimeSpan = TimeSpan.FromHours(1);
            options.Cookies.ApplicationCookie.SlidingExpiration = true;
        })
            .AddEntityFrameworkStores&lt;ApplicationDbContext&gt;()
            .AddDefaultTokenProviders();

        services.AddMvc(config =&gt;
        {
            var policy = new AuthorizationPolicyBuilder()
                .RequireAuthenticatedUser()
                .Build();
            config.Filters.Add(new AuthorizeFilter(policy));
        }).AddJsonOptions(opt =&gt;
                opt.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver())
            .AddJsonOptions(opt =&gt; opt.SerializerSettings
                .ReferenceLoopHandling = ReferenceLoopHandling.Ignore);


        services.AddLogging();
        services.AddTransient&lt;IEmailSender, AuthMessageSender&gt;();
        services.AddTransient&lt;ISmsSender, AuthMessageSender&gt;();
        services.AddScoped&lt;ILPRepository, LPRepository&gt;();
        services.AddTransient&lt;SeedDatabase&gt;();
    }

    public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, SeedDatabase seeder)
    {
        loggerFactory.AddConsole(Configuration.GetSection("Logging"));
        loggerFactory.AddDebug();

        if (env.IsDevelopment())
        {
            app.UseBrowserLink();
            app.UseDeveloperExceptionPage();
            app.UseDatabaseErrorPage();
        }
        else
        {
            app.UseExceptionHandler("/Home/Error");

            try
            {
                using (var serviceScope =     app.ApplicationServices.GetRequiredService&lt;IServiceScopeFactory&gt;()
                    .CreateScope())
                {
                    serviceScope.ServiceProvider.GetService&lt;ApplicationDbContext&gt;()
                         .Database.Migrate();
                }
            }
            catch { }
        }

        app.UseApplicationInsightsExceptionTelemetry();

        app.UseCookieAuthentication(new CookieAuthenticationOptions
        {
            AuthenticationScheme = "Cookie",
            LoginPath = new PathString("/Account/Login/"),
            AccessDeniedPath = new PathString("/Account/Forbidden/"),
            AutomaticAuthenticate = true,
            AutomaticChallenge = true
        });

        app.UseStaticFiles();

        app.UseIdentity();

        app.UseStatusCodePagesWithReExecute("/Home/Errors/{0}");



        app.UseMvc(routes =&gt;
        {
            routes.MapRoute(
                name: "default",
                template: "{controller}/{action}/{id?}",
                defaults: new { controller = "Home", action = "Index" }
               );
        });

    }

}
</code></pre>

<p>I don't have any other libraries that are looking for login, authentication and so on...</p>