This MigratoryData add-on allows you to authorize users to subscribe to and/or publish real-time messages on specific subjects using the JSON Web Tokens (JWT) standard.
Please refer to the following blog post for an overview of the JWT authorization add-on.
This add-on is preinstalled in the MigratoryData server under the following folder, according to the package type used to install the MigratoryData server:
Location | Package type |
---|---|
addons/authorization-jwt |
Platform-independent tarball package |
/usr/share/migratorydata/addons/authorization-jwt |
RPM or DEB Linux package |
Its default configuration is available under the following folder:
Location | Package type |
---|---|
addons/authorization-jwt |
Platform-independent tarball package |
/etc/migratorydata/addons/authorization-jwt |
RPM or DEB Linux package |
The add-on is automatically enabled the parameter
Entitlement of the MigratoryData server is set on JWT
.
You can modify the source code of this add-on to fit your needs. The add-on is build with MigratoryData's Server Extensions API.
You can use the following commands to get and build the add-on:
$ git clone https://github.com/migratorydata/addon-authorization-jwt.git
$ cd addon-authorization-jwt
$ ./gradlew clean build shadowJar
- Copy the modified add-on from
addon-authorization-jwt/build/libs/authorization.jar
to the following location of your MigratoryData server installation:
Location | Package type |
---|---|
extensions/ |
Platform-independent tarball package |
/usr/share/migratorydata/extensions/ |
RPM or DEB Linux package |
Note — It is not necessary to delete the JWT authorization add-on
authorization.jar
made available under the folderaddons
. Loading a custom authorization extensionauthorization.jar
from the folderextensions
takes precedence over loading an off-the-shelf authorization extensionauthorization.jar
made available under the folderaddons
. Note also that the name of the extensionauthorization.jar
is fixed, it cannot be changed in order to be loaded by the MigratoryData server.
-
Set the parameter Entitlement of the MigratoryData server on
Custom
(rather than onJWT
) -
Finally, restart your MigratoryData server in order to reload the authorization add-on.