OK, let's try to fix the AMQP connection first, before moving on the
management plugin.
I followed the steps from the plugin readme [1] and it worked on my
laptop. Let's recap.
UAA (make sure you have Java 11):
git clone g...@github.com:cloudfoundry/uaa.git
cd uaa
CLOUDFOUNDRY_CONFIG_PATH=<path_to_oauth2_plugin>/demo/symmetric_keys
./gradlew run
RabbitMQ:
./rabbitmq-plugins enable rabbitmq_auth_backend_oauth2
export RABBITMQ_CONFIG_FILE=<path_to_oauth2_plugin>/demo/symmetric_keys/rabbitmq.config
./rabbitmq-server -detached
Note I removed the management plugin part in the configuration file:
[
%% Enable rabbit_auth_backend_oauth2
{rabbit, [
{auth_backends, [rabbit_auth_backend_oauth2,
rabbit_auth_backend_internal]}
]},
%% Set a resource server ID. Will require all scopes to be
prefixed with `rabbitmq.`
{rabbitmq_auth_backend_oauth2, [
{resource_server_id, <<"rabbitmq">>},
% Set up a legacy signing key
{key_config, [
{default_key, <<"legacy-token-key">>},
{signing_keys, #{
<<"legacy-token-key">> =>
{map, #{
<<"alg">> => <<"HS256">>,
<<"value">> => <<"rabbit_signing_key">>,
<<"kty">> => <<"MAC">>,
<<"use">> => <<"sig">>}
}
}
} %% signing keys
]} % key_config
]} % rabbitmq_auth_backend_oauth2
].
UAA and RabbitMQ configuration (from the OAuth 2 plugin directory,
make sure the cf-uaac and bunny gems are installed as explained in the
readme):
RABBITMQCTL=<path_to_rabbitmq_sbin>/rabbitmqctl demo/setup.sh
Copy the access token from the rabbit_super user.
AMQP connection:
Paste the token in the Python script.
python send.py
[x] Message sent to consumer
I used RabbitMQ 3.8.1 and Erlang 22.1.3.
Please make sure to follow this procedure before we move on to
diagnose the issue with the management plugin.
[1]
https://github.com/rabbitmq/rabbitmq-auth-backend-oauth2#examples
> To unsubscribe from this group and stop receiving emails from it, send an email to
rabbitmq-user...@googlegroups.com.
> To view this discussion on the web, visit
https://groups.google.com/d/msgid/rabbitmq-users/e981e769-165a-4933-9f9e-f8834f360e1c%40googlegroups.com.