Skip to main content
Version: 0.13.1

Token

How to retrieve a JWT (JSON Web Token) to authenticate on Cumulocity​

Overview​

In order to authenticate HTTP requests on Cumulocity, a device can retrieve a token using MQTT.

Retrieving the token​

Follow the below steps in order to retrieve the token from the Cumulocity cloud using MQTT.

  1. Subscribe to token topic

    tedge mqtt sub 'c8y/s/dat'
  2. Publish an empty message on c8y/s/uat topic

    tedge mqtt pub 'c8y/s/uat' ''
  3. After a while the token will be published on the subscribed topic c8y/s/dat in the below format

    71,${Base64 encoded JWT}