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: docs/oauth2-examples-entra-id/index.md
+21-14Lines changed: 21 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ limitations under the License.
24
24
This guide explains how to set up OAuth 2.0 for RabbitMQ
25
25
and Microsoft Entra ID as Authorization Server using the following flows:
26
26
27
-
* Access the management UI via a browser
27
+
* Access the management UI via a browser.
28
28
29
29
## Prerequisites to follow this guide
30
30
@@ -68,14 +68,6 @@ When using **Entra ID as OAuth 2.0 server**, your client app (in our case Rabbit
68
68
* Directory (tenant ID)
69
69
* Application (client) ID
70
70
71
-
6. Click on the **Endpoints** tab if it is visible.
72
-
7. On the right pane that has just opened, copy the value of **OpenID Connect metadata document** (ex: `https://login.microsoftonline.com/{TENANT_ID}/v2.0/.well-known/openid-configuration`) and open it in your browser.
73
-
74
-
Note the value of the `jwks_uri` key (ex: `https://login.microsoftonline.com/{TENANT_ID}/discovery/v2.0/keys`), as you will also need it later to configure the `rabbitmq_auth_backend_oauth2` on RabbitMQ side.
75
-
76
-

77
-
8. If the **Endpoints** tab is not visible,
78
-
79
71
80
72
## Create OAuth 2.0 roles for your app
81
73
@@ -159,6 +151,21 @@ Now that some roles have been created for your application, you still need to as
159
151
160
152
9. Repeat the operations for all the roles you want to assign.
161
153
154
+
## Create scope required by Management ui during authorization
155
+
156
+
So far we have created the roles and granted the roles to the user who is going to
157
+
access the management UI. When this user logs into RabbitMQ management UI, its token
158
+
contains the granted roles.
159
+
160
+
1. Go to **App registrations**.
161
+
2. Click on your application.
162
+
3. Go to **Manage** option on the left menu and choose the option **Expose an API**.
163
+
4. Click on **Add a scope**.
164
+
5. Enter a name, eg. `management-ui`. Enter the same name for **Admin consent display name** and a description and save it.
165
+
7. The scope is named `api://{Application (client) ID}/{scope_name}`.
166
+
167
+
RabbitMQ management ui must provide this scope in `management.oauth_scopes` along with `openid profiles` scopes.
168
+
162
169
## Configure Custom Signing Keys
163
170
164
171
It is optional to create a signing key for your application. If you create one though, you must append an `appid` query parameter containing the *app ID* to the `jwks_uri`. Otherwise, the standard jwks_uri endpoint will not include the custom signing key and RabbitMQ will not find the signing key to validate the token's signature.
@@ -180,15 +187,15 @@ Update it with the following values:
180
187
181
188
```ini
182
189
auth_backends.1 = rabbit_auth_backend_oauth2
183
-
auth_backends.2 = rabbit_auth_backend_internal
184
190
185
191
management.oauth_enabled = true
186
-
management.oauth_client_id = {PUT YOUR AZURE AD APPLICATION ID}
0 commit comments