我正在使用 WSO2 IS 4.1.0 。当尝试使用 SCIM分配角色时,我在服务器日志中收到了以下消息。
[2013-05-05 22:28:58,481] INFO {org.wso2.carbon.identity.scim.provider.impl.SCIMUserManager} - User: dinuka is created through SCIM.
它不会为用户分配角色,而是始终为角色“所有人”分配。
以下是我 JSON 发布到 WSO2 IS
{"schemas":[],"userName":"chaminda","password":"pissek","name":{"familyName":"Gunawardena","givenName":"chaminda"},"emails":[{"primary":"true","value":"lc2002lk@yahoo.com","type":"home"}],"addresses":{"streetAddress":"Test
Address1","formatted":"Test
Address2","locality":"Galle","region":"Shouthern","country":"Sri
Lanka","postalCode":"8000"},"phoneNumbers":[{"primary":"true","value":"0094
714 209 800","type":"work"}],"displayName":"Test
Display","title":"Tech. Lead","roles":["admin"]}
用户正在成功创建但从未分配给给定角色。
答案 0 :(得分:0)
感谢您的查询,在添加用户时,您可以将curl命令作为
传递curl -v -k --user admin:admin --data "{"schemas":[],"userName":"userone","password":"userone"}" --header "Content-Type:application/json" https://{hostname}:{port}/wso2/scim/Users
如果创建了一个名为“userone”的用户,系统将生成一个带有ID的响应,如ex:“0f9b34f6-7c44-4d64-a949-1ee4266097a9”生成,添加角色时我们需要传递为创建的用户生成的ID以及创建的用户显示名称,如下所示。
根据下面的curl命令,应创建一个名为“myrole01”的角色,其中包含一个名为“userone”的用户。
curl -v -k --user admin:admin --data "{"displayName": "myrole01","members": [{"value":"0f9b34f6-7c44-4d64-a949-1ee4266097a9","display": "userone"}]}" --header "Content-Type:application/json" https://{hostname}:{port}/wso2/scim/Groups