rabbitmq / rabbitmq-auth-backend-http

HTTP-based authorisation and authentication for RabbitMQ
Other
199 stars 72 forks source link

Can not make this work. Any help? #55

Closed p-diogo closed 7 years ago

p-diogo commented 7 years ago

Hello everybody,

I'm trying to setup rabbitmq (and its MQTT plugin) to allow AA via http with this module, but it keeps failing. It crashes when connecting via MQTT and also via the builtin management portal.

This is my very simple docker file:

FROM rabbitmq:3.6.10

RUN rabbitmq-plugins enable --offline rabbitmq_management
RUN rabbitmq-plugins enable --offline rabbitmq_mqtt

EXPOSE 15672
EXPOSE 1883

My env vars:

 - RABBITMQ_NODENAME=rabbit-mqtt-1@localhost
  - RABBITMQ_DEFAULT_USER=guest
  - RABBITMQ_DEFAULT_PASS=hidden
  - RABBITMQ_CONFIG_FILE=/etc/rabbitmq/rabbitmq2

and my rabbitmq2.conf file:

[
  {rabbit, [
    %% {default_user,     <<"admin">>},
    %% {default_pass,     <<"pRqEdtyFrX7h9BEfPQLYRmYbKcUVBv">>},
    {auth_backends, [rabbit_auth_backend_http]},
    {log_levels, [{connection, debug}, {channel, debug}]}
      ]
  },
  { 
    rabbitmq_management, [
      { listener, [
          { port, 15672 },
          { ssl, false }
        ] 
      } 
    ]},
  {
    rabbitmq_mqtt, [
      {log_levels, [{connection, debug}, {channel, debug}]},
      {auth_backends, [rabbit_auth_backend_http]},
      %% {default_user,     <<"guest">>},
      %% {default_pass,     <<"guest">>},
      %% {allow_anonymous,  false},
      {vhost,            <<"/">>},
      {exchange,         <<"amq.topic">>},
      {subscription_ttl, 1800000},
      {prefetch,         10},
      {ssl_listeners,    []},
      %% Default MQTT with TLS port is 8883
      %% {ssl_listeners,    [8883]}
      {tcp_listeners,    [1883]},
      {tcp_listen_options, [
        {backlog,   128},
        {nodelay,   true}]}
    ]},
  %% See HTTP backend docs for details
  { rabbitmq_auth_backend_http,
  [
    {http_method,   post},
    { user_path,     "http://192.168.1.70:8000/auth/user" },
    { vhost_path,    "http://192.168.1.70:8000/auth/vhost" },
    { resource_path, "http://192.168.1.70:8000/auth/resource" }
  ]
  }
].

The problem: rabbitmq never communicates with my web server.

When connecting via MQTT: https://pastebin.com/J9pQJpBH

When connecting via builtin management portal: https://pastebin.com/JWFQsDPe

Any help ?

Thank you in advance.

michaelklishin commented 7 years ago

Thank you for your time.

Team RabbitMQ uses GitHub issues for specific actionable items engineers can work on. This assumes two things:

  1. GitHub issues are not used for questions, investigations, root cause analysis, discussions of potential issues, etc (as defined by this team)
  2. We have a certain amount of information to work with

We get at least a dozen of questions through various venues every single day, often quite light on details. At that rate GitHub issues can very quickly turn into a something impossible to navigate and make sense of even for our team. Because of that questions, investigations, root cause analysis, discussions of potential features are all considered to be mailing list material by our team. Please post this to rabbitmq-users.

Getting all the details necessary to reproduce an issue, make a conclusion or even form a hypothesis about what's happening can take a fair amount of time. Our team is multiple orders of magnitude smaller than the RabbitMQ community. Please help others help you by providing a way to reproduce the behavior you're observing, or at least sharing as much relevant information as possible on the list:

Feel free to edit out hostnames and other potentially sensitive information.

When/if we have enough details and evidence we'd be happy to file a new issue.

Thank you.

michaelklishin commented 7 years ago

Your config file should be named rabbitmq.config, otherwise in 3.6.x the server won't load it as it appends .config to the value of RABBITMQ_CONFIG_FILE (there will be a message about config file not being found in the log). 3.7.0 will support arbitrary extensions/filenames.

RabbitMQ Configuration guide has a section on effective config verification.