Search code examples
javascriptmqttmosquittomosca

MQTT How to Create Client from Clientside?


I'm trying to create a messaging hybrid app using websocket and mqtt.

How can I create a user with username and password, no anonymous user, through the client side, with paho or mqtt.js ?

On server side I want to use mosca or mosquitto. How can I tell the server to create a client ?


Solution

  • What your looking for is client provisioning. If You're determined not to allow any anonymous connections then this is going to be impossible over pure MQTT (and even then probably not secure)

    Your best bet is to use a https endpoint to enrol a new user so username and password (or certificate) can be passed to the client securely before they try and connect to the broker.