The resource_server_id is a prefix to filter out scopes that are
supposed to be used by the plugin [1]. This means that if
resource_server_id is "rabbitmq", scopes must start with this prefix
to be "found" by the plugin, e.g. "rabbitmq.configure:*/*
rabbitmq.write:*/* rabbitmq.read:*/*". Other values that could be in
the "scope" field but that do not begin with "rabbitmq." will be
ignored.
resource_server_id can be only a string. I don't see much interest in
making it multi-valued: different resource servers just need to use
the same prefix for scope that are meant to be used by RabbitMQ, this
seems reasonable.
It's still possible to specify several signing keys, for example:
[
{rabbit, [
{auth_backends, [rabbit_auth_backend_oauth2, rabbit_auth_backend_internal]},
{auth_mechanisms, ['PLAIN','AMQPPLAIN','EXTERNAL']}
]},
{rabbitmq_auth_backend_oauth2, [
{resource_server_id, <<"rabbitmq">>},
{key_config, [
{default_key, <<"qttCpQ0xTYClgdb-40_Ag6QuneAxDWVwrs5Xl54vk3s">>},
{signing_keys, #{
<<"qttCpQ0xTYClgdb-40_Ag6QuneAxDWVwrs5Xl54vk3s">> => {pem,
<<"-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiAb+J6Uc+7uulKKaVUOK4LjXeburIYNf0wVMg5QaoPOxr2cVY4QziMD81+LtcIA9bK2PABSO2BEaC2CeLZGbPRfS+uIA6khNpAv1XTAflHYM4YqrHgGVMJObo+5RhpU9IMJ5gGQOqRA5xxX26RTAWllmV1xlt6AgbofudcMKSQQLJONzZYgtlOuqIonmCNpDM/2SgUxLgE1kFHXc1Zbtvb/koV3nyvqEk0BFv7jW9/P5QAIHkCls07F0RYzLyIZRKiTcvhhshvJLUrBy0xjYMU0JqcQcykSSmyFNt2yDNQwgJub3Q1V+RWYwR8KYmIz2PtxIKYFkXNkL34n7czzLAwIDAQAB
-----END PUBLIC KEY-----">>},
<<"legacy-token-key">> => {pem, <<"-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2dP+vRn+Kj+S/oGd49kq
6+CKNAduCC1raLfTH7B3qjmZYm45yDl+XmgK9CNmHXkho9qvmhdksdzDVsdeDlhK
IdcIWadhqDzdtn1hj/22iUwrhH0bd475hlKcsiZ+oy/sdgGgAzvmmTQmdMqEXqV2
B9q9KFBmo4Ahh/6+d4wM1rH9kxl0RvMAKLe+daoIHIjok8hCO4cKQQEw/ErBe4SF
2cr3wQwCfF1qVu4eAVNVfxfy/uEvG3Q7x005P3TcK+QcYgJxav3lictSi5dyWLgG
QAvkknWitpRK8KVLypEj5WKej6CF8nq30utn15FQg0JkHoqzwiCqqeen8GIPteI7
VwIDAQAB
-----END PUBLIC KEY-----">>}
}
}
]}
]}
].
In the configuration file above, 2 public keys are declared (yours and
the one from the demo). The broker then accepts your token and a token
generated by UAA (this works, I tested it).
[1]
https://github.com/rabbitmq/rabbitmq-auth-backend-oauth2#resource-server-id-and-scope-prefixes
> 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/7e49769e-b915-41fb-94fa-8575045069e5%40googlegroups.com.