Product/components used and version/fix level:
Cumulocity version 1018.0.125 (frontend) 1018.0.174 (backend)
Detailed explanation of the problem:
From the guide [Cumulocity IoT - OpenAPI Specification](Cumulocity IoT - OpenAPI Specification) I learned that encrypted option cannot be received by regular user (I tried and it returns {“self”:“https:xxxx.cumulocity.com/tenant/options/secrets/credentials.test_key”,“category”:“secrets”,“value”:“<>”,“key”:“credentials.test_key”}) but when it is sent to a microservice, the value should be decrypted.
However, when sending GET request from my microservice to retrieve the option, it returns {“message”:“Access is denied”,“error”:“security/Forbidden”,“info”:…}
Here is how I formulate the request:
def base64_credentials(tenant, user, password):
str_credentials = tenant + "/" + user + ":" + password
return 'Basic ' + base64.b64encode(str_credentials.encode()).decode()
def sample_get_token:
url = https:xxxx.cumulocity.com/tenant/options/secrets/credentials.test_key
payload = {}
headers = {
'Authorization': base64_credentials(os.getenv('C8Y_BOOTSTRAP_TENANT'), os.getenv('C8Y_BOOTSTRAP_USER'), os.getenv('C8Y_BOOTSTRAP_PASSWORD'))
}
response = requests.request("GET", url, headers=headers, data=payload)
private_key = json.loads(response.text)["value"]
Error messages / full error message screenshot / log file:
KeyError, as response == {“message”:“Access is denied”,“error”:“security/Forbidden”,“info”:…}
Question related to a free trial, or to a production (customer) instance?
This is a production instance