0

Running WSO2IS v5.11.0. After creating a tenant with domain "example.com" using the addTenant endpoint, I execute the following REST call to retrieve it

GET https://host:port/t/carbon.super/api/server/v1/tenants/domain/example.com

Contrary to what is documented in the docs, the response does not contain the tenant's id. Here is the response:

{
    "domain": "example.com",
    "owners": [
        {
            "username": "test@example.com"
        }
    ],
    "createdDate": "2021-02-04T14:43:53.598Z",
    "lifecycleStatus": {
        "activated": true
    }
}

Why is the id not included in the response? Am I doing something wrong or is this a bug?

Community
  • 1
  • 1

1 Answers1

0

Seems it is a bug in IS-5.11.0. If you try the latest milestone release 5.12.0-m9 you can retrieve the tenant id in your request.

The fix https://github.com/wso2/carbon-kernel/pull/2869 should have resolved that issue in the recent milestone versions. So you can patch this into 5.11.0 and use.


In IS-5.11.0, If you create a tenant using POST request and retrieve the tenant by its domain GET https://host:port/api/server/v1/tenants/domain/example.com the tenant UUID will not return.

If you follow the following steps:

  1. create a tenant using POST request
  2. Find the Location header in the response header and get the tenant UUID
  3. Get the tenant by GET /tenants/{tenant-id}
  4. Next get the tenant by domain GET https://host:port/api/server/v1/tenants/domain/example.com - now you will get the tenant UUID (tenant object may be cached with its unique id due to the request in 3rd step)

So it's not an API level issue. Above mentioned carbon-kernel fix should have fixed the core level issue.

Anuradha Karunarathna
  • 2,717
  • 2
  • 9
  • 17