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
+34-10Lines changed: 34 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,15 @@ 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 using v2.0 api version
27
+
* Access the management UI via a browser using Entra ID (API version 2.0)
28
28
29
29
30
30
## Prerequisites to follow this guide
31
31
32
32
* Have an account in https://portal.azure.com.
33
33
* Docker
34
34
* Openssl
35
-
* A local clone of a [GitHub repository](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next)for branch `next` that contains all the configuration files and scripts used on this example.
35
+
* A local clone of a [GitHub repository](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next)(the `next` branch) that contains all the configuration files and scripts used on this example.
36
36
37
37
## Register your app
38
38
@@ -66,8 +66,8 @@ When using **Entra ID as OAuth 2.0 server**, your client app (in our case Rabbit
66
66
67
67
Note the following values, as you will need it later to configure the `rabbitmq_auth_backend_oauth2` on RabbitMQ side:
68
68
69
-
***Directory (tenant ID)**
70
-
***Application (client) ID**
69
+
* Directory (tenant ID)
70
+
* Application (client) ID
71
71
72
72
73
73
## Create OAuth 2.0 roles for your app
@@ -148,6 +148,21 @@ Now that some roles have been created for your application, you still need to as
148
148
149
149
## Create a Scope for Management UI Access
150
150
151
+
So far we have created the roles and granted the roles to the user who is going to
152
+
access the management UI. When this user logs into RabbitMQ management UI, its token
153
+
contains the granted roles.
154
+
155
+
1. Go to **App registrations**.
156
+
2. Click on your application.
157
+
3. Go to **Manage** option on the left menu and choose the option **Expose an API**.
158
+
4. Click on **Add a scope**.
159
+
5. Enter a name, eg. `management-ui`. Enter the same name for **Admin consent display name** and a description and save it.
160
+
7. The scope is named `api://{Application (client) ID}/{scope_name}`.
161
+
162
+
RabbitMQ management ui must provide this scope in `management.oauth_scopes` along with `openid profiles` scopes.
163
+
164
+
## Configure Custom Signing Keys
165
+
151
166
There is one last configuration step required. Without this step, the `access_token` returned
152
167
by **Entra ID** won't be useable with RabbitMQ. More specifically, RabbitMQ will not be able to validate its signature because the `access_token` is meant for Microsoft resources
153
168
@@ -167,15 +182,15 @@ This scope will be used further below in this guide.
167
182
## Configure Custom Signing Keys
168
183
169
184
Creating a signing key for the application is optional. If a custom key is created, RabbitMQ must be configured accordingly.
170
-
In the example below, replace `{Application(client) ID}` with the actual *Application(client) ID*.
171
-
172
-
Without this bit of configuration, the standard `jwks_uri` endpoint will not include the custom signing key
173
-
and therefore RabbitMQ will not find the necessary signing key to validate the token's signature.
185
+
In the following example, replace `{Application(client) ID}` with the actual *Application(client) ID*.
Without this bit of configuration, the standard `jwks_uri` endpoint will not include the custom signing key
192
+
and therefore RabbitMQ will not find the necessary signing key to validate the token's signature.
193
+
179
194
For more information, check out Microsoft Entra documentation about [configuring custom signing keys](https://learn.microsoft.com/en-us/entra/identity-platform/jwt-claims-customization#validate-token-signing-key).
180
195
181
196
@@ -193,9 +208,18 @@ Edit the new `rabbitmq.conf` file and proceed as follows:
193
208
3. If you decide to configure your application with custom signing(s), you need to uncomment the following configuration line. This is required otherwise the `jwks_uri` endpoint announced by the OpenID Discovery endpoint does not contain applications' custom signing keys.
0 commit comments