Skip to content

Instantly share code, notes, and snippets.

@houssemFat
Created January 25, 2017 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save houssemFat/88e701b5cb9892fc9877a2c1b42c3330 to your computer and use it in GitHub Desktop.
Save houssemFat/88e701b5cb9892fc9877a2c1b42c3330 to your computer and use it in GitHub Desktop.
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