错误报告
环境
- EMQX 版本:开源版V4.4
- 操作系统版本:centos 7
重现此问题的步骤
- 左边菜单栏选择插件
- 启动emqx_auth_jwt
- 管理emqx_auth_jwt
4.随便输入秘钥,输入用户名和clienId
5.点击生成 ,提示错误信息:CryptoKey is not defined
预期行为
生成成功
实际行为
提示错误信息
生成成功
提示错误信息
方便提供你的详细版本号和生成 JWT 的配置吗?
emqx/emqx 4.4.14
配置文件:
##--------------------------------------------------------------------
## JWT Auth Plugin
##--------------------------------------------------------------------
## HMAC Hash Secret.
##
## Value: String
auth.jwt.secret = emqxsecret
## RSA or ECDSA public key file.
##
## Value: File
#auth.jwt.pubkey = etc/certs/jwt_public_key.pem
## The JWKs server address
##
## see: http://self-issued.info/docs/draft-ietf-jose-json-web-key.html
##
#auth.jwt.jwks = https://127.0.0.1:8080/jwks
## The JWKs refresh interval
##
## Value: Duration
#auth.jwt.jwks.refresh_interval = 5m
## From where the JWT string can be got
##
## Value: username | password
## Default: password
auth.jwt.from = password
## Enable to verify claims fields
##
## Value: on | off
auth.jwt.verify_claims = on
## The checklist of claims to validate
##
## Configuration format: auth.jwt.verify_claims.$name = $expected
## - $name: the name of the field in the JWT payload to be verified
## - $expected: the expected value
##
## The available placeholders for $expected:
## - %u: username
## - %c: clientid
##
## For example, to verify that the username in the JWT payload is the same
## as the client (MQTT protocol) username
auth.jwt.verify_claims.username = %u
## Name of the claim containg ACL rules
##
## Value: String
#auth.jwt.acl_claim_name = acl
dashboard配置页面
EMQX服务的日志:
2023-02-08T16:16:03.318947178Z 2023-02-08T16:16:03.318246+00:00 [error] 152.32.191.131:47190 [MQTT] , Parse failed for function_clause, [{emqx_frame,parse_packet,[{mqtt_packet_header,4,false,3,true},<<"T / HTTP/1.1\r\nUser-Agent: curl/7.29.0\r\nHost: 123.249.38.211\r\nAccept: ">>,#{max_size => 1048576,strict_mode => false,version => 4}],[{file,“emqx_frame.erl”},{line,222}]},{emqx_frame,parse_frame,4,[{file,“emqx_frame.erl”},{line,199}]},{emqx_connection,parse_incoming,3,[{file,“emqx_connection.erl”},{line,649}]},{emqx_connection,handle_msg,2,[{file,“emqx_connection.erl”},{line,642}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,388}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,352}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,236}]}], Frame data:<<“GET / HTTP/1.1\r\nUser-Agent: curl/7.29.0\r\nHost: 123.249.38.211\r\nAccept: /\r\n\r\n”>>
你好,我们已经确认了,这是 Dashboard 的一个 Bug 导致的,我们会尽快修复。在此之前,你可以用上面提到的工具来生成 JWT。
等修复完成,我会在这里和你同步。
bug修复好了吧,是不是需要重新拉取镜像
你好,最新版本中已经修复,可以升级一下。
升级到EMQX5.0吗,JAVA客户端代码会不会有影响
啊没有,4.4 的最新版本就行。