diff --git a/microservices/gatewayApi/clients/uma/resourceset.py b/microservices/gatewayApi/clients/uma/resourceset.py index 8e72a43c..e65a6d2a 100644 --- a/microservices/gatewayApi/clients/uma/resourceset.py +++ b/microservices/gatewayApi/clients/uma/resourceset.py @@ -98,7 +98,7 @@ def map_res_name_to_id (pat_token, name): log = app.logger - tokenUrl = "%srealms/%s/authz/protection/resource_set?exactName=true&name=%s" % (conf['serverUrl'],conf['realm'], name) + tokenUrl = "%srealms/%s/authz/protection/resource_set?name=%s&deep=true" % (conf['serverUrl'],conf['realm'], name) headers = { "Authorization": "Bearer %s" % pat_token, @@ -111,7 +111,7 @@ def map_res_name_to_id (pat_token, name): log.debug("[map_res_name_to_id] %s" % r.status_code) json = r.json() log.debug("[map_res_name_to_id] %s" % json) - if len(json) == 0: + if len(json) == 0 or name != json[0]['name']: return None else: - return json[0] + return json[0]['_id']