Hi there
I have a mqtt server with auth plugin enabled.
Almost everything works fine, only topics wildcards can’t deliver messages. And I’m trying to make it working before implement it on Lora App Server.
I’m using MongoDB as backend with this collection:
{
"_id" : ObjectId("5d696b3a23bb5613fea4c2c0"),
"username" : "user1",
"password" : "PBKDF2$sha256$901$jvmyoNAi2GYOELnS$8syPnDylOIpxInBlL14GOLbyAnFHI1bl",
"superuser" : false,
"topics" : {
"article/#" : "rw"
}
}
Subscribing:
mosquitto_sub -h mqtt.myserver.com -t "article/#" -u user1 -P 123
Publishing:
mosquitto_pub -h mqtt.myserver.com -t "article/1" -m "testing..." -u user1 -P 123
Or
mosquitto_pub -h mqtt.myserver.com -t "article" -m "testing..." -u user1 -P 123
this is the plugin log:
-- mosquitto_auth_unpwd_check(user1)
-- ** checking backend mongo
-- getuser(user1) AUTHENTICATED=1 by mongo
-- mosquitto_auth_acl_check(..., client id not available, user1, article/1, MOSQ_ACL_WRITE)
-- aclcheck(user1, article/1/comments, 2) trying to acl with mongo
-- aclcheck(user1, article/1/comments, 2) AUTHORIZED=1 by mongo
-- Cached [C909F3664285F35139ED8836043853B5C5F70616] for (client id not available,user1,2)
In any case, when I subscribe to wildcard topics, I can’t get any messages.
However, without wildcards it works perfectly.
Tested before enabling the plugin, Mosquitto works perfectly, which leads me to debug only the plugin and its particularities.
****** EDIT 1 *******
The problem occurs only when Mosquitto is compiled with WITH_WEBSOCKETS=yes otherwise it works.
If WITH_WEBSOCKETS=yes and WebSockets not configured in conf file, wildcard doesn’t work at all, only MOSQ_ACL_WRITE appears on log.
If WITH_WEBSOCKETS=yes and WebSockets configured in conf file, it does work but with certain intermittence and a HUGE delay publishing and receiving the message.
What am I missing with the WebSockets configuration ?
Any help appreciated.