The dynamic security plugin can be used instead of the password file and the ACL (Access Control list) . Mosquitto Username and Password Authentication -Configuration and Testing Mosquitto ACL -Configuring and Testing MQTT Topic Restrictions The plugin is available in mosquitto v2 but it is not enabled by default.
Continue reading