marcospereirampj / python-keycloak

MIT License
692 stars 296 forks source link

How to delete user's custom attributes #553

Open chung1912 opened 3 months ago

chung1912 commented 3 months ago

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 commented 1 month ago

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.