Hello everyone,
I’m using VMQ Diversity to authenticate username/password and ACL with the MySQL database. Now I want to improve authentication with the auth_on_register webhook. This allows me to enter the token in the password field and verify it via the webhook. If the password is a token, it is verified, otherwise, I simply return result=“next” for the old way of authentication. I want to continue using the ACL via MySQL. Therefore, I haven’t implemented auth_on_subscribe or auth_on_publish.
Now I can register the user with the token in the password as expected. However, I can’t subscribe to or publish topics defined in my MSSQL table. With the normal password, everything works as before. Does anyone have any ideas? Thanks for the help.
DOCKER_VERNEMQ_SWARM: 1
DOCKER_VERNEMQ_ACCEPT_EULA: ‘yes’
DOCKER_VERNEMQ_LISTENER__TCP__LOCALHOST: ‘0.0.0.0:1883’
DOCKER_VERNEMQ_LISTENER__TCP__DEFAULT: ‘0.0.0.0:1883’
DOCKER_VERNEMQ_LISTENER__SSL__USE_IDENTITY_AS_USERNAME: ‘on’
DOCKER_VERNEMQ_LISTENER__SSL__DEFAULT: ‘0.0.0.0:8883’
DOCKER_VERNEMQ_LISTENER__SSL__CAFILE: ‘/etc/ssl/vernemq/cacert.crt’
DOCKER_VERNEMQ_LISTENER__SSL__CERTFILE: ‘/etc/ssl/vernemq/server.crt’
DOCKER_VERNEMQ_LISTENER__SSL__KEYFILE: ‘/etc/ssl/vernemq/server.key’
DOCKER_VERNEMQ_PLUGINS__VMQ_WEBHOOKS: ‘on’
DOCKER_VERNEMQ_PLUGINS__VMQ_WEBHOOKS__PRIORITY: ‘5’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__WEBHOOK1__HOOK: ‘auth_on_register’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__WEBHOOK1__ENDPOINT: ‘http://localhost:4444/mqtt/auth’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__WEBHOOK2__HOOK: ‘auth_on_register_m5’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__WEBHOOK2__ENDPOINT: ‘http://localhost:4444/mqtt/auth’
DOCKER_VERNEMQ_PLUGINS__VMQ_DIVERSITY: ‘on’
DOCKER_VERNEMQ_PLUGINS__VMQ_DIVERSITY__PRIORITY: ‘10’
DOCKER_VERNEMQ_PLUGINS__VMQ_PASSWD: ‘off’
DOCKER_VERNEMQ_PLUGINS__VMQ_ACL: ‘off’
DOCKER_VERNEMQ_VMQ_DIVERSITY__AUTH_MYSQL__ENABLED: ‘on’
DOCKER_VERNEMQ_VMQ_DIVERSITY__MYSQL__PASSWORD_HASH_METHOD: ‘password’
DOCKER_VERNEMQ_VMQ_DIVERSITY__MYSQL__HOST: ‘localhost’
DOCKER_VERNEMQ_VMQ_DIVERSITY__MYSQL__PORT: ‘3306’
DOCKER_VERNEMQ_VMQ_DIVERSITY__MYSQL__USER: ‘mqtt’
DOCKER_VERNEMQ_VMQ_DIVERSITY__MYSQL__PASSWORD: ‘test’
DOCKER_VERNEMQ_VMQ_DIVERSITY__MYSQL__DATABASE: ‘mqtt’
DOCKER_VERNEMQ_LOG__CONSOLE: ‘console’
DOCKER_VERNEMQ_LOG__CONSOLE__LEVEL: ‘info’
DOCKER_VERNEMQ_ALLOW_REGISTER_DURING_NETSPLIT: ‘on’
DOCKER_VERNEMQ_ALLOW_PUBLISH_DURING_NETSPLIT: ‘on’
DOCKER_VERNEMQ_ALLOW_SUBSCRIBE_DURING_NETSPLIT: ‘on’
DOCKER_VERNEMQ_ALLOW_UNSUBSCRIBE_DURING_NETSPLIT: ‘on’