Not Authorized - OAuth2 plugin not working on Rabbitmq with Azure AD #8512
-
Describe the bugI am trying to use OAuth2 on rabbitmq with provider Azure AD (only for the management UI). I am using the docker image rabbitmq:3.11-management. I have created an SPA app registration on Azure AD with a redirection url to the management UI home page. I have then created two app roles :
I have assigned those app roles to myself on Azure AD. On rabbitmq side, I have put this configuration :
When I connect to management UI I have the 'Click Here to Login' Button as expected with the used plugin but when I click, I have Not Authorized error: In rabbitmq logs I have this (in debug mode):
I have tried to see the content headers of the JWT Token and the result is that I see the claim 'roles' and I see in it the roles I have... What am I missing here ? Reproduction steps
Expected behavior
Additional contextHere is the JWT header :
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
This is why for a couple of years now, nodes support short backend names, such as auth_backends.1 = oauth2
# ...
auth_oauth2.resource_server_id = a_resource_server_id
auth_oauth2.additional_scopes_key = a_custom_scope_key
auth_oauth2.default_key = id1 Our examples guide uses the |
Beta Was this translation helpful? Give feedback.
-
@SirineBeji this is not a bug but a result of a misconfiguration. Imagine configuring a class in a JVM-based application and making a mistake in the name. You will get a This is exactly what you are looking at here, just not in a JVM-based language. |
Beta Was this translation helpful? Give feedback.
-
rabbitmq/rabbitmq-website@78287d3 should make this kind confusion less likely. |
Beta Was this translation helpful? Give feedback.
Apparently there is no shortcut for
oauth2
and the shortcuts arespecific to the
rabbitmq.conf
"new style" format.Well, that's easy to correct.
Those who use the
advanced.config
with the classic config/Erlang term format must specifyrabbit_auth_backend_oauth2
for backend name. That'srabbit_
in the beginning, notrabbitmq_
.