024-09-14T09:57:17.932967+08:00 [warning] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59066 msg: authentication_failure, reason: bad_username_or_password, tag: AUTHN, username: 222
2024-09-14T09:57:17.932994+08:00 [WS-MQTT] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59066 msg: mqtt_packet_sent, packet: CONNACK(Q0, R0, D0, AckFlags=0, ReasonCode=134), username: 222
2024-09-14T09:57:17.933073+08:00 [SOCKET] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59066 msg: websocket_terminated, reason: {shutdown,bad_username_or_password}, username: 222
2024-09-14T09:57:18.957693+08:00 [MQTT] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59068 msg: mqtt_packet_received, packet: CONNECT(Q0, R0, D0, ClientId=a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668, ProtoName=MQTT, ProtoVsn=5, CleanStart=true, KeepAlive=60, Username=222, Password=******), username: 222
2024-09-14T09:57:18.957908+08:00 [AUTHN] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59068 msg: invalid_jwt_claims, claims: {<<“exp”>>,1726278976}, jwt: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE3MjYyNzg5NzIsImV4cCI6MTcyNjI3ODk3NiwiaWF0IjoxNzI2Mjc4OTcyfQ.OxeG8eR0fJ9KUb8_bYotPt855KArczwuhsn0L67riJg, provider: emqx_authn_jwt, username: 222
2024-09-14T09:57:18.957948+08:00 [AUTHN] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59068 msg: authenticator_result, authenticator: jwt, result: {error,bad_username_or_password}, username: 222
2024-09-14T09:57:18.957982+08:00 [AUTHN] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59068 msg: authentication_result, reason: chain_result, result: {stop,{error,bad_username_or_password}}, username: 222
请关注这一行日志
2024-09-14T09:57:18.957908+08:00 [AUTHN] a1559e7c-8dd8-4780-b952-100cc4797da2-1726277815668@1.85.30.162:59068 msg: invalid_jwt_claims, claims: {<<“exp”>>,1726278976}, jwt: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYmYiOjE3MjYyNzg5NzIsImV4cCI6MTcyNjI3ODk3NiwiaWF0IjoxNzI2Mjc4OTcyfQ.OxeG8eR0fJ9KUb8_bYotPt855KArczwuhsn0L67riJg, provider: emqx_authn_jwt, username: 222
时间戳 1726278976 转换为可读时间为 Saturday, September 14, 2024 9:56:16 AM [GMT+08:00]
,但这条日志的时间为 2024-09-14T09:57:18.957908
,已经迟于 jwt 中携带的 exp 字段,意为该 jwt 在被 EMQX 解析时已经过期。