zoukankan      html  css  js  c++  java
  • 安装 emqx 4.3.5 版本,并启动http 认证和授权,获取动态订阅topic

    一、安装emqx 4.3.5

    安装前,请确保 erlang 版本号 11.1.8

    配置文件修改

    1、 acl.conf 屏蔽所有权限

    ##{allow, {user, "dashboard"}, subscribe, ["$SYS/#"]}.
    ##{allow, {ipaddr, "127.0.0.1"}, pubsub, ["$SYS/#", "#"]}.
    ##{deny, all, subscribe, ["$SYS/#", {eq, "#"}]}.
    ##{allow, all}.
    

    2、emqx.conf 配置文件修改,
    修改acl 权限,
    增加删除ACL缓存项的时间

    allow_anonymous = false
    acl_nomatch = deny
    acl_cache_ttl = 5m 
    

    3、emqx_auth_http.conf 配置文件修改
    修改 auth_req 地址和参数
    屏蔽超管super_req配置
    修改 acl_req 地址和参数

    auth.http.auth_req.url = http://${iot-auth-url:port}/iot/auth/authentication
    auth.http.auth_req.params = clientId=%c,userName=%u,ipAddress=%a,passWord=%P
    ## auth.http.super_req.url = http://127.0.0.1:80/mqtt/superuser
    ## auth.http.super_req.method = post
    ## auth.http.super_req.headers.content-type = application/x-www-form-urlencoded
    ## auth.http.super_req.params = clientid=%c,username=%u
    auth.http.acl_req.url = http://${iot-auth-url:port}/iot/auth/authorization
    auth.http.acl_req.params = access=%A,username=%u,clientid=%c,ipaddr=%a,topic=%t
    

    4、emqx_proxy_subscribe.conf 配置文件修改

    proxy.http.url = http://${iot-auth-url:port}/iot/auth/listSubscribeTopic
    

    启动插件

    # ./bin/emqx start
    # ./bin/emqx_ctl plugins load emqx_auth_http
    # ./bin/emqx_ctl plugins load emqx_proxy_subscribe
    
  • 相关阅读:
    linux 文件时间
    linux命令学习 touch
    linux命令学习 cp
    Linux命令学习 mv
    SpringMVC mvc详解
    JDBC原生态代码
    java中静态方法中调用非静态方法的详解
    Spring技术详解
    Spring中的 BeanFactory和 ApplicationContext的区别与解释
    java多线程编程相关技术
  • 原文地址:https://www.cnblogs.com/wgy1/p/15021336.html
Copyright © 2011-2022 走看看