I am using WSO2 Identity Server 4.1.0. My requirement is to assign an existing role to a user created in the WSO2 default identity store. I have tried the following:
I assume you have the SCIM Id for the role and it is 'c83dc72c-15c2-40f2-bffffd-4acb086b9e17'. And user store is configured properly so the user and role is in the same user store.
If the above conditions are true, you can do the following to achieve the task.
For example,
curl -v -k --user admin:admin -X PUT -d "{"displayName": 'Engineer' ,"members": [{"value":"334d988a-5e68-4594-8b96-356adeec29f1","display": "venura"}, {"value":"p09okhyt-5e68-4594-8mkj-356ade12we34","display": "testUser"}]}" --header "Content-Type:application/json" https://localhost:9443/wso2/scim/Groups/c83dc72c-15c2-40f2-bffffd-4acb086b9e17
For more details please check the below link [1] in order to get a clear idea on how you can use PUT to update the role/ group.
[1] http://hasini-gunasinghe.blogspot.com/2012/11/wso2-identity-server-as-scim-service.html