PATCH user attributes via REST API

519 views
Skip to first unread message

Nelson Teixeira

unread,
Apr 13, 2023, 5:10:30 AM4/13/23
to Keycloak User
Hello there,

I am using Keycloak docker image 21.0.2 (the latest one).

I make a PUT request to this URL : http://localhost:8080/admin/realms/custom-realm/users/14905db1-5229-4110-bfbb-df13845a4f52 and with this JSON body : { "attributes": { "organization_id": "1" } }, to edit a user's attributes. The problem is that this wipes out all user attributes and i want it to keep the old ones as they are used for other functionnalities and cannot be wiped out. I just want to append or replace 'organization_id' value in the list of user attributes.
I think it should be a PATCH request but Keycloak doesn't have one for users. Is there any way to make this work ?

Thanks for your help.

Schuster Sebastian (BD/PAU1)

unread,
Apr 17, 2023, 4:45:07 AM4/17/23
to Nelson Teixeira, Keycloak User

Currently, all you can do is read the old values, perform your update and write the complete updated value back.

 

Best regards,

Sebastian

 

Mit freundlichen Grüßen / Best regards

Dr.-Ing. Sebastian Schuster
 

Product Area User Management (BD/PAU1)
Bosch.IO GmbH | Ullsteinstr. 128 | 12109 Berlin | GERMANY | www.bosch.io
Tel. +49 30 726112-485 | Mobil +49 152 02177668 | Telefax +49 30 726112-100Sebastian...@bosch.io


Sitz: Berlin, Registergericht: Amtsgericht Charlottenburg; HRB 148411 B
Aufsichtsratsvorsitzender: Stefan Koss; Geschäftsführung: Dr. Andreas Nauerz, Stephan Lampel 

--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/09367151-1763-4440-8308-3a0654e5c325n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages