The Stormpath Plugin enables HiveMQ to use the Stormpath authentication and authorization API for the easy to setup authentication and authorization of MQTT clients. For this purpose the client credentials are stored Stormpath accounts and permissions configured as groups in Stormpath.
Stormpath is a user management API for developers, that handles: identity management, user management, and security for applications.
-
Copy the jar file to your <HIVEMQ_HOME>/plugins folder
-
Set the Stormpath properties in the stormpath.properties file
-
Copy your apiKey.id and your apiKey.secret into the stormpath.properties
-
Set your application name
-
-
Run HiveMQ (Stormpath application and default path are created automatically)
-
Setup your Stormpath application
-
Create accounts to set the authentication credentials(Username and Password)
-
Create groups and add your accounts to the these groups
-
The name of each Group is defined as a permitted topic
-
-
Connect with a MQTT client of your choice using the username and password set in Stormpath
-
Done!
|
Note
|
This example shows how to setup your Stormpath application for the plugin. |
-
If you don´t have a Stormpath account already, register and get an API key.
-
Set your stormpath.properties. (See Table 1)
-
Create a new account. (See Table 2)
-
Create a new group named "testtopic/#".
-
Add the DeviceA account to the testtopic/# Group.
-
Connect with Username = DeviceA, Password = deviceA123.
-
Now the Client can only publish or subscribe to topics starting with testtopic/#
| stormpath.apiKey.id: | stormpath.apiKey.secret: | stormpath.application.name: |
|---|---|---|
"your apikey id" |
"your apikey secret" |
HiveMQ |
| Directory | Username | First Name | Middle Name | Last Name | Password | |
|---|---|---|---|---|---|---|
HiveMQ Directory |
DeviceA |
Device |
Type |
A |
deviceA123 |