Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 7c1261b

Browse files
for issue #1423: changed literal string "OpenIdConnect" to constant string (#1424)
Co-authored-by: Jeremiah Flaga <[email protected]>
1 parent 0cb8424 commit 7c1261b

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

src/Web/WebMVC/Controllers/AccountController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace Microsoft.eShopOnContainers.WebMVC.Controllers
1212
{
13-
[Authorize(AuthenticationSchemes = "OpenIdConnect")]
13+
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
1414
public class AccountController : Controller
1515
{
1616
private readonly ILogger<AccountController> _logger;
@@ -20,7 +20,7 @@ public AccountController(ILogger<AccountController> logger)
2020
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
2121
}
2222

23-
[Authorize(AuthenticationSchemes = "OpenIdConnect")]
23+
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
2424
public async Task<IActionResult> SignIn(string returnUrl)
2525
{
2626
var user = User as ClaimsPrincipal;

src/Web/WebMVC/Controllers/CampaignsController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
1111
using System.Threading.Tasks;
1212
using ViewModels;
1313
using ViewModels.Pagination;
14+
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
1415

15-
[Authorize(AuthenticationSchemes = "OpenIdConnect")]
16+
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
1617
public class CampaignsController : Controller
1718
{
1819
private readonly ICampaignService _campaignService;

src/Web/WebMVC/Controllers/CartController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
12
using Microsoft.AspNetCore.Authorization;
23
using Microsoft.AspNetCore.Mvc;
34
using Microsoft.eShopOnContainers.WebMVC.Services;
@@ -8,7 +9,7 @@
89

910
namespace Microsoft.eShopOnContainers.WebMVC.Controllers
1011
{
11-
[Authorize(AuthenticationSchemes = "OpenIdConnect")]
12+
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
1213
public class CartController : Controller
1314
{
1415
private readonly IBasketService _basketSvc;

src/Web/WebMVC/Controllers/OrderController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
12
using Microsoft.AspNetCore.Authorization;
23
using Microsoft.AspNetCore.Mvc;
34
using Microsoft.eShopOnContainers.WebMVC.Services;
@@ -7,7 +8,7 @@
78

89
namespace Microsoft.eShopOnContainers.WebMVC.Controllers
910
{
10-
[Authorize(AuthenticationSchemes = "OpenIdConnect")]
11+
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
1112
public class OrderController : Controller
1213
{
1314
private IOrderingService _orderSvc;

src/Web/WebMVC/Controllers/OrderManagementController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
using Microsoft.eShopOnContainers.WebMVC.Services;
88
using Microsoft.eShopOnContainers.WebMVC.ViewModels;
99
using Microsoft.AspNetCore.Authorization;
10+
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
1011

1112
namespace WebMVC.Controllers
1213
{
13-
[Authorize(AuthenticationSchemes = "OpenIdConnect")]
14+
[Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)]
1415
public class OrderManagementController : Controller
1516
{
1617
private IOrderingService _orderSvc;

0 commit comments

Comments
 (0)