How to update a single user's groups with WSO2 SCIM REST API without using patch/ Groups as it results in timeout when the user count is high?

爱⌒轻易说出口 提交于 2021-01-29 15:40:30

问题


We are using WSO2 SCIM apis to define roles to user and update it. For role update operation , we are currently adding the new user role(add user to new role group using SCIM api) , and then delete the existing user role (call users SCIM GET request under a GROUP, delete the existing user from the list and use the newly created list as body arguments to call SCIM PATCH request for the GROUP). With this approach , we were able to update roles. But as the user base increased , the above approach of PATCH operation is getting timeout error .(The new role gets updated to user, but the existing role persists as the 2nd api is getting failed).

Below is one solution which i tried out :

Add new role, delete the newly created role inside user details and call PATCH api with the updated roles of user. But then realized on further investigation that roles inside user is readonly and can't be updated using patch/put operations. So i failed in getting a proper solution .

Is there a way to update a single user's role inside the GROUP without using PATCH /Groups endpoint ?


回答1:


As I have mentioned in the answer https://stackoverflow.com/a/64225419/10055162, the SCIM specification doesn't allow to update the user's group attribute using PATCH /Users/{userId}.

Also, PATCH /Groups/{groupId} may cause performance issues when the group's member count is too high.

WSO2 IS has improved the performance of PATCH /Groups/{groupId} to some extent.

  1. https://github.com/wso2/product-is/issues/6918 - available 5.10.0 onwards
  2. https://github.com/wso2/product-is/issues/9120 - available 5.11.0 onwards

So, if you are using an older version of IS, can you please try with the latest GA release(5.11.0). It may improve the performance.



来源:https://stackoverflow.com/questions/65887494/how-to-update-a-single-users-groups-with-wso2-scim-rest-api-without-using-patch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!