Hello! I’m using VErneMQ 1.12.1 broker, was successfully able to setup diversity plugin for postgres and tls to connect clients.
I need to get the data of clients (username and client_id) that failed to pass authorization, or get all the data of clients that tried to pass authorization successfully or not.
I found information about webhooks in the documentation, but for auth_on_register, auth_on_subscribe, auth_on_publish hooks work interchangeably. That is, after I answer status 200, authorization through posgres does not work.
Ideally what I want is:
- The client logs in to VerneMQ.
- The hook fires, I get the client data.
3.1) If I answer status 200, then authorization continues through the diversity plugin postgres, otherwise authorization is not passed.
3.2) Or whatever I answer, the authorization continues through the deversity plugin postgres.
Example my docker environment:
DOCKER_VERNEMQ_PLUGINS__VMQ_WEBHOOKS: ‘on’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__AUTH_ON_REGISTER1__HOOK: ‘auth_on_register’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__AUTH_ON_REGISTER1__ENDPOINT: ‘http://127.0.0.1:8008/hooks/test’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__AUTH_ON_PUBLISH1__HOOK: ‘auth_on_publish’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__AUTH_ON_PUBLISH1__ENDPOINT: ‘http://127.0.0.1:8008/hooks/test’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__AUTH_ON_SUBSCRIBE1__HOOK: ‘auth_on_subscribe’
DOCKER_VERNEMQ_VMQ_WEBHOOKS__AUTH_ON_SUBSCRIBE1__ENDPOINT: ‘http://127.0.0.1:8008/hooks/test’
DOCKER_VERNEMQ_PLUGINS__VMQ_WEBHOOKS__PRIORITY: 10
DOCKER_VERNEMQ_ACCEPT_EULA: ‘yes’
DOCKER_VERNEMQ_ALLOW_ANONYMOUS: ‘off’
DOCKER_VERNEMQ_PLUGINS__VMQ_PASSWD: ‘off’
DOCKER_VERNEMQ_PLUGINS__VMQ_ACL: ‘off’
DOCKER_VERNEMQ_VMQ_ACL__ACL_RELOAD_INTERVAL: 10
DOCKER_VERNEMQ_PLUGINS__VMQ_DIVERSITY: ‘on’
DOCKER_VERNEMQ_VMQ_DIVERSITY__AUTH_POSTGRES__ENABLED: ‘on’
I will be grateful for any help!