Openstack Identity admin client: cannot find users, roles and services

468 views Asked by At

I'm using Openstack "ice-house" and the "admin" user. My openstack4j version is 2.0.3.

Using Identity admin client, I can only get a part of my tenants-list.

Even worse, when I try to list "users", "roles" and "services", it returns an empty list or NULL.

Here is my code sample:

OSClient os = OSFactory.builder()
                .endpoint("http://localhost:5000/v2.0/")
                .credentials("admin", "secret")
                .tenantName("admin")
                .authenticate();

System.out.println(os.identity().tenants().list());  // Get Only A Part of my tenant list
System.out.println(os.identity().users().list());  // Get Empty List
System.out.println(os.identity().services().list());  // Also Get Empty List

I tried some solutions on Internet. For example:

OSClient os = OSFactory.builder()
                .endpoint("http://localhost:5000/v2.0/")
                .credentials("admin", "secret")
                .tenantName("admin")
                .perspective(Facing.ADMIN)
                .authenticate();

and I got connection failed (timeout) error. Then I tried .perspective(Facing.PUBLIC) ,there is no error, however, I still got empty list or NULL.

Anyone could help me about this problem?

1

There are 1 answers

0
CLA_IT On

i solved using : OSFactory.enableLegacyEndpointHandling(true);