0

当我按照 WSO2 SCIM 2.0 REST 端点(https://docs.wso2.com/display/IS560/apidocs/SCIM2-endpoints/index.html#!/operations#UsersEndpoint#getUser)通过一些多值搜索用户时属性(例如电子邮件)。WSO2 身份服务器(v5.7.0)返回空结果。像这样的过滤器字符串 -filter=emails.value co abc@abc.com。根据http://www.simplecloud.info/specs/draft-scim-api-00.html#query-resources,语法似乎不错。

curl -v -k --user : https://localhost:9444/scim2/Users?filter=emails.value+co+richard01

响应: {"totalResults":0,"startIndex":1,"itemsPerPage":0,"schemas":["urn:ietf:params:scim:api:messages:2.0:ListResponse"]

4

1 回答 1

0

我们需要输入我们在创建用户时定义的“email.< type-name >”,而不是作为“emails.value” 。电子邮件是一个多值属性,因此您可以添加您的类型并为其存储值。假设我在这里创建用户如下,

要求:

curl -v -k --user admin:admin --data '{"schemas":[],"name":{"familyName":"jackson","givenName":"kim"},"userName":"kim","password":"kimwso2","emails":[{"value":"kim_j@wso2.com","type":"work"}]}' --header "Content-Type:application/json" https://localhost:9443/scim2/Users

回复:

{"emails":[{"type":"work","value":"kim_j@wso2.com"}],"meta":{"created":"2019-03-26T15:18:47Z","location":"https://localhost:9443/scim2/Users/c40fe2f2-d9c1-4555-a1d1-e6ff3dde9d41","lastModified":"2019-03-26T15:18:47Z","resourceType":"User"},"schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"name":{"familyName":"jackson","givenName":"kim"},"id":"c40fe2f2-d9c1-4555-a1d1-e6ff3dde9d41","userName":"kim"}

现在让我们过滤多值属性电子邮件,

要求:

curl -v -k --user admin:admin https://localhost:9443/scim2/Users?filter=emails.work+co+kim

回复:

{"totalResults":1,"startIndex":1,"itemsPerPage":1,"schemas":["urn:ietf:params:scim:api:messages:2.0:ListResponse"],"Resources":[{"emails":[{"type":"work","value":"kim_j@wso2.com"}],"meta":{"created":"2019-03-26T15:18:47Z","location":"https://localhost:9443/scim2/Users/c40fe2f2-d9c1-4555-a1d1-e6ff3dde9d41","lastModified":"2019-03-26T15:18:47Z","resourceType":"User"},"roles":[{"type":"default","value":"Internal/everyone"}],"name":{"givenName":"kim","familyName":"jackson"},"id":"c40fe2f2-d9c1-4555-a1d1-e6ff3dde9d41","userName":"kim"}]}

有关更多信息,请参阅此处的文档

于 2019-03-26T10:00:57.463 回答