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
- An Azure Active Directory (Azure AD) tenant. For more information on how to get an Azure AD tenant, see [How to get an Azure AD tenant](https://azure.microsoft.com/documentation/articles/active-directory-howto-tenant/)
51
-
- A user account in your Azure AD tenant. This sample will not work with a Microsoft account (formerly Windows Live account). Therefore, if you signed in to the [Azure portal](https://portal.azure.com) with a Microsoft account and have never created a user account in your directory before, you need to do that now.
48
+
- A user account in your Azure AD tenant. This sample will not work with a **personal Microsoft account**. Therefore, if you signed in to the [Azure portal](https://portal.azure.com) with a personal account and have never created a user account in your directory before, you need to do that now.
52
49
53
50
> Please make sure to have one or more user accounts in the tenant assigned to a few security groups in your tenant. Please follow the instructions in [Create a basic group and add members using Azure Active Directory](https://docs.microsoft.com/azure/active-directory/fundamentals/active-directory-groups-create-azure-portal) to create a few groups and assign users to them if not already done.
54
51
55
-
### Step 1: Clone or download this repository
52
+
### Step 1: In the downloaded folder
56
53
57
54
From your shell or command line:
58
55
@@ -113,8 +110,8 @@ Now you have two different options available to you on how you can further confi
113
110
114
111
1. Clean and rebuild the solution, and run it.
115
112
116
-
1. Open your web browser and make a request to the app. The app immediately attempts to authenticate you to the Microsoft identity platform. Sign in with a *work or school account* from the tenant where you created this app.
117
-
1. On the home page, the app lists the various claims it obtained from your ID token. You'd notice one more claims named `groups`.
113
+
1. Open your web browser and make a request to the app. The app immediately attempts to authenticate you to the Microsoft identity platform. You can sign-in with a *work or school account* from the tenant where you created this app. But sign-in with admin for the first time as admin consent is required for `GroupMember.Read.All` permission.
114
+
1. On the home page, the app lists the various claims it obtained from your ID token. You'd notice one more claims named `groups`.
118
115
1. On the top menu, click on the signed-in user's name **[email protected]**, you should now see all kind of information about yourself including their picture. Beneath that, a list of all the security groups that the signed-in user is assigned to are listed as well. All of this was obtained by making calls to Microsoft Graph. This list is useful if the **Overage** scenario occurs with this signed-in user. The [overage](#groups-overage-claim) scenario is discussed later in this article.
119
116
120
117
> Did the sample not work for you as expected? Did you encounter issues trying this sample? Then please reach out to us using the [GitHub Issues](../../../../issues) page.
@@ -137,8 +134,8 @@ The object id of the security groups the signed in user is member of is returned
137
134
138
135
### Support in ASP.NET Core middleware libraries
139
136
140
-
The asp.net middleware supports roles populated from claims by specifying the claim in the `RoleClaimType` property of `TokenValidationParameters`.
141
-
Since the `groups` claim contains the object ids of the security groups than actual names by default, you'd use the group id's instead of group names. See [Role-based authorization in ASP.NET Core](https://docs.microsoft.com/aspnet/core/security/authorization/roles) for more info.
137
+
The ASP.NET middleware supports roles populated from claims by specifying the claim in the `RoleClaimType` property of `TokenValidationParameters`.
138
+
Since the `groups` claim contains the object IDs of the security groups than actual names by default, you'd use the group ID's instead of group names. See [Role-based authorization in ASP.NET Core](https://docs.microsoft.com/aspnet/core/security/authorization/roles) for more info.
142
139
143
140
```CSharp
144
141
// Startup.cs
@@ -243,7 +240,7 @@ The following files have the code that would be of interest to you:
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" })
243
+
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { "User.Read", "GroupMember.Read.All" })
247
244
.AddInMemoryTokenCaches();
248
245
249
246
services.AddMSGraphService(Configuration); // Adds the IMSGraphService as an available service for this app.
@@ -252,7 +249,6 @@ The following files have the code that would be of interest to you:
252
249
1. if you used the Powershell scripts provided in the [AppCreationScripts](.\AppCreationScripts) folder, then note the extra parameter `-GroupMembershipClaims` in the `Configure.ps1` script.
253
250
254
251
```PowerShell
255
-
-Oauth2AllowImplicitFlow $true `
256
252
-GroupMembershipClaims "SecurityGroup" `
257
253
-PublicClient $False
258
254
```
@@ -261,7 +257,7 @@ The following files have the code that would be of interest to you:
261
257
262
258
Use [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) to get support from the community.
263
259
Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before.
264
-
Make sure that your questions or comments are tagged with [ `msal` `azure-active-directory`].
260
+
Make sure that your questions or comments are tagged with [ `msal` `azure-active-directory` `dotnet`].
265
261
266
262
If you find a bug in the sample, please raise the issue on [GitHub Issues](../../../../issues).
267
263
@@ -273,7 +269,7 @@ To provide a recommendation, visit the following [User Voice page](https://feedb
273
269
274
270
## Learn more
275
271
276
-
- Learn how [Microsoft.Identity.Web](../../Microsoft.Identity.Web) works, in particular hooks-up to the ASP.NET Core ODIC events
272
+
- Learn how [Microsoft.Identity.Web](https://aka.ms/idweblib) works, in particular hooks-up to the ASP.NET Core ODIC events
277
273
278
274
- To understand more about groups roles and the various claims in tokens, see:
279
275
- [Configure group claims for applications with Azure Active Directory (Public Preview)](https://docs.microsoft.com/azure/active-directory/hybrid/how-to-connect-fed-group-claims#configure-the-azure-ad-application-registration-for-group-attributes)
0 commit comments