Hello
I'm trying to generate a short url using the REST api, and trying to authenticate using an API key i've generated before, no matter which cluster roles or indices priviliges I specify in the API key generation, I keep getting the error -
{
"statusCode": 403,
"error": "Forbidden",
"message": "Unable to create url"
}
I'm using Elastic 7.8.1.
How I generated the API Key -
POST /_security/api_key
{
"name": "kfir-url-shorten",
"expiration": "1d",
"role_descriptors": {
"role-a": {
"cluster": ["all"],
"indices": [
{
"names": ["*"],
"privileges": ["all"]
}
]
}
}
}
My http request -
url = "<elastic cluter>:<port>/api/shorten_url"
payload = "{'url':'<some long url here>'}"
headers = {
'Authorization': "ApiKey <my base64 api key>",
'Content-Type': "application/json",
'kbn-xsrf': "true"
}
response = requests.request("POST", url, data=payload, headers=headers)
Not sure what other permissions I can give or even if this is possible using an API key..
Hope someone encountered this and can help me
thanks!