machristie opened a new issue, #382:
URL: https://github.com/apache/airavata-custos/issues/382

   I created a super tenant and a child tenant. In the child tenant I created a 
user with username "demouser".  I then tried to search for the "demouser" in 
the child tenant but using the super tenant credential. This is to support a 
Data Catalog use case (see 
https://github.com/apache/airavata-data-catalog/issues/12): Data Catalog will 
have a Custos super tenant credential and will use that to resolve users, 
groups, etc. in child tenants.
   
   Here's the code I used:
   
   ```java
           // Super tenant
           String clientId = "custos-s8qf9g3odbbcdsgd2khv-10000000";
           String clientSec = "REDACTED";
           String childClientId = "custos-e6vgzgskcr0pewrejma3-10000002";
           // String clientId = "custos-e6vgzgskcr0pewrejma3-10000002";
           // String clientSec = "REDACTED";
           CustosClientProvider custosClientProvider = new 
CustosClientProvider.Builder().setServerHost("localhost")
                   .setServerPort(7000)
                   .setClientId(clientId) // client Id generated from above 
step or any active tenant id
                   .setClientSec(clientSec)
                   .usePlainText(true) // Don't use this in production setup
                   .build();
           UserManagementClient userManagementClient = 
custosClientProvider.getUserManagementClient();
           // userManagementClient.registerUser("demoUser", "Demo", "User", 
"testpassword",
           // "demou...@gmail.com", false);
           // userManagementClient.enableUser("demoUser");
           // FindUsersResponse findUsersResponse =
           // userManagementClient.findUser("demouser", null, null, null, 0, 1);
           FindUsersResponse findUsersResponse = 
userManagementClient.findUser(childClientId, "demouser", null, null, null,
                   0, 1);
           System.out.println("findUsersResponse=" + findUsersResponse);
   ```
   
   The above works if I search for the user with the child tenant credentials, 
but not when I use the super tenant credentials.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@airavata.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to