Browse Source

Modified update_client & create_realm_role to use keycloak_admin raw_put/post

Modified update_client & create_realm_role to use the keycloak_admin raw_put/post instead of the connection's raw_put/post directly to allow for token refresh
master
Shady Nawara 5 years ago
committed by GitHub
parent
commit
4f7069b675
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      keycloak/keycloak_admin.py

4
keycloak/keycloak_admin.py

@ -775,7 +775,7 @@ class KeycloakAdmin:
:return: Http response :return: Http response
""" """
params_path = {"realm-name": self.realm_name, "id": client_id} params_path = {"realm-name": self.realm_name, "id": client_id}
data_raw = self.connection.raw_put(URL_ADMIN_CLIENT.format(**params_path),
data_raw = self.raw_put(URL_ADMIN_CLIENT.format(**params_path),
data=json.dumps(payload)) data=json.dumps(payload))
return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204)
@ -917,7 +917,7 @@ class KeycloakAdmin:
""" """
params_path = {"realm-name": self.realm_name} params_path = {"realm-name": self.realm_name}
data_raw = self.connection.raw_post(URL_ADMIN_REALM_ROLES.format(**params_path),
data_raw = self.raw_post(URL_ADMIN_REALM_ROLES.format(**params_path),
data=json.dumps(payload)) data=json.dumps(payload))
return raise_error_from_response(data_raw, KeycloakGetError, expected_code=201, skip_exists=skip_exists) return raise_error_from_response(data_raw, KeycloakGetError, expected_code=201, skip_exists=skip_exists)

Loading…
Cancel
Save