how to add users to roles using SCIM in WSO2

夙愿已清 提交于 2019-12-24 07:12:03

问题


I want to add roles to users programatically in WSO2 Identity server. I am able to create users by SCIM API's.But cant find an API to add a user to a role. I tried giving the user name as "userName":"role/myusername" in the wso2/scim/Users POST API. But its not working ; not sure if its the correct approach. Can someone tell me how to add a role to an existing user and also add a role to a new user?

Thanks


回答1:


The answer here shows how to do that with SCIM PUT command.

Also From IS 5.1.0 onwards you can also use the PATCH operation as mentioned in the docs

Add user AMRSNGHE/groupUSR001 to group AMRSNGHE/ngioletGR

curl -k --user admin:admin -X PATCH -d '{"displayName": 'AMRSNGHE/ngioletGR',"members": [{"value":"","display": 'AMRSNGHE/groupUSR001'}]}' --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Groups/<id returned in the response when creating the group AMRSNGHE/ngioletGR>



来源:https://stackoverflow.com/questions/41444103/how-to-add-users-to-roles-using-scim-in-wso2

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