File tree Expand file tree Collapse file tree 1 file changed +0
-20
lines changed
5-WebApp-AuthZ/5-2-Groups/Services/MicrosoftGraph-Rest Expand file tree Collapse file tree 1 file changed +0
-20
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,6 @@ public static async Task<List<string>> GetSignedInUsersGroups(TokenValidatedCont
7575
7676 if ( identity != null )
7777 {
78- // Remove any existing groups claim
79- RemoveExistingClaims ( identity ) ;
80-
8178 // Re-populate the `groups` claim with the complete list of groups fetched from MS Graph
8279 foreach ( Group group in allgroups )
8380 {
@@ -116,23 +113,6 @@ public static async Task<List<string>> GetSignedInUsersGroups(TokenValidatedCont
116113 return groupClaims ;
117114 }
118115
119- /// <summary>
120- /// Remove groups claims if already exists.
121- /// </summary>
122- /// <param name="identity"></param>
123- private static void RemoveExistingGroupsClaims ( ClaimsIdentity identity )
124- {
125- //clear existing claim
126- List < Claim > existingGroupsClaims = identity . Claims . Where ( x => x . Type == "groups" ) . ToList ( ) ;
127- if ( existingGroupsClaims ? . Count > 0 )
128- {
129- foreach ( Claim groupsClaim in existingGroupsClaims )
130- {
131- identity . RemoveClaim ( groupsClaim ) ;
132- }
133- }
134- }
135-
136116 /// <summary>
137117 /// Returns all the groups that the user is a direct member of.
138118 /// </summary>
You can’t perform that action at this time.
0 commit comments