2017-08-18 3 views
0

J'ai configuré rabbitmq-auth-backend-http et mon rabbitmq.config ressemble ci-dessousback-end de lapin MQ autorisation http ne fonctionne pas

[ 
    {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"}]} 
]. 

points d'extrémité d'autorisation http://localhost:8080/auth sont opérationnels.

Mais quand je suis en train de se connecter http://localhost:15672/api/whoami api est obtenir échoué avec le code d'état 500.

Authentification avec base de données interne de rabbitmq fonctionne bien. seul problème est lorsque l'ajout rabbit_auth_backend_http dans auth_backends ne fonctionne pas. Il n'atteint même pas les points d'extrémité d'autorisation. J'ai vérifié les journaux dans var/rabbitmq/[email protected], mais aucune aide. Je posterai les journaux ici

= RAPPORT D'ERREUR ==== 18-Aug-2017 :: 21: 55: 46 === écouteur Ranch rabbit_web_dispatch_sup_15672 avait processus de connexion a commencé avec cowboy_protocol: start_link/4 à < 0.574.0> sortie avec raison: {[{reason, indéfinies}, {amf, {rabbit_mgmt_wm_whoami, is_authorized, 2}}, {stacktrace, [{rabbit_auth_backend_http, user_login_authentication, [< < "test" >>, [{mot de passe, "Test" >>}]], []}, {rabbit_access_control, try_authenticate, 3, [{fichier, "src/rabbit_access_control.erl"}, {ligne, 88}]}, {rabbit_access_control, '- check_user_login/2-fun-0 - ', 4, [{fichier, "src/rabbit_access_control.erl"}, {ligne, 74}]}, {listes, foldl, 3, [{fichier, "lists.erl"}, { ligne, 1263}]}, {rabbit_mgmt_util, is_authorized, 6, [{fichier, "src/rabbit_mgmt_util.erl"}, {line, 149}]}, {cowboy_rest, appel, 3, [{fichier, "src/cowboy_rest.erl"}, {ligne, 976}]} , {cowboy_rest, is_authorized, 2, [{fichier, "src/cowboy_rest.erl"}, {ligne, 150}]}, {cowboy_protocol, execute, 4, [{fichier, "src/cowboy_protocol.erl"}, { ligne, 442}]}}}, {req, [{socket, # Port < 0.26006>}, {transport, ranch_tcp}, {connexion, keepalive}, {pid,.574.0>}, {méthode, < < "GET" >>}, {version, 'HTTP/1.1'}, {pair, {{127,0,0,1}, 51220}}, {hôte, < < "localhost" >>}, {host_info, indéfini}, {port, 15672}, {chemin, < < "/ api/whoami" >>}, {path_info, non définie}, {qs, < < >>}, {qs_vals, []}, {liaisons, [ ]}, {headers, [{< < "host" >>, < < "localhost: 15672" >>}, {< < "connexion" >>, < < "keep-alive" >>}, {< < "autorisation" >>, < < "Basic dGVzdDp0ZXN0" >>}, {< < "user-agent" >>, < < "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, comme Gecko) Chrome/60.0.3112.90 Safari/537.36 ">>}, {< <" type de contenu ">>, < <" application/json ">>}, {< < "accepter" >>, < < "/ ">>}, {< < "referer" >>, < <" http://localhost:15672/" >>}, {< < "Accept-Encoding" >>, < < "gzip, deflate, br" >>}, {< < "accept-language" >>, < < "fr-FR, fr; q = 0.8 ">>}, [{< <" connexion ">>, [< " keep-alive ">>]}]}, {cookies, non défini}, {meta, []}, {body_state, wait}, {buffer, < < >>}, {multipart, indéfini}, {resp_compress, true}, {resp_state, wait}, {resp_headers, [{< < "varient" >>, < < "origine" >>}]} , {resp_body, < < >>}, {onresponse, # Fun}]}, {état, {contexte, indéfini, aucun, indéfini}}], [{cowboy_rest, error_terminate, 5, [{fichier, "src/cowboy_rest .erl "}, {line, 1009}]}, {cowboy_rest, is_authorized, 2, [{fichier," src/cowboy_rest.erl "}, {ligne, 150}]}, {cowboy_protocol, execute, 4, [{ fichier, "src/cowboy_protocol.erl"}, {line, 442}]}]}

ce que je fais mal?

merci pour toute aide.

Répondre

0

Après avoir posté cette question rabbitmq-user google group J'ai eu la solution. vous devez installer rabbitmq-auth-backend-http manuellement. Ajout d'une configuration dans le fichier rabbitmq.config ne l'installera pas.

Voici le lien de plus detailed answer.

Une autre chose importante au sujet du plugin rabbitmq-auth-backend-http est que vous devez configurer tous les points de terminaison (user_path, chemin_vhost, topic_path, chemin_ressources) dans le fichier rabbitmq.config. Si vous manquez un point de terminaison rabbitmq prendra en dessous de default values pour l'autorisation.

{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"}