You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,22 +56,18 @@ If you want to understand the details of how to configure RabbitMQ with Oauth2 g
56
56
57
57
## OAuth2 plugin in action
58
58
59
-
In order see the OAuth2 plugin in action we need an OAuth2 **Authorization server** running and RabbitMQ server configured accordingly. To get up and running quickly, we are going to use UAA as Authorization Server. In the next section, we
60
-
will see how to set up UAA and RabbitMQ. If you are new to OAuth2, it is a good starting point. If you already know OAuth2
61
-
and you want to learn how to configure RabbitMQ to talk to one of Oauth2 server tested on this tutorial, you can jump
62
-
straight to them. They are [KeyCloak](use-cases/keycloak.md), [https://auth0.com/](use-cases/auth0.md) and [Azure Active Directory](use-cases/azure.md) in addition to UAA which we will use it in the next sections.
59
+
In order see the [rabbitmq-auth-backend-oauth2](https://github.com/rabbitmq/rabbitmq-server/tree/main/deps/rabbitmq_auth_backend_oauth2) plugin in action we need an OAuth 2.0 **Authorization server** running and RabbitMQ server configured accordingly. To get up and running quickly, we are going to use UAA as Authorization Server. In the next section, we will see how to set up UAA and RabbitMQ. If you are new to OAuth 2.0, it is a good starting point. If you already know OAuth 2.0 and you want to learn how to configure RabbitMQ to talk to one of OAuth 2.0 server tested on this tutorial, you can jump straight to them. They are [KeyCloak](use-cases/keycloak.md), [https://auth0.com/](use-cases/auth0.md) and [Azure Active Directory](use-cases/azure.md) in addition to UAA which we will use it in the next sections.
63
60
64
61
65
62
### Set up UAA and RabbitMQ
66
63
67
-
There are two ways to set up OAuth2 in RabbitMQ. One uses symmetrical signing keys. And the other uses
68
-
asymmetrical signing keys. The Authorization server is who digitally signs the JWT tokens and RabbitMQ
69
-
has to be configured to validate any of the two types of digital signatures.
64
+
RabbitMQ support two types of two signing keys used to digitally sign the JWT tokens.
65
+
The two types are **symmetrical** and **asymmetrical** signing keys. The Authorization server is who digitally signs the JWT tokens and RabbitMQ has to be configured to validate any of the two types of digital signatures.
70
66
71
-
Given that asymmetrical keys is the most widely used option, we are going to focus on how to
67
+
Given that asymmetrical keys are the most widely used option, we are going to focus on how to
72
68
configure RabbitMQ with them.
73
69
74
-
#### Use Asymmetrical digital singing keys
70
+
#### Use Asymmetrical digital signing keys
75
71
76
72
Run the following 2 commands to get the environment ready to see Oauth2 plugin in action:
77
73
@@ -86,6 +82,16 @@ The Management UI can be configured with one of these two login modes:
86
82
*[Service-Provider initiated logon](#service-provider-initiated-logon) - This is the default and traditional OAuth 2.0 logon mode. The user comes to the Management UI and clicks on the button "Click here to logon" which initiates the logon. The logon process starts in RabbitMQ, the Service Provider.
87
83
*[Identity-Provider initiated logon](#identity-provider-initiated-logon) - This is a logon mode meant for web portals. Users navigate to RabbitMQ with a token already obtained by the web portal on behalf of the user.
88
84
85
+
### Supported OAuth 2.0 flow
86
+
87
+
Since RabbitMQ 3.10 the Management UI uses *Authorization Code flow with PKCE**. Because RabbitMQ is a single-page
88
+
web application, it cannot safely store credentials such as the `client_id` and `client_secret` required by
89
+
RabbitMQ to authenticate with the Authorization Server in order to get a token for the end-user. Therefore, we
90
+
should configure the RabbitMQ OAuth client in the Authorization Server so that it does not require `client_secret`.
91
+
This type of OAuth clients/applications are known as **public** or **non-confidential**. In UAA they are configured as `allowpublic: true`.
92
+
93
+
Nevertheless, should your Authorization Server require a `client_secret` , we can configure it via `management.oauth_client_secret`.
94
+
89
95
### Service-Provider initiated logon
90
96
91
97
The first time an end user arrives to the management ui (`1`), The user clicks on the button `Click here to login` and it is redirected (`2`) to UAA to authenticate. Once they successfully authenticate with UAA, the user is redirected back (`3.`) to RabbitMQ with a valid JWT token. RabbitMQ validates it and identifies the user and extracts its permissions from the JWT token.
@@ -119,14 +125,16 @@ To configure RabbitMQ Management UI with OAuth 2.0 we need the following configu
119
125
{rabbitmq_management, [
120
126
{oauth_enabled, true},
121
127
{oauth_client_id, "rabbit_client_code"},
122
-
{oauth_client_secret, "rabbit_client_code"},
123
128
{oauth_provider_url, "http://localhost:8080"},
124
129
...
125
130
]},
126
131
```
127
132
128
133
### Identity-Provider initiated logon
129
134
135
+
**Note**: **This feature has not been released yet. It is only available in the development docker image
When RabbitMQ is offered as a service from a web portal, it is more convenient to navigate to RabbitMQ Management UI with a single click. The web portal is responsible for getting a token before taking the user to the RabbitMQ Management UI web page.
131
139
132
140
```
@@ -145,7 +153,6 @@ By default, RabbitMQ Management UI is configured with service-provider initiated
145
153
{rabbitmq_management, [
146
154
{oauth_enabled, true},
147
155
{oauth_client_id, "rabbit_client_code"},
148
-
{oauth_client_secret, "rabbit_client_code"},
149
156
{oauth_provider_url, "http://localhost:8080"},
150
157
{oauth_initiated_logon_type, idp_initiated},
151
158
...
@@ -649,7 +656,6 @@ authenticate users with UAA and the URL of UAA (`http://localhost:8080/uaa`)
0 commit comments