Skip to content

Commit 1c03f1a

Browse files
author
Andreas Bleuler
committed
Add update method for clients
1 parent f9eb637 commit 1c03f1a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

keycloak/keycloak_admin.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,20 @@ def create_client(self, payload, skip_exists=False):
685685
data=json.dumps(payload))
686686
return raise_error_from_response(data_raw, KeycloakGetError, expected_code=201, skip_exists=skip_exists)
687687

688+
def update_client(self, client_id, payload):
689+
"""
690+
Update a client
691+
692+
:param client_id: Client id
693+
:param payload: ClientRepresentation
694+
695+
:return: Http response
696+
"""
697+
params_path = {"realm-name": self.realm_name, "id": client_id}
698+
data_raw = self.connection.raw_put(URL_ADMIN_CLIENT.format(**params_path),
699+
data=json.dumps(payload))
700+
return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204)
701+
688702
def delete_client(self, client_id):
689703
"""
690704
Get representation of the client

0 commit comments

Comments
 (0)