-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth 2: support multiple resources, extract an OAuth 2 client #10012
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1f1e23
to
97b8daf
Compare
97b8daf
to
ed859bd
Compare
2b7453f
to
527e9dc
Compare
d7cddfb
to
57df077
Compare
c1c50d1
to
032b698
Compare
This was referenced Jan 18, 2024
281428a
to
0e3edfe
Compare
337184c
to
429ef81
Compare
(cherry picked from commit d5c15a5)
(cherry picked from commit f194b42)
(cherry picked from commit 7989bfc)
if system cacert files are available accept peer_verify else default to verify_none
starts only those components which are down rather than restarting them
which are not available
and instead use only get_additional_scopes_key As Per @kjnilsson suggestion
df08dab
to
e4e0ece
Compare
14 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Merge PR oauth-multi-resource-support and create-oauth2-client
What
This PR adds the following OAuth 2.0 capabilities/features:
resource_server_id
setting. This was more than sufficient for most setups. However, there are environments where one RabbitMQ cluster is referenced by more than one "tenant" and each "tenant" refers to RabbitMQ with a different resource's name/id.management.oauth_disable_basic_auth
isfalse
andmanagement.oauth_enabled
is true, the user is presented with two sections, one for Oauth2 and another for Basic Auth. And the user ultimately clicks the appropriate button to login.auth_oauth2.jwks_url
. Instead, RabbitMQ should be able to contact the OpenId Configuration endpoint and figure out thejwks_uri
. This PR does exactly that. Now, users only need to configure the root url of their identity provider in a new setting calledauth_oauth2.issuer
. And RabbitMQ discovers the jwks_uri (among other endpoints) and from it, it downloads the signing keys. Furthermore, users do not need to configuremanagement.oauth_provider_url
because this url is typically the issuer url. That is the url where to redirect users to authenticate and get a token. If that url did not coincide with the issuer url (which would be very odd), users can configuremanagement.oauth_provider_url
.Acceptance Tests
About RabbitMQ docker image used to run the tests
The acceptance tests use a RabbitMQ docker image built from this PR. Here is where the default image is set.
However, if you want to run these acceptance tests against an image built locally from this PR, you can override the IMAGE and IMAGE_TAG this way: This command deploys RabbitMQ using the image and image tag specified and it uses the
rabbitmq.conf
file found underconf/keycloak
folder.Test 1 - It is possible to configure two OAuth resources and users and clients who access these two resources are registered on the same OAuth provider but under two separate tenant (a.k.a. realms).
. This scenario explains step by step how to bootstrap keycloak(s) instances, RabbitMQ (it also says which configuration file is used) and finally how to test various flows: amqp, management rest api, management ui with two users thru two different resources
Test 2 - Same as in the previous scenario but now each resource is physically managed by two separate servers.
Test 3 - It is possible to combine oauth2 authentication with more than one resource and basic authentication in the management ui