From 17450333c208cb24abd7264baa3f25ec69f72559 Mon Sep 17 00:00:00 2001 From: Jennyf19 Date: Sun, 30 May 2021 21:11:10 -0700 Subject: [PATCH 1/2] fix scope attribute --- src/Microsoft.Identity.Web/Resource/RequiredScopeAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Identity.Web/Resource/RequiredScopeAttribute.cs b/src/Microsoft.Identity.Web/Resource/RequiredScopeAttribute.cs index b2225f9e8..dba5cb680 100644 --- a/src/Microsoft.Identity.Web/Resource/RequiredScopeAttribute.cs +++ b/src/Microsoft.Identity.Web/Resource/RequiredScopeAttribute.cs @@ -29,7 +29,7 @@ public class RequiredScopeAttribute : TypeFilterAttribute public string RequiredScopesConfigurationKey { get { return string.Empty; } - set { Arguments = new object[] { Constants.RequiredScopesSetting, value }; } + set { Arguments = new object[] { new string[] { Constants.RequiredScopesSetting, value } }; } } /// From cd64588d6678a96f767892c8488213692674d766 Mon Sep 17 00:00:00 2001 From: Jennyf19 Date: Mon, 31 May 2021 13:36:54 -0700 Subject: [PATCH 2/2] add dev app settings --- .../TodoListService/Controllers/TodoListController.cs | 2 +- .../TodoListService/appsettings.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/WebAppCallsWebApiCallsGraph/TodoListService/Controllers/TodoListController.cs b/tests/WebAppCallsWebApiCallsGraph/TodoListService/Controllers/TodoListController.cs index 1d4011867..dc42485a9 100644 --- a/tests/WebAppCallsWebApiCallsGraph/TodoListService/Controllers/TodoListController.cs +++ b/tests/WebAppCallsWebApiCallsGraph/TodoListService/Controllers/TodoListController.cs @@ -15,7 +15,7 @@ namespace TodoListService.Controllers { [Authorize] [Route("api/[controller]")] - [RequiredScope("access_as_user")] + [RequiredScope(RequiredScopesConfigurationKey = "AzureAd:Scopes")] public class TodoListController : Controller { private readonly ITokenAcquisition _tokenAcquisition; // do not remove diff --git a/tests/WebAppCallsWebApiCallsGraph/TodoListService/appsettings.json b/tests/WebAppCallsWebApiCallsGraph/TodoListService/appsettings.json index b1d056125..6786c957e 100644 --- a/tests/WebAppCallsWebApiCallsGraph/TodoListService/appsettings.json +++ b/tests/WebAppCallsWebApiCallsGraph/TodoListService/appsettings.json @@ -5,6 +5,7 @@ "TenantId": "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab", "ClientId": "a4c2469b-cf84-4145-8f5f-cb7bacf814bc", //"712ae8d7-548a-4306-95b6-ee9117ee86f0", JWE clientID "ClientSecret": "secret", + "Scopes": "access_as_user", "TokenDecryptionCertificates": [ { "SourceType": "",