按照官方文档配置authn-http,但是在 dashboard没有看到认证配置。是我配置有误吗?
配置如下
## NOTE:
## The EMQX configuration is prioritized (overlayed) in the following order:
## `data/configs/cluster.hocon < etc/emqx.conf < environment variables`.
node {
name = "emqx@192.168.189.211"
cookie = "emqxsecretcookie"
data_dir = "data"
}
log {
file_handlers.default {
level = debug
file = "log/emqx.log"
}
}
cluster {
name = emqxcl
discovery_strategy = manual
}
listeners.tcp.default {
bind = "0.0.0.0:1883"
max_connections = 1024000
}
listeners.ssl.default {
bind = "0.0.0.0:8883"
max_connections = 512000
ssl_options {
keyfile = "etc/certs/key.pem"
certfile = "etc/certs/cert.pem"
cacertfile = "etc/certs/cacert.pem"
}
}
listeners.ws.default {
bind = "0.0.0.0:8083"
max_connections = 1024000
websocket.mqtt_path = "/mqtt"
}
listeners.wss.default {
bind = "0.0.0.0:8084"
max_connections = 512000
websocket.mqtt_path = "/mqtt"
ssl_options {
keyfile = "etc/certs/key.pem"
certfile = "etc/certs/cert.pem"
cacertfile = "etc/certs/cacert.pem"
}
}
# listeners.quic.default {
# enabled = true
# bind = "0.0.0.0:14567"
# max_connections = 1024000
# ssl_options {
# verify = verify_none
# keyfile = "etc/certs/key.pem"
# certfile = "etc/certs/cert.pem"
# cacertfile = "etc/certs/cacert.pem"
# }
# }
dashboard {
listeners.http {
bind = 18083
}
}
authorization {
deny_action = ignore
no_match = allow
cache = { enable = true }
sources = [
{
type = file
enable = true
# This file is immutable to EMQX.
# Once new rules are created from dashboard UI or HTTP API,
# the file 'data/authz/acl.conf' is used instead of this one
path = "etc/acl.conf"
}
]
}
authn-http {
post {
method = post
mechanism = password_based
enable = true
url = "http://127.0.0.1/auth"
body {
clientid = "${clientid}"
from = "emqx5"
ipaddr = "${peerhost}"
password = "${password}"
username = "${username}"
}
headers {
"Content-Type" = "application/json"
"X-Request-Source" = "EMQX"
"accept" = "application/json"
"cache-control" = "no-cache"
"connection" = "keep-alive"
"keep-alive" = "timeout=30, max=1000"
}
}
}