@@ -55,6 +55,7 @@ public async Task<IActionResult> GetUsersAsync(string filter = null, int start =
5555 }
5656
5757 [ HttpPost ( "" , Name = IdentityManagerConstants . RouteNames . CreateUser ) ]
58+ [ ValidateAntiForgeryToken ]
5859 public async Task < IActionResult > CreateUserAsync ( [ FromBody ] PropertyValue [ ] properties )
5960 {
6061 var meta = await GetMetadataAsync ( ) ;
@@ -135,6 +136,7 @@ public async Task<IActionResult> GetUserAsync(string subject)
135136 }
136137
137138 [ HttpDelete , Route ( "{subject}" , Name = IdentityManagerConstants . RouteNames . DeleteUser ) ]
139+ [ ValidateAntiForgeryToken ]
138140 public async Task < IActionResult > DeleteUserAsync ( string subject )
139141 {
140142 var meta = await GetMetadataAsync ( ) ;
@@ -164,6 +166,7 @@ public async Task<IActionResult> DeleteUserAsync(string subject)
164166 }
165167
166168 [ HttpPut , Route ( "{subject}/properties/{type}" , Name = IdentityManagerConstants . RouteNames . UpdateUserProperty ) ]
169+ [ ValidateAntiForgeryToken ]
167170 public async Task < IActionResult > SetPropertyAsync ( string subject , string type )
168171 {
169172 if ( IsNullOrWhiteSpace ( subject ) )
@@ -194,6 +197,7 @@ public async Task<IActionResult> SetPropertyAsync(string subject, string type)
194197 }
195198
196199 [ HttpPost , Route ( "{subject}/claims" , Name = IdentityManagerConstants . RouteNames . AddClaim ) ]
200+ [ ValidateAntiForgeryToken ]
197201 public async Task < IActionResult > AddClaimAsync ( string subject , [ FromBody ] ClaimValue model )
198202 {
199203 var meta = await GetMetadataAsync ( ) ;
@@ -229,6 +233,7 @@ public async Task<IActionResult> AddClaimAsync(string subject, [FromBody] ClaimV
229233 }
230234
231235 [ HttpDelete , Route ( "{subject}/claims/{type}/{value}" , Name = IdentityManagerConstants . RouteNames . RemoveClaim ) ]
236+ [ ValidateAntiForgeryToken ]
232237 public async Task < IActionResult > RemoveClaimAsync ( string subject , string type , string value )
233238 {
234239 type = type . FromBase64UrlEncoded ( ) ;
@@ -257,6 +262,7 @@ public async Task<IActionResult> RemoveClaimAsync(string subject, string type, s
257262 }
258263
259264 [ HttpPost , Route ( "{subject}/roles/{role}" , Name = IdentityManagerConstants . RouteNames . AddRole ) ]
265+ [ ValidateAntiForgeryToken ]
260266 public async Task < IActionResult > AddRoleAsync ( string subject , string role )
261267 {
262268 var meta = await GetMetadataAsync ( ) ;
@@ -282,6 +288,7 @@ public async Task<IActionResult> AddRoleAsync(string subject, string role)
282288 }
283289
284290 [ HttpDelete , Route ( "{subject}/roles/{role}" , Name = IdentityManagerConstants . RouteNames . RemoveRole ) ]
291+ [ ValidateAntiForgeryToken ]
285292 public async Task < IActionResult > RemoveRoleAsync ( string subject , string role )
286293 {
287294 var meta = await GetMetadataAsync ( ) ;
0 commit comments