Skip to main content

Posts

Showing posts with the label Active Directory Attributes

How to retrieve Attributes (fields) in Active Directory using jaggery?

We can get user attributes in Active Directory using jaggery and need to follow the steps which were provided in the previous blog . <% var carbon = require('carbon'); var tenantId = -1234; var url = 'https://localhost:9443/admin/services/'; var server = new carbon.server.Server(url); var userManager = new carbon.user.UserManager(server, tenantId); var result = userManager.getClaims("WSO2USERSTORE/testuser", "default"); for(i =0; i<result.length; i++){ print(result[i].getClaimUri() + " ==> " +result[i].getValue()); print('<br>'); } %> Here, getClaims(username String, profile String) method is used to get all claim values of the user in the profile and it returns a JSON object with all claims that user has and their values.