'Permission ticket endpoint giving 400
I am working on sharing of resources using keycloak. Some time sharing is fine but in some cases its not working. When I checked the resources in admin Console. There are some request which are waiting to be accepted or deny. Until these request are not accepted manually the endpoint will keep giving 400 and the error"Permission Already Exist" my question is why these permissions are not working automatically as it is been given in some cases.
def _owner_action_scopes(owner_token, resource_id, scope, requester, granted):
ticket_url = f"{server_internal_url}realms/{realm_name}/authz/protection/permission/ticket"
data = {"resource": resource_id,
"requester": requester,
"granted": granted,
"scopeName": scope}
headers = {}
headers["Content-Type"] = "application/json"
headers["Authorization"] = f"Bearer {token}"
headers["Host"] = kc_host
status = requests.post(ticket_url, headers=headers, data=json.dumps(data), verify=VERIFY)
return status
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
