Management UI logs out basic auth users on page load when both oauth and basic auth are enabled #15783
Replies: 2 comments 2 replies
-
|
Thanks for the details but OAuth 2 was largely designed with the idea that it would be used exclusively due to the extensive changes it requires in the management UI. Knowing what function is relevant does not change any of that. This is very different from, say, LDAP or a custom HTTP-based services which require no management UI changes. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, It is a legitimate issue which I am fixing here #15793. There is no need to change the docs. It should be possible to login via oauth 2.0 and/or Basic auth. And in fact, @laurensOost is able to login. It is just an issue introduced after we allowed both mechanisms. As @michaelklishin said, in the past it was exclusively OAuth 2.0 mechanism. But now that both mechanisms are allowed, there is a code path which was not properly updated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
RabbitMQ version
4.2.2
Management plugin enabled
Relevant documentation: https://www.rabbitmq.com/docs/management#allow-basic-auth-for-mgt-ui
OAuth provider: Keycloak
Basic Auth: administrator user
Description
When OAuth2 is enabled in the management UI, logging in with Basic Auth does not persist. On page reload or navigation, the session is cleared if there is no active OIDC session, loggin the basic auth user out.
OIDC auth check does not seem to check if a basic auth user is logged in, returns only state of oauth user. So when a new page is loaded, the credentials, auth-scheme keys and "m" cookie will be cleared forcing a logout.
Testing the callstack it appears (!status.loggedIn) called clear_auth() in prefs.js
->
rabbitmq-server/deps/rabbitmq_management/priv/www/js/prefs.js
Line 37 in 2a9ba19
If the idp or OIDC client does not confirm an active session (status.loggedIn is false), the condition is met while the user is logged in using basic auth.
The issue happens only when logging in with basic auth combined with oauth enabled, no issues with oidc. Seems with basic auth it looks for a active session from the idp even when there is none.
Relevant code:
->
rabbitmq-server/deps/rabbitmq_management/priv/www/js/prefs.js
Line 37 in 2a9ba19
->
rabbitmq-server/deps/rabbitmq_management/priv/www/js/oidc-oauth/helper.js
Line 124 in 2a9ba19
Relevant config:
Reproduction steps
...
Expected behavior
Current behaviour:
-> Basic Auth credentials are cleared
-> User is logged out
Expected:
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions