MvcPrecompilation => Auth 2.0

This commit is contained in:
Hao Kung 2017-04-19 17:05:54 -07:00
parent 7f4aa60a45
commit d938fef626
1 changed files with 2 additions and 7 deletions

View File

@ -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();
}