Skip to content

Commit 651618c

Browse files
committed
re-add removed comment
1 parent 475475f commit 651618c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

5-WebApp-AuthZ/5-2-Groups/Startup.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ public void ConfigureServices(IServiceCollection services)
3838
// Sign-in users with the Microsoft identity platform
3939
services.AddMicrosoftWebAppAuthentication(Configuration)
4040
.AddMicrosoftWebAppCallsWebApi(Configuration, new string[] { "User.Read", "Directory.Read.All" })
41+
42+
// If you want to use group ids/names in the Authorize attribute then uncomment the following lines:
43+
//services.Configure<OpenIdConnectOptions>(options =>
44+
// {
45+
// // Uncomment the following lines code instruct the asp.net core middleware to use the data in the "groups" claim in the [Authorize] attribute and for User.IsInrole()
46+
// // See https://docs.microsoft.com/en-us/aspnet/core/security/authorization/roles for more info.
47+
// // Use the groups claim for populating roles
48+
// options.TokenValidationParameters.RoleClaimType = "groups";
49+
// })
50+
4151
.AddInMemoryTokenCaches();
4252

4353
services.AddMSGraphService(Configuration);

0 commit comments

Comments
 (0)