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
75
75
76
76
if ( identity != null )
77
77
{
78
- // Remove any existing groups claim
79
- RemoveExistingClaims ( identity ) ;
80
-
81
78
// Re-populate the `groups` claim with the complete list of groups fetched from MS Graph
82
79
foreach ( Group group in allgroups )
83
80
{
@@ -116,23 +113,6 @@ public static async Task<List<string>> GetSignedInUsersGroups(TokenValidatedCont
116
113
return groupClaims ;
117
114
}
118
115
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
-
136
116
/// <summary>
137
117
/// Returns all the groups that the user is a direct member of.
138
118
/// </summary>
You can’t perform that action at this time.
0 commit comments