This commit is contained in:
Hao Kung 2017-04-19 17:05:54 -07:00
Родитель 7f4aa60a45
Коммит d938fef626
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

@ -10,19 +10,14 @@ namespace RazorPagesApp
public void ConfigureServices(IServiceCollection services) public void ConfigureServices(IServiceCollection services)
{ {
var builder = services.AddMvc(); var builder = services.AddMvc();
services.AddCookieAuthentication(options => options.LoginPath = "/Login");
ConfigureMvc(builder); ConfigureMvc(builder);
} }
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{ {
loggerFactory.AddConsole(); loggerFactory.AddConsole();
app.UseCookieAuthentication(new CookieAuthenticationOptions app.UseAuthentication();
{
LoginPath = "/Login",
AutomaticAuthenticate = true,
AutomaticChallenge = true
});
app.UseMvc(); app.UseMvc();
} }