Skip to content
A VerneMQ plugin demonstrating the authentication and authorization hooks.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
readme.md
rebar.config
rebar3

readme.md

VerneMQ Demo Plugin

This plugin demonstrates how you can develop an Authentication/Authorization plugin for VerneMQ. The important files are:

  • src/vernemq_demo_plugin.erl
  • src/vernemq_demo_plugin.app.src

The rest is the Erlang OTP application boilerplate.

You must have a recent version of Erlang installed (it's recommended to use the same one VerneMQ is compiled for, typically > 17). To compile do:

./rebar3 compile

Then enable the plugin using:

vmq-admin plugin enable --name vernemq_demo_plugin --path <PathToYourPlugin>/vernemq_demo_plugin/_build/default

Depending on how VerneMQ is started you might need sudo rights to access vmq-admin. Moreover the <PathToYourPlugin> should be accessible by VerneMQ (file permissions).

Since this demo plugin implements hooks which are already covered by vmq_passwd and vmq_acl you might want to disable these in order to see the effect of this plugin.

vmq-admin plugin disable --name vmq_passwd
vmq-admin plugin disable --name vmq_acl

That's it!

You can’t perform that action at this time.