WSO2 SCIM 2.0查询过滤器 - 不支持多值搜索。例如filter = emails.value co richard01

问题描述 投票:0回答:1

当我按照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 [email protected]。据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”]

wso2is scim2
1个回答
0
投票

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

请求:

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

响应:

{"emails":[{"type":"work","value":"[email protected]"}],"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":"[email protected]"}],"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"}]}

有关更多信息,请参阅documentation

© www.soinside.com 2019 - 2024. All rights reserved.