Re: [Dev] Obtain the tenant ID of the currently logged in user from Jaggery

2014-11-20 Thread Lahiru Cooray
Hi, In AppManager it uses the below method to get the tenant Id: *var tenant=server.tenant(request,session);* *var tenantId =tenant.tenantId;* On Tue, Nov 18, 2014 at 1:52 PM, Supun Sethunga sup...@wso2.com wrote: Hi, How can do $subject? I was able to get the Tenant Domain as follows

Re: [Dev] Obtain the tenant ID of the currently logged in user from Jaggery

2014-11-19 Thread Ayesha Dissanayaka
Hi Supun, Not sure whether this is helpful now. Another way you can get tanantID by domain name is, if you have enabled 'carbon' jaggery module in your environment, you can use below code as well. This is how we does it in ES. var carbon = require('carbon'); var domain = 'domain.name'; var

Re: [Dev] Obtain the tenant ID of the currently logged in user from Jaggery

2014-11-19 Thread Supun Sethunga
Hi Ayesha, Thanks, will try that out too. Thanks, Supun On Wed, Nov 19, 2014 at 5:35 PM, Ayesha Dissanayaka aye...@wso2.com wrote: Hi Supun, Not sure whether this is helpful now. Another way you can get tanantID by domain name is, if you have enabled 'carbon' jaggery module in your

Re: [Dev] Obtain the tenant ID of the currently logged in user from Jaggery

2014-11-18 Thread Godwin Amila Shrimal
Hi Supun, Use can use following code to get the tenantId. UserRealmService.getTenantManager().getTenantId(tenantDomain); On Tue, Nov 18, 2014 at 1:52 PM, Supun Sethunga sup...@wso2.com wrote: Hi, How can do $subject? I was able to get the Tenant Domain as follows though. var

Re: [Dev] Obtain the tenant ID of the currently logged in user from Jaggery

2014-11-18 Thread Supun Sethunga
Hi Godwin, Thanks! Had to alter the above code as follows, though. *var tenantManagerService = new Packages.org.wso2.carbon.um.ws.service.TenantManagerService();* *var tenantId = tenantManagerService.getTenantId(tenantDomain);* Thanks again for pointing out where to look for. :) Regards, On