[
    %% Enable rabbit_auth_backend_oauth2
    {rabbit, [
        {auth_backends, [rabbit_auth_backend_oauth2, rabbit_auth_backend_internal]}
    ]},

    {rabbitmq_management, [
      {enable_uaa, true},
      {uaa_client_id, "rabbit_user_client"},
      {uaa_location, "http://localhost:8080/uaa"}
    ]},

    %% 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
].
