eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.1k stars 880 forks source link

MQTT5 Client unable to send AUTH requests to establish a connection #981

Open mbuckton opened 1 year ago

mbuckton commented 1 year ago

Please fill out the form below before submitting, thank you!

During client connection establishment the only message allowed from the client is the CONNECT request. With MQTT 5 the AUTH message is also allowed to be sent. In fact it must be sent to finish authorizing the connection being established.

The fix ( see patch attached ) is to check that the message is either a CONNECT or an AUTH message and then allow the client to send it.

I also attach a simple test to highlight the client interaction during the connection authentication, this will require a broker that supports SASL to test

SaslExampleTest.zip

auth.patch