Hi Ayesha,

Thanks, will try that out too.

Thanks,
Supun

On Wed, Nov 19, 2014 at 5:35 PM, Ayesha Dissanayaka <[email protected]> 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
> 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 tenantId =  carbon.server.tenantId({domain: domain});
>>
>
> Thanks!
> -Ayesha
>
> On Tue, Nov 18, 2014 at 2:44 PM, Supun Sethunga <[email protected]> wrote:
>
>> 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 Tue, Nov 18, 2014 at 1:59 PM, Godwin Amila Shrimal <[email protected]>
>> wrote:
>>
>>> 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 <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> How can do $subject?
>>>>
>>>> I was able to get the Tenant Domain as follows though.
>>>>
>>>> var user=jagg.getUser();
>>>> var MultitenantUtils =
>>>> Packages.org.wso2.carbon.utils.multitenancy.MultitenantUtils;
>>>> var tenantDomain = MultitenantUtils.getTenantDomain(user);
>>>>
>>>> Thanks,
>>>> Supun
>>>>
>>>> --
>>>> *Supun Sethunga*
>>>> Software Engineer
>>>> WSO2, Inc.
>>>> lean | enterprise | middleware
>>>> Mobile : +94 716546324
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> *Godwin Amila Shrimal*
>>> Senior Software Engineer
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: *+94772264165*
>>> linkedin: *http://lnkd.in/KUum6D <http://lnkd.in/KUum6D>*
>>> twitter: https://twitter.com/godwinamila
>>>
>>
>>
>>
>> --
>> *Supun Sethunga*
>> Software Engineer
>> WSO2, Inc.
>> lean | enterprise | middleware
>> Mobile : +94 716546324
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: [email protected] <[email protected]>
>



-- 
*Supun Sethunga*
Software Engineer
WSO2, Inc.
lean | enterprise | middleware
Mobile : +94 716546324
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to