diff --git a/src/Web/WebMVC/Controllers/AccountController.cs b/src/Web/WebMVC/Controllers/AccountController.cs index 68dd166db..fba04f26d 100644 --- a/src/Web/WebMVC/Controllers/AccountController.cs +++ b/src/Web/WebMVC/Controllers/AccountController.cs @@ -10,7 +10,7 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.Controllers { - [Authorize(AuthenticationSchemes = "OpenIdConnect")] + [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)] public class AccountController : Controller { private readonly ILogger _logger; @@ -20,7 +20,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } - [Authorize(AuthenticationSchemes = "OpenIdConnect")] + [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)] public async Task SignIn(string returnUrl) { var user = User as ClaimsPrincipal; diff --git a/src/Web/WebMVC/Controllers/CampaignsController.cs b/src/Web/WebMVC/Controllers/CampaignsController.cs index cf210318b..920269467 100644 --- a/src/Web/WebMVC/Controllers/CampaignsController.cs +++ b/src/Web/WebMVC/Controllers/CampaignsController.cs @@ -11,8 +11,9 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers using System.Threading.Tasks; using ViewModels; using ViewModels.Pagination; + using Microsoft.AspNetCore.Authentication.OpenIdConnect; - [Authorize(AuthenticationSchemes = "OpenIdConnect")] + [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)] public class CampaignsController : Controller { private readonly ICampaignService _campaignService; diff --git a/src/Web/WebMVC/Controllers/CartController.cs b/src/Web/WebMVC/Controllers/CartController.cs index 78cec5670..d7e577c25 100644 --- a/src/Web/WebMVC/Controllers/CartController.cs +++ b/src/Web/WebMVC/Controllers/CartController.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.WebMVC.Services; @@ -8,7 +9,7 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.Controllers { - [Authorize(AuthenticationSchemes = "OpenIdConnect")] + [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)] public class CartController : Controller { private readonly IBasketService _basketSvc; diff --git a/src/Web/WebMVC/Controllers/OrderController.cs b/src/Web/WebMVC/Controllers/OrderController.cs index f308d0bdc..d5e98552a 100644 --- a/src/Web/WebMVC/Controllers/OrderController.cs +++ b/src/Web/WebMVC/Controllers/OrderController.cs @@ -1,3 +1,4 @@ +using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.WebMVC.Services; @@ -7,7 +8,7 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.Controllers { - [Authorize(AuthenticationSchemes = "OpenIdConnect")] + [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)] public class OrderController : Controller { private IOrderingService _orderSvc; diff --git a/src/Web/WebMVC/Controllers/OrderManagementController.cs b/src/Web/WebMVC/Controllers/OrderManagementController.cs index a488dc4ae..6963c469d 100644 --- a/src/Web/WebMVC/Controllers/OrderManagementController.cs +++ b/src/Web/WebMVC/Controllers/OrderManagementController.cs @@ -7,10 +7,11 @@ using WebMVC.Services.ModelDTOs; using Microsoft.eShopOnContainers.WebMVC.Services; using Microsoft.eShopOnContainers.WebMVC.ViewModels; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authentication.OpenIdConnect; namespace WebMVC.Controllers { - [Authorize(AuthenticationSchemes = "OpenIdConnect")] + [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)] public class OrderManagementController : Controller { private IOrderingService _orderSvc;