Skip to content

Commit d0b8e37

Browse files
committed
Revert Changes
1 parent c6f4f62 commit d0b8e37

File tree

10 files changed

+39
-395
lines changed

10 files changed

+39
-395
lines changed

1-WebApp-OIDC/1-1-MyOrg/AppCreationScripts/createdApps.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/appsettings.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"AzureAd": {
33
"Instance": "https://login.microsoftonline.com/",
4-
"Domain": "msFreeTenant.onmicrosoft.com",
4+
"Domain": "[Enter the domain of your tenant, e.g. contoso.onmicrosoft.com]",
55
"TenantId": "common",
6-
"ClientId": "176b110b-80ce-4943-8fb7-3b19fe210d46",
7-
"ClientSecret": "3W/iqNToW00tW7bt358jPMNXeZ4Icn/w9QxjP8ZWQxA=",
6+
"ClientId": "[Enter the Client Id (Application ID obtained from the Azure portal), e.g. ba74781c2-53c2-442a-97c2-3d60re42f403]",
7+
"ClientSecret": "[Copy the client secret added to the app from the Azure portal]",
88
"CallbackPath": "/signin-oidc",
99
"SignedOutCallbackPath": "/signout-callback-oidc"
1010
},
@@ -17,15 +17,15 @@
1717
},
1818
"TodoList": {
1919
/*
20-
TodoListScope is the scope of the Web API you want to call. This can be: "api://0892ebc9-a57e-4b64-814f-4bd0798f8132/.default",
20+
TodoListScope is the scope of the Web API you want to call. This can be: "api://b10faa7f-02e8-451c-a405-2a7e9e7072f0/.default",
2121
- a scope for a V2 application (for instance api://b3682cc7-8b30-4bd2-aaba-080c6bf0fd31/access_as_user)
2222
- a scope corresponding to a V1 application (for instance <GUID>/user_impersonation, where <GUID> is the
2323
clientId of a V1 application, created in the https://portal.azure.com portal.
2424
*/
25-
"TodoListAppId": "0892ebc9-a57e-4b64-814f-4bd0798f8132",
26-
"TodoListScope": "api://0892ebc9-a57e-4b64-814f-4bd0798f8132/.default",
25+
"TodoListAppId": "[Enter_client_ID_Of_TodoListService-v2_from_Azure_Portal,_e.g._2ec40e65-ba09-4853-bcde-bcb60029e596",
26+
"TodoListScope": "api://[Enter_client_ID_Of_TodoListService-v2_from_Azure_Portal,_e.g._2ec40e65-ba09-4853-bcde-bcb60029e596]/.default",
2727
//api://83ade765-7b4f-4208-b69f-c28a2b4bebec/.default",
28-
"TodoListBaseAddress": "https://localhost:44351/",
28+
"TodoListBaseAddress": "https://localhost:44351",
2929
"AdminConsentRedirectApi": "https://localhost:44351/api/Home"
3030
},
3131
"RedirectUri": "https://localhost:44321/",

4-WebApp-your-API/4-3-AnyOrg/TodoListService/Controllers/TodoListController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@ private bool TodoItemExists(int id)
164164
}
165165
public async Task<List<string>> CallGraphApiOnBehalfOfUser()
166166
{
167-
string[] scopes = { "user.read" };
167+
string[] scopes = { "user.read.all" };
168168

169169
// we use MSAL.NET to get a token to call the API On Behalf Of the current user
170170
try
171171
{
172172
List<string> userList = new List<string>();
173173
string accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync(scopes);
174-
//IEnumerable<User> users = await CallGraphApiOnBehalfOfUser(accessToken);
175-
//userList = users.Select(x => x.UserPrincipalName).ToList();
176-
return null;
174+
IEnumerable<User> users = await CallGraphApiOnBehalfOfUser(accessToken);
175+
userList = users.Select(x => x.UserPrincipalName).ToList();
176+
return userList;
177177
}
178178
catch (MsalUiRequiredException ex)
179179
{

4-WebApp-your-API/4-3-AnyOrg/TodoListService/appsettings.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"AzureAd": {
33
"Instance": "https://login.microsoftonline.com/",
4-
"Domain": "msFreeTenant.onmicrosoft.com",
4+
"Domain": "[Enter the domain of your tenant, e.g. contoso.onmicrosoft.com]",
55
"TenantId": "common",
6-
"ClientId": "0892ebc9-a57e-4b64-814f-4bd0798f8132",
7-
"ClientSecret": "rZ0TVcb901KRnDQ4TEcvdPuxr2ABimk80Mg4nV8Tl4o=",
6+
"ClientId": "[Enter the Client Id (Application ID obtained from the Azure portal), e.g. ba74781c2-53c2-442a-97c2-3d60re42f403]",
7+
"ClientSecret": "[Copy the client secret added to the app from the Azure portal]",
88
"GraphAPI": "https://graph.microsoft.com/v1.0"
99
},
1010
"https_port": 44351,

5-WebApp-AuthZ/5-1-Roles/appsettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"AzureAd": {
33
"Instance": "https://login.microsoftonline.com/",
4-
"Domain": "ms0604.onmicrosoft.com",
5-
"TenantId": "d963c147-dc13-433f-9520-6db1ff177c34",
6-
"ClientId": "42d382ca-83ad-4384-b7ca-c732d90be3f2",
4+
"Domain": "[Enter the domain of your tenant, e.g. contoso.onmicrosoft.com]",
5+
"TenantId": "[Enter 'common', or 'organizations' or the Tenant Id (Obtained from the Azure portal. Select 'Endpoints' from the 'App registrations' blade and use the GUID in any of the URLs), e.g. da41245a5-11b3-996c-00a8-4d99re19f292]",
6+
"ClientId": "[Enter the Client Id (Application ID obtained from the Azure portal), e.g. ba74781c2-53c2-442a-97c2-3d60re42f403]",
77
"CallbackPath": "/signin-oidc",
88
"SignedOutCallbackPath ": "/signout-callback-oidc",
99

1010
// To call an API
11-
"ClientSecret": "Ne_h-tm_5oT6k5B_IM17_WNp.RItqTb.-E"
11+
"ClientSecret": "[Copy the client secret added to the app from the Azure portal]"
1212
},
1313
"Logging": {
1414
"LogLevel": {

0 commit comments

Comments
 (0)