You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 17, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: 5-AccessControl/2-call-api-groups/AppCreationScripts/Cleanup.ps1
+1-11Lines changed: 1 addition & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -57,7 +57,7 @@ Function Cleanup
57
57
58
58
foreach ($appin$apps)
59
59
{
60
-
Remove-MgApplication-ApplicationId $app.Id-Debug
60
+
Remove-MgApplication-ApplicationId $app.Id
61
61
Write-Host"Removed msal-angular-app.."
62
62
}
63
63
@@ -72,16 +72,6 @@ Function Cleanup
72
72
Write-Warning$Error[0]
73
73
Write-Host"Unable to remove ServicePrincipal 'msal-angular-app'. Error is $message. Try deleting manually from Enterprise applications."-ForegroundColor White -BackgroundColor Red
74
74
}
75
-
Write-Host"You may want to remove the security group 'GroupAdmin' if it was created to test this sample only."
@@ -288,7 +292,8 @@ Function UpdateTextFile([string] $configFilePath, [System.Collections.HashTable]
288
292
289
293
$dictionary=@{ "Enter the ID of your Azure AD tenant copied from the Azure portal"=$tenantId;"Enter the application ID (clientId) of the 'TodoListAPI' application copied from the Azure portal"=$clientAadApplication.AppId;"Enter the Client Secret of the 'TodoListAPI' application copied from the Azure portal"=$clientAppKey };
290
294
291
-
Write-Host"Updating the sample config '$configFile' with the following config values"
295
+
Write-Host"Updating the sample config '$configFile' with the following config values:"
Write-Host-ForegroundColor Green "------------------------------------------------------------------------------------------------"
@@ -307,7 +313,6 @@ Function UpdateTextFile([string] $configFilePath, [System.Collections.HashTable]
307
313
Write-Host" - Navigate to $clientPortalUrl"
308
314
Write-Host" - This script has created a group named GroupAdmin for you. On Azure portal, assign some users to it, and configure your ID and Access token to emit GroupID in your app registration."-ForegroundColor Red
309
315
Write-Host" - This script has created a group named GroupMember for you. On Azure portal, assign some users to it, and configure your ID and Access token to emit GroupID in your app registration."-ForegroundColor Red
310
-
Write-Host" - Security groups matching the names you provided have been created in this tenant (if not present already). On Azure portal, assign some users to it, and configure ID & Access tokens to emit Group IDs"-ForegroundColor Red
311
316
Write-Host-ForegroundColor Green "------------------------------------------------------------------------------------------------"
Copy file name to clipboardExpand all lines: 5-AccessControl/2-call-api-groups/README.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,14 +34,14 @@ This sample demonstrates a cross-platform application suite involving an Angular
34
34
35
35
Access control in Azure AD can also be done with **App Roles**, as shown in the [previous tutorial](../1-call-api-roles/README.md). **Security Groups** and **App Roles** in Azure AD are by no means mutually exclusive - they can be used in tandem to provide even finer grained access control.
36
36
37
+
In the sample, a dashboard component allows signed-in users to see the tasks assigned to them or other users based on their memberships to one of the two security groups, **GroupAdmin** and **GroupMember**.
38
+
37
39
> :information_source: See the community call: [Implement authorization in your applications with the Microsoft identity platform](https://www.youtube.com/watch?v=LRoc-na27l0)
38
40
39
41
> :information_source: See the community call: [Deep dive on using MSAL.js to integrate Angular single-page applications with Azure Active Directory](https://www.youtube.com/watch?v=EJey9KP1dZA)
40
42
41
43
## Scenario
42
44
43
-
In the sample, a dashboard component allows signed-in users to see the tasks assigned to them or other users based on their memberships to one of the two security groups, **GroupAdmin** and **GroupMember**.
44
-
45
45
- The **TodoListSPA** uses [MSAL Angular](https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/lib/msal-angular) to authenticate a user with the Microsoft identity platform.
46
46
- The app then obtains an [access token](https://docs.microsoft.com/azure/active-directory/develop/access-tokens) from Azure Active Directory (Azure AD) on behalf of the authenticated user for the **TodoListAPI**.
47
47
-**TodoListAPI** uses [Microsoft.Identity.Web](https://github.com/AzureAD/microsoft-identity-web) to protect its endpoint and accept only authorized calls.
@@ -107,9 +107,9 @@ For more information and potential issues, see: [HTTPS in .NET Core](https://doc
107
107
108
108
### Step 5: Register the sample application(s) in your tenant
109
109
110
-
While there are multiple project in this sample, we'd register just one app with Azure AD and use the registered app's *client id* in both apps. This reuse of app ids (client ids) is used when the apps themselves are just components of one larger app topology.
110
+
> :information_source:While there are multiple project in this sample, we'd register just one app with Azure AD and use the registered app's *client id* in both apps. This reuse of app ids (client ids) is used when the apps themselves are just components of one larger app topology.
111
111
112
-
There is one project in this sample. To register it, you can:
112
+
There are two projects in this sample. To register it, you can:
113
113
114
114
- follow the steps below for manually register your apps
115
115
- or use PowerShell scripts that:
@@ -172,7 +172,7 @@ To manually register the apps, as a first step you'll need to:
172
172
173
173
1. All APIs must publish a minimum of one [scope](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code), also called [Delegated Permission](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent#permission-types), for the client apps to obtain an access token for a *user* successfully. To publish a scope, follow these steps:
174
174
1. Select **Add a scope** button open the **Add a scope** screen and Enter the values as indicated below:
175
-
1. For **Scope name**, use `access_as_user`.
175
+
1. For **Scope name**, use `access_via_group_assignment`.
176
176
1. Select **Admins and users** options for **Who can consent?**.
177
177
1. For **Admin consent display name** type in *Access 'msal-angular-app' as the signed-in user.*.
178
178
1. For **Admin consent description** type in *Allow the app to access the 'msal-angular-app' as a signed-in user.*.
@@ -304,8 +304,8 @@ You have two different options available to you on how you can further configure
304
304
1. Find the app key `groups.groupMember` and replace the existing value with the **object ID** of the **GroupMember** group copied from the Azure portal.
305
305
306
306
1. Open the `API\TodoListAPI\appsettings.json` file.
307
-
2. Find the app key `Groups.GroupAdmin` and replace the existing value with the object ID of the **GroupAdmin** group copied from the Azure portal.
308
-
3. Find the app key `Groups.GroupMember` and replace the existing value with the object ID of the **GroupMember** group copied from the Azure portal.
307
+
2. Find the app key `Groups.GroupAdmin` and replace the existing value with the **object ID** of the **GroupAdmin** group copied from the Azure portal.
308
+
3. Find the app key `Groups.GroupMember` and replace the existing value with the **object ID** of the **GroupMember** group copied from the Azure portal.
0 commit comments