Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WSO2 get user by claim value

I need to know how to get wso2 users by claim value, to perform some kind of search?

example:

getUsersByClaimValue(String claimUri, String claimValue);

like image 790
Stepan Bahdikyan Avatar asked Aug 13 '12 11:08

Stepan Bahdikyan


1 Answers

Yes.This API method has been introduced to user store API to get user names associated with particular user's attribute. say you want to get users whose "country" attribute value is "USA". then you can use this method as follows.

getUserList("http://wso2.org/claims/country", "USA", null);

You can find this method as web service API in RemoteUserStoreManagerService of WSO2IS. Your SOAP message would look likes follows.

<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>

Here, this claim uri is generic one which is independent of the user store. With WSO2 Identity server you can map these claim uri in to any attribute in your user store. More details from here

like image 105
Asela Avatar answered Sep 18 '22 17:09

Asela