We're running a CloudAMQP RabbitMQ cluster in Azure, and I've set up a few http-triggered Azure Functions to act as auth endpoints for the rabbitmq-auth-backend-http plugin.
I'm currently waiting on a response from CloudAMQP support on this issue, but I thought I'd throw it out here in the mean time to see if anyone has any ideas.
RabbitMQ Version: 3.7.4
Erlang Version: 20.1
Plugin Configuration:
(Note: this is the config I gave the support people to use. They said they enabled just the http plugin first and would enable the cahce plugin once we confirmed the http plugin was working.)
auth_backends.1 = cache
auth_cache.cached_backend = http
auth_cache.cache_ttl = 300000
auth_http.http_method = post
auth_http.user_path =
https://xxx.azurewebsites.net/api/auth/user?code=xxxxxxauth_http.vhost_path =
https://xxx.azurewebsites.net/api/auth/vhost?code=xxxxxxauth_http.resource_path =
https://xxx.azurewebsites.net/api/auth/resource?code=xxxxxxauth_http.topic_path =
https://xxx.azurewebsites.net/api/auth/topic?code=xxxxxxMade two attempts to connect, one with invalid credentials and one with valid credentials.
Both attempts failed with an authentication failure exception.
I have confirmed that my Azure Function endpoints were called by the plugin and handled their requests correctly.
In the RabbitMQ Logs, I see the following for the two attempts.
=INFO EVENT==== Tue, 24 Apr 2018 20:31:29 GMT ===
2018-04-24 20:31:29.234 [info] <0.1786.0> accepting AMQP connection <0.1786.0> (xx.xx.xx.xx:xx -> xx.xx.xx.xx:xx)
=ERROR EVENT==== Tue, 24 Apr 2018 20:31:32 GMT ===
2018-04-24 20:31:32.709 [error] <0.1786.0> Error on AMQP connection <0.1786.0> (xx.xx.xx.xx:xx -> xx.xx.xx.xx:xx, state: starting):
PLAIN login refused: rabbit_auth_backend_http failed authenticating NormanBobberson: {bad_response,
"deny"}
=INFO EVENT==== Tue, 24 Apr 2018 20:31:32 GMT ===
2018-04-24 20:31:32.749 [info] <0.1786.0> closing AMQP connection <0.1786.0> (xx.xx.xx.xx:xx -> xx.xx.xx.xx:xx)
=INFO EVENT==== Tue, 24 Apr 2018 20:31:53 GMT ===
2018-04-24 20:31:53.212 [info] <0.1798.0> accepting AMQP connection <0.1798.0> (xx.xx.xx.xx:xx -> xx.xx.xx.xx:xx)
=ERROR EVENT==== Tue, 24 Apr 2018 20:31:53 GMT ===
2018-04-24 20:31:53.263 [error] <0.1798.0> Error on AMQP connection <0.1798.0> (xx.xx.xx.xx:xx -> xx.xx.xx.xx:xx, state: starting):
PLAIN login refused: rabbit_auth_backend_http failed authenticating NormanBobberson: {bad_response,
"allow"}
=INFO EVENT==== Tue, 24 Apr 2018 20:31:53 GMT ===
2018-04-24 20:31:53.294 [info] <0.1798.0> closing AMQP connection <0.1798.0> (xx.xx.xx.xx:xx -> xx.xx.xx.xx:xx)
Originally I was returning the allow/deny responses as json, but I fixed them to only respond in plain text and these log messages along with independent tests with Fiddler confirm that responses are now in plain text, however the plugin is still rejecting plain text "allow" and "deny" responses with bad_response.