Skip to main content

Posts

Showing posts with the label WSO2 BPS

How to list all users belongs to particular user store using jaggery?

We can list all users belongs to particular user store using jaggery. To achieve this, create a directory(ListUser) inside "<BPS>/repository/deployment/server/jaggeryapps" and then create a jaggery file(listUser.jag) inside a newly created folder. In this example, I used WSO2 BPS to test this sample. Add the following content into listUser.jag file. <% var carbon = require('carbon'); var tenantId = -1234; var url = 'https://<HOSTNAME>:9443/admin/services/'; var server = new carbon.server.Server(url); var userManager = new carbon.user.UserManager(server, tenantId); print(userManager.getUserListOfRole("ROLE")); %> Here, you need to change the "HOSTNAME" and "ROLE" according to your config. Please find the sample listUser.jag blow, where my "HOSTNAME" is localhost and user "ROLE" is WSO2USERSTORE/clerk. <% var carbon = require('carbon'); var tenantId = -1234; var url = 'http...