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

User update without groups deletes previously set groups from user #1132

Open
juthilo opened this issue Sep 16, 2024 · 0 comments
Open

User update without groups deletes previously set groups from user #1132

juthilo opened this issue Sep 16, 2024 · 0 comments
Labels

Comments

@juthilo
Copy link

juthilo commented Sep 16, 2024

Current Behavior

When I include an existing user in my import file and don't list any groups, the CLI removes all of the previously set groups for that user.

Expected Behavior

For lower levels as well, the CLI should only update and delete resources or attributes if a certain key is set at all. I.e., if no groups key is set on a user, the import should leave the existing user's groups untouched.

(This assumption according to the behavior listed in docs/MANAGED.md )

Steps To Reproduce

1. Create a user `user@example.com`.
2. Add the user to the import file, leave out groups key
3. Run import
4. Groups will be deleted even though no groups key was present:

Environment

  • Keycloak Version: 25.0.2
  • keycloak-config-cli Version: v6.1.5
  • Java Version: 21

Anything else?

Example user yaml without groups:

- username: user@example.com
 enabled: true
 emailVerified: true
 firstName: User
 lastName: Example
 email: user@example.com
 realmRoles:
   - ...

Example log statements showing deletion of previously assigned group:

No need to update user 'user@example.com' in realm 'realm'
Remove groups [/xyz] from user 'user@example.com' in realm 'realm'
@juthilo juthilo added the bug label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

1 participant