You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an import file contains groups with IDs, the exception "Create method returned status Not Found (Code: 404); expected status: Created (201)" will be raised.
Expected Behavior
Since I have other fields on the import file with the field "id" defined (e.g. realm, roles, ...), I would also expect that keycloak-config-cli created groups that have the id field defined.
Steps To Reproduce
1. Perform an export on an existing installation
2. On another and clean installation, without making any changes to the resulting file, I ran the command `java -jar keycloak-config-cli-20.0.1.jar --keycloak.url=http://localhost:8080 --keycloak.user=**** --keycloak.password=**** --keycloak.availability-check.enabled=true --spring.profiles.active=dev --import.cache.enabled=false --import.files.locations=./import_files/realm-export-without-ids.json`3. Exception will be raised when it starts to import groups
I'm working on the deployment automation using ansible and if keycloak-config-cli allowed ids on groups, I could save the target group's id in an ansible variable and then use that variable to build the environment file of the API component and also build keycloak's import file. (build = use ansible's template files)
My workaround now is to query our database with a query like SELECT keycloak_group.id FROM keycloak_group JOIN realm ON keycloak_group.realm_id = realm.id WHERE realm.name = '{{ realm }}' and keycloak_group.name = {{ target_group }}
The text was updated successfully, but these errors were encountered:
Did some digging and this behavior is actually happening on keycloak's API, so keycloak-config-cli doesn't have much control over this.
Our workaround is to whenever we want to interact with groups, we first make a request to the /{realm}/groups endpoint, get the id, and then execute whatever request that requires the id of the groups (e.g. /{realm}/groups/{id}/management/permissions)
Current Behavior
If an import file contains groups with IDs, the exception "Create method returned status Not Found (Code: 404); expected status: Created (201)" will be raised.
Expected Behavior
Since I have other fields on the import file with the field "id" defined (e.g. realm, roles, ...), I would also expect that keycloak-config-cli created groups that have the id field defined.
Steps To Reproduce
Environment
Anything else?
Why is it useful to me to have ids in groups?
On our stack, we have an API component that will query keycloak to know the members of a specific group using the following keycloak's endpoint (https://documenter.getpostman.com/view/7294517/SzmfZHnd#7d80a062-6b07-4ea5-9ddd-14fb3957af33). To specify the target group, the id of such group is needed.
I'm working on the deployment automation using ansible and if keycloak-config-cli allowed ids on groups, I could save the target group's id in an ansible variable and then use that variable to build the environment file of the API component and also build keycloak's import file. (build = use ansible's template files)
My workaround now is to query our database with a query like
SELECT keycloak_group.id FROM keycloak_group JOIN realm ON keycloak_group.realm_id = realm.id WHERE realm.name = '{{ realm }}' and keycloak_group.name = {{ target_group }}
The text was updated successfully, but these errors were encountered: