Closed lme-atolcd closed 1 year ago
FYI, a commit implementing the proposed solution is available. https://github.com/lme-atolcd/keycloak-config-cli/commit/931cae9848c67a3b0e633019284ff59d3d974ee6
If the proposed solution is accepted, I can create a pull request.
Problem Statement
The current behaviour of the User Declarative Profile import allows to only import attributes. I would like to also import attributes groups, but it doesn't seem possible with keycloak-config-cli 5.6.1.
https://github.com/adorsys/keycloak-config-cli/blob/v5.6.1/src/main/java/de/adorsys/keycloak/config/service/UserProfileImportService.java#L67
Proposed Solution
It should be possible to import a complete json User profile (the same json used in the Keycloak admin console, in "Realm setting > User profile > JSON editor") by not puting the result of
realmImport.getUserProfile();
inuserProfile.put("attributes", userProfileAttributes);
. But insteed use the result ofrealmImport.getUserProfile();
verbatim inJsonUtil.toJson(...)
.Before:
After:
This change allows direct copy/paste between the json import file used by keycloak-config-cli and the Keycloak realm admin console.
Environment
Additional information
No response
Acceptance Criteria
No response