The MQTT V3 client allows for an authentication property as part of the connect message. This property consists of a user ID and password. There is no size limitation. The connection will fail if the user is not authenticated successfully or is not authorized to connect.
For MQTT V3, use the following:
MqttProperties props = new MqttProperties();
MqttClient client = clientFactory.createMqttClient("MyClient", "tcp://localhost:1883", props);
For the MQTT V3 C client, use the following:
opts.username = "fred";
opts.password = "secret";
Parent topic: Micro broker clients: XPD621