Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle exception in java client when token is expired #62

Open
visit24ir opened this issue Mar 9, 2019 · 0 comments
Open

Handle exception in java client when token is expired #62

visit24ir opened this issue Mar 9, 2019 · 0 comments
Assignees

Comments

@visit24ir
Copy link

visit24ir commented Mar 9, 2019

Is there a clear way to handle exceptions when jwt token is expired ?

In javascript client such as mqtt.js , when i send expired token to password field in connect method, offline method is called.In Java though, there is a package called: Eclipse Paho 'connectionLost' event is called.here is the thing :

By and large, there is not an appropriate way to handle token expiration exception in clients.
connection lost event could occure everywhere and every time, not just in token expiration
for instance : when mqtt server is offline or when s.th happend to connection. so there is not a transparent way to handle this.
1. What happens in backend side when an expired token is sent in password field ?
2. What event should be called in client side ?
3. How do detect in clients that emqx server denies the connection because there is an expired jwt token ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants