Browse Source

fix: use param for update client mapper

pull/327/head
Richard Nemeth 3 years ago
parent
commit
8c8c0e8141
No known key found for this signature in database GPG Key ID: 21C39470DF3DEC39
  1. 19
      src/keycloak/keycloak_admin.py

19
src/keycloak/keycloak_admin.py

@ -2343,6 +2343,23 @@ class KeycloakAdmin:
)
return raise_error_from_response(data_raw, KeycloakPutError, expected_codes=[204])
def get_mappers_from_client(self, client_id):
"""
List of all client mappers.
https://www.keycloak.org/docs-api/18.0/rest-api/index.html#_protocolmapperrepresentation
:param client_id: Client id
:returns: KeycloakServerResponse (list of ProtocolMapperRepresentation)
"""
params_path = {"realm-name": self.realm_name, "id": client_id}
data_raw = self.raw_get(
urls_patterns.URL_ADMIN_CLIENT_PROTOCOL_MAPPERS.format(**params_path)
)
return raise_error_from_response(data_raw, KeycloakPostError, expected_codes=[200])
def add_mapper_to_client(self, client_id, payload):
"""
Add a mapper to a client
@ -2373,7 +2390,7 @@ class KeycloakAdmin:
params_path = {
"realm-name": self.realm_name,
"id": self.client_id,
"id": client_id,
"protocol-mapper-id": mapper_id,
}

Loading…
Cancel
Save