emqx / emqx-auth-jwt

EMQX JWT Authentication Plugin
https://www.emqx.com
Apache License 2.0
29 stars 24 forks source link

Recheck exp claim #141

Open trezorg opened 3 years ago

trezorg commented 3 years ago

Hello, create job. How would we react on the token expiration during subscribed session? For example, we subscribed to some topic, and later within couple minutes a token would be expired. Should't we disconnect the client? I tested with the mosquitto client, like:

mosquitto_sub -C 1 -V mqttv5 -L mqtt://eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpZCI6IjEiLCJvcmciOjEsInJvbGUiOlsiYWRtaW4iLCJtYW5hZ2VyIl0sImV4cCI6MTYzMzgwNzU5NywiaWF0IjoxNjMzODA1Nzk3fQ.YKfEr4QfW8eXoy2s1XRDXAYDXcnBg_VL5j5j5lCxpLOed5o35p1P3WXuVSrH1Azyw0S4quawGMqeN-tGkuMXAsuJLiGAu_5Mp3u4FgDxNf0dlFFZFhredrdws1pOpphLruIXjtoFjsjLsPqr4VT9eo0QP7I0hdzcLLJ8UJsVjdSjOiVFcOakaSoZoa-tnK_DUlv7LKSYaviWICLCXJLaktlZrz3AD3RiErEbGAWQIlee6vfT9CiM_gKu8hZ2HO1ZmWfDFXS77YTNHZT9M3sUPpHgBgc-ZKlpfjIMWMI1svjMaFz24cyyWVEYLcWf9ymMktNw55ZcHtZyWCoUyT_lAQ@127.0.0.1:1883/sensor/1 -i 1 -q 2 -d -v -c