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

enable_user & disable_user broken since keycloak 24? #579

Open
thomas-riccardi opened this issue Jul 11, 2024 · 1 comment
Open

enable_user & disable_user broken since keycloak 24? #579

thomas-riccardi opened this issue Jul 11, 2024 · 1 comment

Comments

@thomas-riccardi
Copy link

In the 24.0.5 upgrade doc it is said:

Partial update to user attributes when updating users through the Admin User API is no longer supported

The code for enable_user & disable_user calls update_user with a partial payload:

def disable_user(self, user_id):
"""Disable the user from the realm. Disabled users can not log in.
:param user_id: User id
:type user_id: str
:return: Http response
:rtype: bytes
"""
return self.update_user(user_id=user_id, payload={"enabled": False})
def enable_user(self, user_id):
"""Enable the user from the realm.
:param user_id: User id
:type user_id: str
:return: Http response
:rtype: bytes
"""
return self.update_user(user_id=user_id, payload={"enabled": True})

=> it seems it would lose other user attribtes.

I have not tested though.

here they recommend to get full user, and patch object, and send back the full object

@thomas-riccardi
Copy link
Author

I could not reproduce the issue.. is the upgrade doc correct?

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

No branches or pull requests

1 participant