Search code examples
wso2wso2-api-managerjaggery-js

WSO2 API Manager Admin Services - Get List of Secondary Store Users


I am using admin services to get a list of all users available in the store. I am calling the service through Jaggery using this code:

ws = require('ws');
var user = "";
var wsUser = new ws.WSRequest();

var optionsUser = new Object();
optionsUser.useSOAP = 1.2;
optionsUser.useWSA = 1.0;
optionsUser.action = "urn:listUsers";

wsUser.open(optionsUser, "https://localhost:9443/services/RemoteUserStoreManagerService", false, "admin", "admin");

wsUser.send('<ser:listUsers xmlns:ser="http://service.ws.um.carbon.wso2.org"><ser:filter></ser:filter><ser:maxItemLimit>-1</ser:maxItemLimit></ser:listUsers>');

resultUser = wsUser.responseText;

This gives me the list of users of the Primary Store. There is also a Secondary User Store connected to the APIM through Active Directory, and I would like to get the list of the users of that store as well.

Is there a way to get the list of users of all stores using admin service, if yes how would I do that? Thanks


Solution

  • If you set '*' (i.e.asterisk) for search filter like below, you should get users of all userstores.

      <ser:listUsers xmlns:ser="http://service.ws.um.carbon.wso2.org">
         <ser:filter>*</ser:filter>
         <ser:maxItemLimit>-1</ser:maxItemLimit>
      </ser:listUsers>