Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rabbitMQ + enable http authentication & authorization with

Get Http plugin

Download .ez file the rabbit MQ plugin

Move the plugin ez file rabbitmq_auth_backend_http-3.6.x-1b27d722.ez under plugins folder of rabbitMQ server installtion

Plugin enabling

  • To enable http backend plugin rabbitmq-plugins.bat enable rabbitmq_auth_backend_http
  • To enable the SASL mechanism rabbitmq-plugins.bat enable rabbitmq_auth_mechanism_ssl
[
{rabbit,
[
{auth_backends, [rabbit_auth_backend_http]},
{auth_mechanisms, ['PLAIN', 'AMQPLAIN', 'EXTERNAL']}
]
},
{rabbitmq_auth_backend_http,
[{http_method, post},
{user_path, "http://127.0.0.1:15670/auth/user"},
{vhost_path, "http://127.0.0.1:15670/auth/vhost"},
{resource_path, "http://127.0.0.1:15670/auth/resource"},
{topic_path, "http://127.0.0.1:15670/auth/topic"}]
}
].
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.post('/user', function(req, res, next) {
res.send('allow [management monitoring administrator]');
});
/* GET users listing. */
router.post('/vhost', function(req, res, next) {
res.send('allow');
});
/* GET users listing. */
router.post('/resource', function(req, res, next) {
res.send('allow');
});
/* GET users listing. */
router.post('/topic', function(req, res, next) {
res.send('allow');
});
module.exports = router;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.