moscajs / aedes

Barebone MQTT broker that can run on any stream server, the node way
MIT License
1.75k stars 228 forks source link

[question] Any way to add data to connect packet and authorize handler? #945

Closed zg009 closed 3 months ago

zg009 commented 3 months ago

Hello, is there a way for the auth handler to get extra information that would be sent besides username and password? It is not a big deal to do it myself, but would like pointers on where to start

robertsLando commented 3 months ago

Hello, is there a way for the auth handler to get extra information that would be sent besides username and password?

You can fetch some informations in preConnect handler and then store them on client object so you can access them later on authorize. See example here: https://github.com/moscajs/aedes-protocol-decoder

zg009 commented 3 months ago

@robertsLando Thank you!