Skip to content

Commit 5715fb7

Browse files
author
Kalyan Krishna
committed
Minor edits
1 parent 88e25e2 commit 5715fb7

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

5-WebApp-AuthZ/5-2-Groups/AppCreationScripts/Configure.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ Function ConfigureApplications
202202
$webAppAadApplication = New-AzureADApplication -DisplayName "WebApp-GroupClaims" `
203203
-HomePage "https://localhost:44321/" `
204204
-LogoutUrl "https://localhost:44321/signout-oidc" `
205-
-ReplyUrls "https://localhost:44321/", "https://localhost:44321/signin-oidc", "https://localhost:44321/Account/EndSession" `
205+
-ReplyUrls "https://localhost:44321/", "https://localhost:44321/signin-oidc" `
206206
-IdentifierUris "https://$tenantName/WebApp-GroupClaims" `
207207
-PasswordCredentials $key `
208208
-GroupMembershipClaims "SecurityGroup" `
@@ -234,7 +234,7 @@ Function ConfigureApplications
234234
# Add Required Resources Access (from 'webApp' to 'Microsoft Graph')
235235
Write-Host "Getting access from 'webApp' to 'Microsoft Graph'"
236236
$requiredPermissions = GetRequiredPermissions -applicationDisplayName "Microsoft Graph" `
237-
-requiredDelegatedPermissions "GroupMember.Read.All" `
237+
-requiredDelegatedPermissions "Directory.Read.All" `
238238

239239
$requiredResourcesAccess.Add($requiredPermissions)
240240

5-WebApp-AuthZ/5-2-Groups/AppCreationScripts/sample.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"Kind": "WebApp",
1919
"Audience": "AzureADMyOrg",
2020
"HomePage": "https://localhost:44321/",
21-
"ReplyUrls": "https://localhost:44321/, https://localhost:44321/signin-oidc, https://localhost:44321/Account/EndSession",
21+
"ReplyUrls": "https://localhost:44321/, https://localhost:44321/signin-oidc",
2222
"LogoutUrl": "https://localhost:44321/signout-oidc",
2323
"PasswordCredentials": "Auto",
2424
"GroupMembershipClaims": "SecurityGroup",
2525
"RequiredResourcesAccess": [
2626
{
2727
"Resource": "Microsoft Graph",
28-
"DelegatedPermissions": [ "GroupMember.Read.All" ]
28+
"DelegatedPermissions": [ "Directory.Read.All" ]
2929
}
3030
]
3131
}

5-WebApp-AuthZ/5-2-Groups/README-incremental-instructions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,30 @@ Navigate to the `"5-WebApp-AuthZ"` folder
6666

6767
Now you have two different options available to you on how you can further configure your application to receive the `groups` claim.
6868

69-
1. [Receive **all the groups** that the signed-in user is assigned to in an Azure AD tenant, included nested groups](#configure-your-application-to-receive-all-the-groups-a-user-is-assigned-to-included-nested-groups).
70-
1. [Receive the **groups** claim values from a **filtered set of groups** that your application is programmed to work with.](#configure-your-application-to-receive-the-groups-claim-values-from-a-filtered-set-of-groups-a-user-may-be-assigned-to). (Not available in the [Azure AD Free edition](https://azure.microsoft.com/pricing/details/active-directory/)).
69+
1. [Receive **all the groups** that the signed-in user is assigned to in an Azure AD tenant, included nested groups](#configure-your-application-to-receive-all-the-groups-the-signed-in-user-is-assigned-to-included-nested-groups).
70+
1. [Receive the **groups** claim values from a **filtered set of groups** that your application is programmed to work with](#configure-your-application-to-receive-the-groups-claim-values-from-a-filtered-set-of-groups-a-user-may-be-assigned-to). (Not available in the [Azure AD Free edition](https://azure.microsoft.com/pricing/details/active-directory/)).
7171

7272
> To get the on-premise group's `samAccountName` or `On Premises Group Security Identifier` instead of Group id, check out the document [Configure group claims for applications with Azure Active Directory](https://docs.microsoft.com/azure/active-directory/hybrid/how-to-connect-fed-group-claims#prerequisites-for-using-group-attributes-synchronized-from-active-directory).
7373
7474
> To receive the `groups` claim with the object id of the security groups, please ensure that the user accounts you plan to sign-in to this app is assigned to a few security groups in this AAD tenant.
7575
76-
##### Configure your application to receive **all the groups** the signed-in user is assigned to, included nested groups
76+
#### Configure your application to receive **all the groups** the signed-in user is assigned to, included nested groups
7777

7878
1. In the app's registration screen, click on the **Token Configuration** blade in the left to open the page where you can configure the claims provided tokens issued to your application.
7979
1. Click on the **Add groups claim** button on top to open the **Edit Groups Claim** screen.
8080
1. Select `Security groups` **or** the `All groups (includes distribution lists but not groups assigned to the application)` option. Choosing both negates the effect of `Security Groups` option.
8181
1. Under the **ID** section, select `Group ID`. This will result in Azure AD sending the [object id](https://docs.microsoft.com/graph/api/resources/group?view=graph-rest-1.0) of the groups the user is assigned to in the **groups** claim of the [ID Token](https://docs.microsoft.com/azure/active-directory/develop/id-tokens) that your app receives after signing-in a user.
8282
1. If you are exposing a Web API using the **Expose an API** option, then you can also choose the `Group ID` option under the **Access** section. This will result in Azure AD sending the [object id](https://docs.microsoft.com/graph/api/resources/group?view=graph-rest-1.0) of the groups the user is assigned to in the `groups` claim of the [Access Token](https://docs.microsoft.com/azure/active-directory/develop/access-tokens) issued to the client applications of your API.
8383

84-
##### Configure your application to receive the `groups` claim values from a **filtered set of groups** a user may be assigned to
84+
#### Configure your application to receive the `groups` claim values from a **filtered set of groups** a user may be assigned to
8585

86-
###### Prerequisites, benefits and limitations of using this option
86+
##### Prerequisites, benefits and limitations of using this option
8787

8888
1. This option is useful when your application is interested in a selected set of groups that a signing-in user may be assigned to and not every security group this user is assigned to in the tenant. This option also saves your application from running into the [overage](#groups-overage-claim) issue.
8989
1. This feature is not available in the [Azure AD Free edition](https://azure.microsoft.com/pricing/details/active-directory/).
9090
1. **Nested group assignments** are not available when this option is utilized.
9191

92-
###### Steps to enable this option in your app
92+
##### Steps to enable this option in your app
9393

9494
1. In the app's registration screen, click on the **Token Configuration** blade in the left to open the page where you can configure the claims provided tokens issued to your application.
9595
1. Click on the **Add groups claim** button on top to open the **Edit Groups Claim** screen.

5-WebApp-AuthZ/5-2-Groups/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ As a first step you'll need to:
127127
- If you don't have a platform added, select **Add a platform** and select the **Web** option.
128128
- In the **Redirect URIs** section, enter the following redirect URIs.
129129
- `https://localhost:44321/signin-oidc`
130-
- `https://localhost:44321/Account/EndSession`
131130
- In the **Logout URL** section, set it to `https://localhost:44321/signout-oidc`.
132131
- In the **Implicit grant** section, check the **ID tokens** option as this sample requires
133132
the [Implicit grant flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow) to be enabled to
@@ -137,22 +136,22 @@ As a first step you'll need to:
137136
1. In the app's registration screen, click on the **Certificates & secrets** blade in the left to open the page where we can generate secrets and upload certificates.
138137
1. In the **Client secrets** section, click on **New client secret**:
139138
- Type a key description (for instance `app secret`),
140-
- Select one of the available key durations (**In 1 year**, **In 2 years**, or **Never Expires**) as per your security concerns.
139+
- Select one of the available key durations (**In 1 year**, **In 2 years**, or **Never Expires**) as per your security posture.
141140
- The generated key value will be displayed when you click the **Add** button. Copy the generated value for use in the steps later.
142141
- You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
143142
1. In the app's registration screen, click on the **API permissions** blade in the left to open the page where we add access to the Apis that your application needs.
144143
- Click the **Add a permission** button and then,
145144
- Ensure that the **Microsoft APIs** tab is selected.
146145
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
147-
- In the **Delegated permissions** section, select the **GroupMember.Read.All** in the list. Use the search box if necessary.
146+
- In the **Delegated permissions** section, select the **Directory.Read.All** in the list. Use the search box if necessary.
148147
- Click on the **Add permissions** button at the bottom.
149148

