简体   繁体   中英

How to implement MQTT Broker side Authorization?

I have an MQTT broker where devices are connecting to it and publishing data to the broker and I have a nodejs program that helps clients, subscribe to the topic, and receive the data they are publishing through their device.

Now my use case is to provide each client with a unique token which they have to send while connecting the MQTT broker in order to start publishing the data. And I want to validate that client token using an API and then establish a connection between the client and MQTT Broker.

I have searched for my use case but I have not found any help.

Mosquitto has an authorisation plugin API that will let you build your authentication scheme.

The doc for the API is here

You can also search GitHub for existing auth plugins eg https://github.com/jpmens/mosquitto-auth-plug (this plugin is no longer being developed but there are active forks)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM