WSO2通过索赔值获取用户

Ste*_*yan 8 wso2 user-management

我需要知道如何通过索赔值获取wso2用户,以执行某种搜索?

例:

getUsersByClaimValue(String claimUri, String claimValue);

Ase*_*ela 6

是的.此API方法已引入用户存储API以获取与特定用户属性关联的用户名.假设您想要获得"country"属性值为"USA"的用户.然后您可以使用此方法如下.

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映射到用户存储中的任何属性.更多细节来自这里

  • 谢谢.方法名称不正确.更新了它.但是`listUser()`仅用于列出所有用户,而不是按属性搜索.这是不正确的. (2认同)