1

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

BCela
  • 13
  • 4
  • Do you see users from all userstores in "List Users" UI in carbon admin console? – Bee Nov 11 '16 at 18:17

1 Answers1

0

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>
Bee
  • 12,251
  • 11
  • 46
  • 73
  • Thanks, it worked. It was so simple yet I spent a day and half working on it. I also found an alternative in jaggery using the user.Usemanager functions: http://jaggeryjs.org/documentation.jag?api=UserManager – BCela Nov 14 '16 at 08:50