【发布时间】:2012-08-09 15:42:26
【问题描述】:
我需要知道如何通过声明值获取 wso2 用户,以执行某种搜索?
示例:
getUsersByClaimValue(String claimUri, String claimValue);
【问题讨论】:
标签: wso2 user-management
我需要知道如何通过声明值获取 wso2 用户,以执行某种搜索?
示例:
getUsersByClaimValue(String claimUri, String claimValue);
【问题讨论】:
标签: wso2 user-management
是的。此 API 方法已被引入用户存储 API 以获取与特定用户属性关联的用户名。假设您想获取“国家”属性值为“美国”的用户。那么你可以使用这个方法如下。
getUserList("http://wso2.org/claims/country", "USA", null);
您可以在 WSO2IS 的RemoteUserStoreManagerService 中找到此方法作为 Web 服务 API。您的 SOAP 消息如下所示。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://service.ws.um.carbon.wso2.org">
<soapenv:Header/>
<soapenv:Body>
<ser:getUserList>
<ser:claimUri>http://wso2.org/claims/country</ser:claimUri>
<ser:claimValue>USA</ser:claimValue>
<ser:profile></ser:profile>
</ser:getUserList>
</soapenv:Body>
</soapenv:Envelope>
在这里,此声明 uri 是通用的,独立于用户存储。使用 WSO2 身份服务器,您可以将这些声明 uri 映射到用户存储中的任何属性。更多详情来自here
【讨论】:
listUser() 仅用于列出所有用户,而不是按属性搜索。这是不正确的。