MQTT Connection – Not authorized to connect – Google IoT


When connecting to the MQTT bridge in Google Cloud Platform, an application may encounter connection error.

IoT Cloud Tester  application will return this error if  MQTT protocol is not enabled for the device registry. Also if the public key has not been uploaded to the device, MQTT connection error is returned.

In the below example, MQTT is not enabled for registry reg_702539, so MQTT connection error is returned.

To fix this error, enable MQTT for the device registry,

  • Go to Google IoT console and enable MQTT for the device registry.

  • Verify if public key has been uploaded for the device.