Browse Source

Merge pull request #150 from MatrixCrawler/master

add function to update a client-scope
master
Marcos Pereira 3 years ago
committed by GitHub
parent
commit
7fd8321688
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      keycloak/keycloak_admin.py

16
keycloak/keycloak_admin.py

@ -1496,6 +1496,22 @@ class KeycloakAdmin:
data=json.dumps(payload))
return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[201], skip_exists=skip_exists)
def update_client_scope(self, client_scope_id, payload):
"""
Update a client scope
ClientScopeRepresentation: https://www.keycloak.org/docs-api/8.0/rest-api/index.html#_client_scopes_resource
:param client_scope_id: The id of the client scope
:param payload: ClientScopeRepresentation
:return: Keycloak server response (ClientScopeRepresentation)
"""
params_path = {"realm-name": self.realm_name, "scope-id": client_scope_id}
data_raw = self.raw_put(URL_ADMIN_CLIENT_SCOPE.format(**params_path),
data=json.dumps(payload))
return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204])
def add_mapper_to_client_scope(self, client_scope_id, payload):
"""
Add a mapper to a client scope

Loading…
Cancel
Save