150149
#### Configure your application to receive the **groups** claim
151150

152151
Now you have two different options available to you on how you can further configure your application to receive the `groups` claim.
153152

154-
1. [Receive **all the groups** that the signed-in user is assigned to in an Azure AD tenant, included nested groups](#configure-your-application-to-receive-all-the-groups-a-user-is-assigned-to-included-nested-groups).
155-
1. [Receive the **groups** claim values from a **filtered set of groups** that your application is programmed to work with.](#configure-your-application-to-receive-the-groups-claim-values-from-a-filtered-set-of-groups-a-user-may-be-assigned-to). (Not available in the [Azure AD Free edition](https://azure.microsoft.com/pricing/details/active-directory/)).
153+
1. [Receive **all the groups** that the signed-in user is assigned to in an Azure AD tenant, included nested groups](#configure-your-application-to-receive-all-the-groups-the-signed-in-user-is-assigned-to-included-nested-groups).
154+
1. [Receive the **groups** claim values from a **filtered set of groups** that your application is programmed to work with](#configure-your-application-to-receive-the-groups-claim-values-from-a-filtered-set-of-groups-a-user-may-be-assigned-to). (Not available in the [Azure AD Free edition](https://azure.microsoft.com/pricing/details/active-directory/)).
156155

157156
> To get the on-premise group's `samAccountName` or `On Premises Group Security Identifier` instead of Group id, check out the document [Configure group claims for applications with Azure Active Directory](https://docs.microsoft.com/azure/active-directory/hybrid/how-to-connect-fed-group-claims#prerequisites-for-using-group-attributes-synchronized-from-active-directory).
158157
@@ -278,7 +277,7 @@ If a user is member of more groups than the overage limit (**150 for SAML tokens
278277
}
279278
```
280279

281-
##### Create the overage scenario in this sample for testing
280+
#### Create the overage scenario in this sample for testing
282281

283282
1. You can use the `BulkCreateGroups.ps1` provided in the [App Creation Scripts](./AppCreationScripts/) folder to create a large number of groups and assign users to them. This will help test overage scenarios during development. Remember to change the user's objectId provided in the `BulkCreateGroups.ps1` script.
284283
1. When you run this sample and an overage occurred, then you'd see the `_claim_names` in the home page after the user signs-in.
@@ -325,7 +324,6 @@ This project was created using the following command.
325324
using Microsoft.Identity.Web;
326325
```
327326

328-
329327
The following files have the code that would be of interest to you:
330328

331329
1. HomeController.cs

0 commit comments

Comments
 (0)