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
+23-16Lines changed: 23 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,13 +24,13 @@ limitations under the License.
24
24
Demonstrate how to authenticate using the OAuth 2.0 protocol
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
31
31
* Have an account in https://portal.azure.com.
32
-
* Docker
33
-
* Openssl
32
+
* Docker.
33
+
* Openssl.
34
34
*`git clone https://github.com/rabbitmq/rabbitmq-oauth2-tutorial`. This github repository
35
35
contains all the configuration files and scripts used on this example.
36
36
@@ -69,14 +69,6 @@ When using **Entra ID as OAuth 2.0 server**, your client app (in our case Rabbit
69
69
* Directory (tenant ID)
70
70
* Application (client) ID
71
71
72
-
6. Click on the **Endpoints** tab if it is visible.
73
-
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.
74
-
75
-
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.
76
-
77
-

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