Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote state not used for managed scopes and scopeMappings #1012

Closed
Tracked by #1178
Skg-754 opened this issue Apr 25, 2024 · 2 comments · Fixed by #1176
Closed
Tracked by #1178

Remote state not used for managed scopes and scopeMappings #1012

Skg-754 opened this issue Apr 25, 2024 · 2 comments · Fixed by #1176
Assignees
Labels

Comments

@Skg-754
Copy link

Skg-754 commented Apr 25, 2024

Current Behavior

When the environment variable IMPORT_REMOTESTATE_ENABLED=true is set, remote state is not working for "clientScopes" and "scopeMappings" resources. All "clientScopes" and "scopeMappings" which are not present in the json import files are deleted from keycloak.

Expected Behavior

When the environment variable IMPORT_REMOTESTATE_ENABLED=true, only "clientScopes" and "scopeMappings" present in the remote state and not present in the json import files should be deleted from keycloak.

Steps To Reproduce

1. Set env var IMPORT_REMOTESTATE_ENABLED=true
2. Create a ClientScope and a ScopeMapping manually in keycloak
3. Start a keycloak-config-cli with a JSON import file containing ClientScopes and ScopeMappings
4. Manually created ClientScope and ScopeMapping are deleted from keycloak.

Environment

  • Keycloak Version: 22.0.4
  • keycloak-config-cli Version: 5.9.0
  • Java Version: 17.0.8

Anything else?

No response

@Calebasah
Copy link
Collaborator

Hello @Skg-754, We encountered a compatibility issue between keycloak-config-cli:5.9.0 and Keycloak 22.0.4. Specifically, when trying to import the configuration, an UnrecognizedPropertyException error was thrown due to the features field not being recognized by the Keycloak version.
Question: Could you please confirm the exact tag of keycloak-config-cli that was used when generating the responses in the logs? It seems like there might be a compatibility issue, and we want to ensure that the correct tag is being used.

@Calebasah
Copy link
Collaborator

Calebasah commented Nov 10, 2024

Hello @Skg-754 here is the correct expected behavior

Expected Behavior:
When the environment variable IMPORT_REMOTESTATE_ENABLED=true, all resources, including "clientScopes" and "scopeMappings," that are present in the remote state should not be deleted. Instead, they should be updated with the data from the JSON import files. Only the resources that are not present in the remote state but are included in the JSON import files should be added to Keycloak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

2 participants