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
@@ -353,56 +353,68 @@ The following files have the code that would be of interest to you:
353
353
354
354
`AddMicrosoftGraph` registers the service for `GraphServiceClient`. The values for BaseUrl and Scopes defined in `GraphAPI` section of **appsettings.json**.
355
355
356
-
1. In GraphHelper.cs, ProcessClaimsForGroupsOverage method uses `GraphServiceClient` to retrieve groups for the signed-in user from [/me/memberOf](https://docs.microsoft.com/graph/api/user-list-memberof) endpoint. All the groups are stored in list of claims and the data can be used in the application as per requirement.
357
-
358
-
```csharp
359
-
public static async Task ProcessClaimsForGroupsOverage(TokenValidatedContext context)
var exMsg = graphEx.InnerException != null ? graphEx.InnerException.Message : graphEx.Message;
383
-
Console.WriteLine("Call to Microsoft Graph failed: "+ exMsg);
384
-
}
385
-
if (memberPage?.Count > 0)
386
-
{
387
-
var allgroups = ProcessIGraphServiceMemberOfCollectionPage(memberPage);
388
-
if (allgroups?.Count > 0)
389
-
{
390
-
var identity = (ClaimsIdentity)context.Principal.Identity;
391
-
if (identity != null)
392
-
{
393
-
RemoveExistingClaims(identity);
394
-
List<Claim> groupClaims = new List<Claim>();
395
-
foreach (Group group in allgroups)
396
-
{
397
-
groupClaims.Add(new Claim("groups", group.Id));
398
-
}
399
-
}
400
-
}
401
-
}
402
-
}
403
-
}
404
-
....
405
-
}
356
+
1. In GraphHelper.cs, ProcessClaimsForGroupsOverage method uses `GraphServiceClient` to retrieve groups for the signed-in user from [/me/memberOf](https://docs.microsoft.com/graph/api/user-list-memberof) endpoint. All the group ids are stored in list of claims and the data can be used in the application as per requirement.
357
+
358
+
```csharp
359
+
public static async Task ProcessClaimsForGroupsOverage(TokenValidatedContext context)
0 commit comments