Cumulocity-IoT / cumulocity-python-api

Python client for the Cumulocity REST API. Created by Global Competency Center IoT
Apache License 2.0
18 stars 13 forks source link

SimpleCumulocityApp default auth not working then running as microservice on C8Y #25

Closed freke closed 1 year ago

freke commented 1 year ago

Then SimpleCumulocityApp without using "get_user_instance" and just use the SimpleCumulocityApp directly will get a 401 then runing as a microservice on C8Y, if running as a local docker container the same call works. The python api is only using the C8Y_USER and C8Y_PASSWORD and that works localy but then deployed the C8Y_TENANT is also needed for the username the call should be: auth=HTTPBasicAuth(f'{C8Y_TENANT}/{C8Y_USER}', f'{C8Y_PASSWORD}') in the SimpleCumulocityApp init function altrnatively not set the Auth value at all, since it is set correctly in the CumulocityRestApi init function.

chisou commented 1 year ago

Fixed in version 1.4