Cumulocity-IoT / cumulocity-devicemanagement-agent

Cumulocity Reference Agent written in Python to demonstrate most of the Device Management Capabilities of Cumulocity IoT
Apache License 2.0
26 stars 20 forks source link

Private copy of token not updated when agent.token is updated. #55

Closed TE-KarlKomierowski closed 2 years ago

TE-KarlKomierowski commented 2 years ago

https://github.com/SoftwareAG/cumulocity-devicemanagement-agent/blob/b54430ee5535bed7a4076baa847ad856bff78fcb/c8ydm/client/rest_client.py#L38

The self.token is only being set during the initialization of the class. The JWT token of the mqtt agent will be set after the RestClient has been created.

switschel commented 2 years ago

Hi @TE-KarlKomierowski,

I pushed a fix that should update the token ASAP the MQTT is connected. If a new token is retrieved from the platform it is also update within the rest_client.

Can you give it a try and provide feedback?

TE-KarlKomierowski commented 2 years ago

Hi @switschel Sorry for late reply. Yes, I will fetch it and test it out. Thanks.