rabbitmq - Rabbit MQ backend http authorisation not working -


i have configured rabbitmq-auth-backend-http , rabbitmq.config looks below

[   {rabbit, [{auth_backends, [rabbit_auth_backend_http, rabbit_auth_backend_internal]}]},   {rabbitmq_auth_backend_http,    [{http_method,   get},     {user_path,     "http://localhost:8080/auth/user"},     {vhost_path,    "http://localhost:8080/auth/vhost"},     {resource_path, "http://localhost:8080/auth/resource"},     {topic_path,    "http://localhost:8080/auth/topic"}]} ]. 

authorization end points http://localhost:8080/auth , running.

but when trying login http://localhost:15672/api/whoami api getting failed status code 500.

authentication rabbitmq internal database working fine. problem when adding rabbit_auth_backend_http in auth_backends not working. it's not hitting authorization end points. have checked logs in var/rabbitmq/rabbit@localhost.log, no help. posting logs here

=error report==== 18-aug-2017::21:55:46 === ranch listener rabbit_web_dispatch_sup_15672 had connection process started cowboy_protocol:start_link/4 @ <0.574.0> exit reason: {[{reason,undef},{mfa,{rabbit_mgmt_wm_whoami,is_authorized,2}},{stacktrace,[{rabbit_auth_backend_http,user_login_authentication,[<<"test">>,[{password,<<"test">>}]],[]},{rabbit_access_control,try_authenticate,3,[{file,"src/rabbit_access_control.erl"},{line,88}]},{rabbit_access_control,'-check_user_login/2-fun-0-',4,[{file,"src/rabbit_access_control.erl"},{line,74}]},{lists,foldl,3,[{file,"lists.erl"},{line,1263}]},{rabbit_mgmt_util,is_authorized,6,[{file,"src/rabbit_mgmt_util.erl"},{line,149}]},{cowboy_rest,call,3,[{file,"src/cowboy_rest.erl"},{line,976}]},{cowboy_rest,is_authorized,2,[{file,"src/cowboy_rest.erl"},{line,150}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,442}]}]},{req,[{socket,#port<0.26006>},{transport,ranch_tcp},{connection,keepalive},{pid,<0.574.0>},{method,<<"get">>},{version,'http/1.1'},{peer,{{127,0,0,1},51220}},{host,<<"localhost">>},{host_info,undefined},{port,15672},{path,<<"/api/whoami">>},{path_info,undefined},{qs,<<>>},{qs_vals,[]},{bindings,[]},{headers,[{<<"host">>,<<"localhost:15672">>},{<<"connection">>,<<"keep-alive">>},{<<"authorization">>,<<"basic dgvzddp0zxn0">>},{<<"user-agent">>,<<"mozilla/5.0 (macintosh; intel mac os x 10_12_6) applewebkit/537.36 (khtml, gecko) chrome/60.0.3112.90 safari/537.36">>},{<<"content-type">>,<<"application/json">>},{<<"accept">>,<<"/">>},{<<"referer">>,<<"http://localhost:15672/">>},{<<"accept-encoding">>,<<"gzip, deflate, br">>},{<<"accept-language">>,<<"en-us,en;q=0.8">>},[{<<"connection">>,[<<"keep-alive">>]}]},{cookies,undefined},{meta,[]},{body_state,waiting},{buffer,<<>>},{multipart,undefined},{resp_compress,true},{resp_state,waiting},{resp_headers,[{<<"vary">>,<<"origin">>}]},{resp_body,<<>>},{onresponse,#fun}]},{state,{context,undefined,none,undefined}}],[{cowboy_rest,error_terminate,5,[{file,"src/cowboy_rest.erl"},{line,1009}]},{cowboy_rest,is_authorized,2,[{file,"src/cowboy_rest.erl"},{line,150}]},{cowboy_protocol,execute,4,[{file,"src/cowboy_protocol.erl"},{line,442}]}]}

what doing wrong?

thanks help.

after posting question rabbitmq-user google group got solution. need install rabbitmq-auth-backend-http manually. adding configuration in rabbitmq.config file not install it.

here link of more detailed answer.

another important thing rabbitmq-auth-backend-http plugin have configure endpoints(user_path, vhost_path, topic_path, resource_path) in rabbitmq.config file. if miss endpoint rabbitmq take below default values authorization.

{user_path,     "http://localhost:8000/auth/user"}, {vhost_path,    "http://localhost:8000/auth/vhost"}, {resource_path, "http://localhost:8000/auth/resource"}, {topic_path,    "http://localhost:8000/auth/topic"} 

Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -