esp-idf-mqtt-broker icon indicating copy to clipboard operation
esp-idf-mqtt-broker copied to clipboard

is it possible to create username and password for clients?

Open jbsaibes opened this issue 1 year ago • 7 comments

i was wondering if it is possible to assign a username/password for clients that would connect to the broker?

jbsaibes avatar Aug 24 '24 20:08 jbsaibes

This is a good idea. Try latest. config-8

nopnop2002 avatar Aug 25 '24 05:08 nopnop2002

yes i just tried and it works thanks! next request :) two nice features to have :

  1. having a list of clients ( cid, user and password) that broker can use for authentication
  2. having list of topics that above clients can subscribe/publish to

jbsaibes avatar Aug 25 '24 09:08 jbsaibes

Are there any open source brokers with this kind of functionality?

If there is one, I would like to imitate its implementation and settings..

There are no plans to implement unique access restrictions specific to this broker.

nopnop2002 avatar Aug 25 '24 10:08 nopnop2002

yes there is https://github.com/eclipse/mosquitto it one of the most popular mqtt brokers

jbsaibes avatar Aug 25 '24 10:08 jbsaibes

I'm using Mosquito, but I don't know the settings to achieve this.

In mosquitto, what settings do I need to do to achieve this?

having a list of clients ( cid, user and password) that broker can use for authentication
having list of topics that above clients can subscribe/publish to

nopnop2002 avatar Aug 25 '24 10:08 nopnop2002

https://mosquitto.org/man/mosquitto-conf-5.html check general options>acl file option and "password_file" option .there is a description there.

jbsaibes avatar Aug 25 '24 10:08 jbsaibes

Thank you for the information. I'll try to investigate, but it will take some time.

If we use a password file, we will need a file system like SPIFFS.

nopnop2002 avatar Aug 25 '24 10:08 nopnop2002