From d938fef626e5c0fe0caa7e83300dae9a631ed631 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 19 Apr 2017 17:05:54 -0700 Subject: [PATCH] MvcPrecompilation => Auth 2.0 --- testapps/RazorPagesApp/Startup.cs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/testapps/RazorPagesApp/Startup.cs b/testapps/RazorPagesApp/Startup.cs index 72b94f8024..27852b1733 100644 --- a/testapps/RazorPagesApp/Startup.cs +++ b/testapps/RazorPagesApp/Startup.cs @@ -10,19 +10,14 @@ namespace RazorPagesApp public void ConfigureServices(IServiceCollection services) { var builder = services.AddMvc(); + services.AddCookieAuthentication(options => options.LoginPath = "/Login"); ConfigureMvc(builder); } public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { loggerFactory.AddConsole(); - app.UseCookieAuthentication(new CookieAuthenticationOptions - { - LoginPath = "/Login", - AutomaticAuthenticate = true, - AutomaticChallenge = true - }); - + app.UseAuthentication(); app.UseMvc(); }