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

How to delete user's custom attributes #553

Open
chung1912 opened this issue Apr 16, 2024 · 1 comment
Open

How to delete user's custom attributes #553

chung1912 opened this issue Apr 16, 2024 · 1 comment

Comments

@chung1912
Copy link

chung1912 commented Apr 16, 2024

I know the way to update user's custom attributes is as follows:
response = keycloak_admin.update_user(user_id="user-id-keycloak", payload={ 'attributes':{'birthdate':'14-03-2000'}})

How to delete user's custom attributes?

@sebix
Copy link

sebix commented Jun 9, 2024

I know the way to update user's custom attributes is as follows: response = keycloak_admin.update_user(user_id="user-id-keycloak", payload={ 'attributes':{'birthdate':'14-03-2000'}})

How to delete user's custom attributes?

Just omit them from the payload. The update_user method overwrites all previous attributes, so only the ones you are setting explicitly will be saved.

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

2 participants