2

I have a MQTT client that sends a CONNECT packet the the MQTT broker with username and password. Now if the client is not authorized to connect, the broker is going to close the connection. How can the MQTT broker tell the client that the reason for closing the connection is that its not authorized? The CONNACK packet does not allow any payloads.

Thanks!

user3266083
  • 103
  • 3
  • 12

1 Answers1

2

It would return a CONNACK packet with the Connect Return code set to 5. This is described in section 3.2.2.3 of the MQTT v3.1.1 spec.

http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718033

ralight
  • 11,033
  • 3
  • 49
  • 59