React to auth default changes

This commit is contained in:
Hao Kung 2017-07-07 12:08:11 -07:00
parent f1c4aa14d3
commit e09a0f5b7c
3 changed files with 6 additions and 3 deletions

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.Extensions.DependencyInjection;
namespace RazorPagesWebSite
@ -10,7 +11,7 @@ namespace RazorPagesWebSite
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication().AddCookie(options => options.LoginPath = "/Login");
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options => options.LoginPath = "/Login");
services.AddMvc()
.AddCookieTempDataProvider()
.AddRazorPagesOptions(options =>

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.Extensions.DependencyInjection;
namespace RazorPagesWebSite
@ -10,7 +11,7 @@ namespace RazorPagesWebSite
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication()
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options => options.LoginPath = "/Login");
services.AddMvc()
.AddCookieTempDataProvider()

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.Extensions.DependencyInjection;
namespace SecurityWebSite
@ -14,7 +15,7 @@ namespace SecurityWebSite
// Add framework services.
services.AddMvc();
services.AddAntiforgery();
services.AddAuthentication().AddCookie(options =>
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(options =>
{
options.LoginPath = "/Home/Login";
options.LogoutPath = "/Home/Logout";