p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
389 stars 66 forks source link

Documentation on how to use through admin-cli #9

Closed KDMRyanT closed 2 years ago

KDMRyanT commented 2 years ago

Hello,

I have p2-inc/keycloak-orgs installed under a keycloak docker instance. The keycloak version I have used is 18.0.2. I have the jar file and admin-client.jar file deployed to the providers directory of the docker instance. I have proof that the jar is installed and running as I have "realm-management" client created. I see roles under here for *-organizations.

So my question is, I try to setup any of the organizations within a realm. Is it possible to do this through admin-cli?

In any regard, I have not been able to see any organizations within the UI. I have tried to use admin-cli to view if any organizations exist:

./kcadm.sh config credentials --server http://myserver.mydomain.org:8080 --realm master --client admin-cli --user admin

then to one of my sub realms of master - I try to list the orgs.

kcadm.sh get orgs --realm testingrealm

result is "Resource not sound for url: http://myserver.mydomain.org:8080/admin/realms/testingrealm/orgs"

Is there more enabling to do under each realm? Will the result of the above always result in that not found until a create orgs command can be executed? Example:

kcadm.sh create orgs -r testingrealm -s name=testing

Which results in "Resource not found for url: http://myserver.mydomain.org:8080/admin/realms/testingrealm/orgs"

Just looking for some direction - what have I done wrong.

KDMRyanT commented 2 years ago

To follow up on what I have done. I have built the code, I have taken as instructed the keycloak-orgs jar and keycloak-admin-client jar and copied into docker container to the "providers" directory. From there, ./kc.sh build on the keycloak docker instance. From there I run show-config ( build says to show-config ) and it shows the custom jars from the provider directory.

xgp commented 2 years ago

This does not work with the admin-cli