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
+50-6Lines changed: 50 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,26 @@ 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
+
<<<<<<< HEAD
27
28
* Access the management UI via a browser using v2.0 api version
28
29
30
+
=======
31
+
* Access the management UI via a browser.
32
+
>>>>>>> Modify Entra example so that it uses v2.0
29
33
30
34
## Prerequisites to follow this guide
31
35
32
36
* Have an account in https://portal.azure.com.
37
+
<<<<<<< HEAD
33
38
* Docker
34
39
* Openssl
35
40
* A local clone of a [GitHub repository](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial) that contains all the configuration files and scripts used on this example
41
+
=======
42
+
* Docker.
43
+
* Openssl.
44
+
*`git clone https://github.com/rabbitmq/rabbitmq-oauth2-tutorial`. This github repository
45
+
contains all the configuration files and scripts used on this example.
46
+
>>>>>>> Modify Entra example so that it uses v2.0
36
47
37
48
## Register your app
38
49
@@ -66,8 +77,13 @@ When using **Entra ID as OAuth 2.0 server**, your client app (in our case Rabbit
66
77
67
78
Note the following values, as you will need it later to configure the `rabbitmq_auth_backend_oauth2` on RabbitMQ side:
68
79
80
+
<<<<<<< HEAD
69
81
* **Directory (tenant ID)**
70
82
* **Application (client) ID**
83
+
=======
84
+
* Directory (tenant ID)
85
+
* Application (client) ID
86
+
>>>>>>> Modify Entra example so that it uses v2.0
71
87
72
88
73
89
## Create OAuth 2.0 roles for your app
@@ -146,7 +162,26 @@ Now that some roles have been created for your application, you still need to as
146
162
147
163
9. Repeat the operations for all the roles you want to assign.
148
164
165
+
<<<<<<< HEAD
149
166
## Create a Scope for Management UI Access
167
+
=======
168
+
## Create scope required by Management ui during authorization
169
+
170
+
So far we have created the roles and granted the roles to the user who is going to
171
+
access the management UI. When this user logs into RabbitMQ management UI, its token
172
+
contains the granted roles.
173
+
174
+
1. Go to **App registrations**.
175
+
2. Click on your application.
176
+
3. Go to **Manage** option on the left menu and choose the option **Expose an API**.
177
+
4. Click on **Add a scope**.
178
+
5. Enter a name, eg. `management-ui`. Enter the same name for **Admin consent display name** and a description and save it.
179
+
7. The scope is named `api://{Application (client) ID}/{scope_name}`.
180
+
181
+
RabbitMQ management ui must provide this scope in `management.oauth_scopes` along with `openid profiles` scopes.
182
+
183
+
## Configure Custom Signing Keys
184
+
>>>>>>> Modify Entra example so that it uses v2.0
150
185
151
186
There is one last configuration step required. Without this step, the `access_token` returned
152
187
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
@@ -167,15 +202,15 @@ This scope will be used further below in this guide.
167
202
## Configure Custom Signing Keys
168
203
169
204
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.
205
+
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
212
+
and therefore RabbitMQ will not find the necessary signing key to validate the token's signature.
213
+
179
214
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
215
181
216
@@ -193,9 +228,18 @@ Edit the new `rabbitmq.conf` file and proceed as follows:
193
228
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