Reputation: 10502
Does java paho provide any callback when a new client connect to a broker. I want to use this callback to do custom authentication. Everytime a client connect i will read the username & password and some other info to authenticate. If all good then it should be connected else declined.
Upvotes: 0
Views: 447
Reputation: 59816
No, the Paho Java client does not provide a "on connected" callback. The list of available callbacks is documented here
But by the time any "connected" callback would be called on the client it would be too late to do any authentication as it would already have been completed on the broker.
A number of brokers have plugin interfaces to extend their built in Authentication/Authorisation mechanisms. E.g. Mosquitto has this interface which has been used to build this plugin
Upvotes: 1