You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use EMQ Dashboard tools(Websocket) to connect as [email protected] and attempt to subscribe topic out/ugroup/10918/#.
The log /opt/ramdisk/emqttd/log/erlang.log.1 shows the client can not subscribe.
Use EMQ Dashboard tools(Websocket) to re-connect as [email protected] and attempt to subscribe topic out/ugroup/10918/#. Subscribe success.
And publish topic out/ugroup/10918/device/30258/statussuccess.
There is /etc/plugins/emq_auth_mysql.conf setting:
##--------------------------------------------------------------------
## MySQL Auth/ACL Plugin
##--------------------------------------------------------------------
auth.mysql.server = <MySQL Hostname>:3306
auth.mysql.pool = 8
auth.mysql.username = <MySQL Username>
auth.mysql.password = <MySQL Password>
auth.mysql.database = mqtt
## Authentication query.
auth.mysql.auth_query = select password from mqtt_user where username = '%u' limit 1
## Password hash.
auth.mysql.password_hash = sha256
## Superuser query.
auth.mysql.super_query = select is_superuser from mqtt_user where username = '%u' limit 1
## ACL query.
auth.mysql.acl_query = select allow, ipaddr, username, clientid, access, topic from mqtt_acl where ipaddr = '%a' or username = '%u' or username = '$all' or clientid = '%c'
We have no idea why, is username within dollar sign cause?
If need more information, please tell me.
Thanks.
2019/07/08 12:18(UTF+8)
Update the mqtt topic format in table mqtt_acl at this issue.
topic format most be out/ugroup/<UserID>/<Name> or our/ugroup/<UserID>/device/<DeviceID>/<Name>.
The text was updated successfully, but these errors were encountered:
Hi, @churm6044 The emqx_auth_mysql plugin does not be check a username prefixed with the $ sign.
So, It will fallback to the default ACL rules acl.conf or mqtt.acl_nomatch option.
Hi, @churm6044 The emqx_auth_mysql plugin does not be check a username prefixed with the $ sign.
So, It will fallback to the default ACL rules acl.conf or mqtt.acl_nomatch option.
mqtt.acl_nomatch, is this option same as acl_nomatch option in /etc/emqx/emqx.config ?
Environment
Description
Use
plugins/emqx_auth_mysql
to authentication and ACL verify with MySQL Database.But
username
within dollar sign($) can't pass ACL verify.Please follow testing steps below, use username within dollar sign([email protected]) and username without dollar sign($MAIL$ [email protected]).
mqtt_user
table.mqtt_acl
table. (Use username:[email protected]
)Websocket
) to connect as[email protected]
and attempt to subscribe topicout/ugroup/10918/#
.The log
/opt/ramdisk/emqttd/log/erlang.log.1
shows the client can not subscribe.mqtt_acl
table. (Use username:[email protected]
)Websocket
) to re-connect as[email protected]
and attempt to subscribe topicout/ugroup/10918/#
. Subscribe success.And publish topic
out/ugroup/10918/device/30258/status
success.There is
/etc/plugins/emq_auth_mysql.conf
setting:We have no idea why, is username within dollar sign cause?
If need more information, please tell me.
Thanks.
2019/07/08 12:18(UTF+8)
Update the mqtt topic format in table
mqtt_acl
at this issue.topic format most be
out/ugroup/<UserID>/<Name>
orour/ugroup/<UserID>/device/<DeviceID>/<Name>
.The text was updated successfully, but these errors were encountered: