Skip to content

Commit 9f6db68

Browse files
committed
Fixes the Required scopes in the Web API as
it can be different if you went throught the readme.md or the app creation script. Proposing to accept both
1 parent 875aace commit 9f6db68

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

1. Desktop app calls Web API/TodoListService/Controllers/TodoListController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ public class TodoListController : Controller
4040

4141
/// <summary>
4242
/// The Web API will only accept tokens 1) for users, 2) having the user_impersonation scope for
43-
/// this API
43+
/// this API (if you created the app using the App creation script) or 'access_as_user' if you created
44+
/// it following the README.md.
4445
/// </summary>
45-
const string scopeRequiredByAPI = "user_impersonation";
46+
static string[] scopeRequiredByAPI = new string[] { "user_impersonation", "access_as_user" };
4647

4748
// GET: api/values
4849
[HttpGet]

2. Web API now calls Microsoft Graph/TodoListService/Controllers/TodoListController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ public TodoListController(ITokenAcquisition tokenAcquisition)
5757

5858
/// <summary>
5959
/// The Web API will only accept tokens 1) for users, 2) having the user_impersonation scope for
60-
/// this API
60+
/// this API (if you created the app using the App creation script) or 'access_as_user' if you created
61+
/// it following the README.md.
6162
/// </summary>
62-
const string scopeRequiredByAPI = "user_impersonation";
63+
static string[] scopeRequiredByAPI = new string[] { "user_impersonation", "access_as_user" };
6364

6465
// GET: api/values
6566
[HttpGet]

3.-Web-api-call-Microsoft-graph-for-personal-accounts/TodoListService/Controllers/TodoListController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,10 @@ public TodoListController(ITokenAcquisition tokenAcquisition)
5757

5858
/// <summary>
5959
/// The Web API will only accept tokens 1) for users, 2) having the user_impersonation scope for
60-
/// this API
60+
/// this API (if you created the app using the App creation script) or 'access_as_user' if you created
61+
/// it following the README.md.
6162
/// </summary>
62-
const string scopeRequiredByAPI = "user_impersonation";
63+
static string[] scopeRequiredByAPI = new string[] { "user_impersonation", "access_as_user" };
6364

6465
// GET: api/values
6566
[HttpGet]

0 commit comments

Comments
 (0)