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/management/index.md
+11-19Lines changed: 11 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -414,6 +414,10 @@ Given above configuration, when a user visits the management UI, the following t
414
414
If you used to configure `management.oauth_metadata_url` because your provider did not use the standard OpenId Discovery endpoint's path, since RabbitMQ 4.1 you should instead configure the correct path as it is explained [here](./oauth2#discovery-endpoint-params).
415
415
:::
416
416
417
+
:::tip
418
+
If you used to configure `auth_oauth2.metadata_url` because your provider used a slightly different OpenId Discovery endpoint url, since RabbitMQ 4.1 you should instead configure the correct path and/or include any additional parameters. Please read [this section of the documentation](./oauth2#discovery-endpoint-params) where it is explained how to do it. `auth_oauth2.metadata_url` may be deprecated in future versions.
419
+
:::
420
+
417
421
2. RabbitMQ displays a button with the label "Click here to login". When the user clicks on the button, the management UI initiates the OAuth 2.0 Authorization Code Flow, which redirects the user to the identity provider to authenticate and get a token.
@@ -510,29 +514,18 @@ RabbitMQ 3.13.1 and earlier versions require the [OpenId Connect Discovery endpo
510
514
There are other two additional scenarios which can trigger a logout. One scenario occurs when the OAuth Token expires. Although RabbitMQ renews the token in the background before it expires, if the token expires, the user is logged out.
511
515
The second scenario is when the management UI session exceeds the maximum allowed time configured on the [Login Session Timeout](#login-session-timeout).
512
516
513
-
### Configure Extra URI Parameters for Authorization and Token Endpoints {#extra-endpoint-params}
517
+
### Configure extra parameters for authorization and token endpoints {#extra-endpoint-params}
514
518
515
-
Some OAuth 2.0 providers require additional URI parameters to be included into the request sent to the **authorization endpoint** and/or to the **token endpoint**.
516
-
These parameters are vendor- or IDP installation-specific. The Management UI already sends all the parameters required by the OAuth 2.0 Authorization Code flow.
519
+
There are some OAuth 2.0 providers which require extra parameters in the request sent to the **authorization endpoint** and/or to the **token endpoint**. These parameters are custom parameters. The Management UI already sends all the parameters required by the OAuth 2.0 Authorization Code flow.
517
520
518
-
In the followingexample an extra URI parameter called `audience`is added for both the **authorization** and **token**endpoints:
521
+
Here is an example of setting an extra parameter called `audience` for both endpoints, the **authorization** and **token**endpoint:
### Configure Extra URI Parameters for Authorization and Token Endpoints {#extra-endpoint-params}
625
+
####Configure extra parameters for authorization and token endpoints
633
626
634
-
Some OAuth 2.0 providers require additional URI parameters to be included into the request sent to the **authorization endpoint** and/or to the **token endpoint**.
635
-
These parameters are vendor- or IDP installation-specific. The Management UI already sends all the parameters required by the OAuth 2.0 Authorization Code flow.
627
+
There are some OAuth 2.0 providers which require extra parameters in the request sent to the **authorization endpoint** and/or to the **token endpoint**. These parameters are custom parameters and specified per resource. The Management UI already sends all the parameters required by the OAuth 2.0 Authorization Code flow.
636
628
637
-
The following example sets an extra URI parameter called `audience` for both endpoints for the resource `some-resource-id`:
629
+
Here is an example of setting an extra parameter called `audience` for both endpoints for the resource `some-resource-id`:
Copy file name to clipboardExpand all lines: docs/oauth2-examples-auth0.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,8 +99,7 @@ To configure RabbitMQ you need to gather the following information from Auth0:
99
99
4. And take note of the *Domain* value
100
100
5. Use the last values in *Client ID* and *Domain* fields in the RabbitMQ configuration file
101
101
102
-
Copy [conf/auth0/rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/blob/main/conf/auth0/rabbitmq.conf.tmpl) as `rabbitmq.conf`.
103
-
It must be in same folder as `rabbitmq.conf.tmpl`.
102
+
Clone the configuration file [conf/auth0/rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/blob/main/conf/auth0/rabbitmq.conf.tmpl) as `rabbitmq.conf` (in the same folder as `rabbitmq.conf.tmpl`).
Copy file name to clipboardExpand all lines: docs/oauth2-examples-entra-id/index.md
+63-8Lines changed: 63 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,36 @@ and Microsoft Entra ID as Authorization Server using the following flows:
26
26
27
27
* Access the management UI via a browser using Entra ID (API version 2.0)
28
28
29
+
<<<<<<< HEAD
30
+
||||||| parent of 7839e208 (Explain how to configure extra params for authorize and token endpoints)
31
+
=======
32
+
* Access the management UI via a browser.
33
+
>>>>>>> Modify Entra example so that it uses v2.0
34
+
=======
35
+
=======
36
+
* Access the management UI via a browser using v2.0 api version
37
+
38
+
>>>>>>> Explain how to configure extra params for authorize and token endpoints
39
+
>>>>>>> 7839e208 (Explain how to configure extra params for authorize and token endpoints)
29
40
30
41
## Prerequisites to follow this guide
31
42
32
43
* Have an account in https://portal.azure.com.
33
44
* Docker
34
45
* Openssl
46
+
<<<<<<< HEAD
35
47
* 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.
48
+
||||||| parent of 7839e208 (Explain how to configure extra params for authorize and token endpoints)
49
+
* 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
50
+
=======
51
+
* Docker.
52
+
* Openssl.
53
+
*`git clone https://github.com/rabbitmq/rabbitmq-oauth2-tutorial`. This github repository
54
+
contains all the configuration files and scripts used on this example.
55
+
>>>>>>> Modify Entra example so that it uses v2.0
56
+
=======
57
+
* 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
58
+
>>>>>>> 7839e208 (Explain how to configure extra params for authorize and token endpoints)
36
59
37
60
## Register your app
38
61
@@ -66,8 +89,21 @@ When using **Entra ID as OAuth 2.0 server**, your client app (in our case Rabbit
66
89
67
90
Note the following values, as you will need it later to configure the `rabbitmq_auth_backend_oauth2` on RabbitMQ side:
68
91
92
+
<<<<<<< HEAD
69
93
* Directory (tenant ID)
70
94
* Application (client) ID
95
+
||||||| parent of 7839e208 (Explain how to configure extra params for authorize and token endpoints)
96
+
<<<<<<< HEAD
97
+
* **Directory (tenant ID)**
98
+
* **Application (client) ID**
99
+
=======
100
+
* Directory (tenant ID)
101
+
* Application (client) ID
102
+
>>>>>>> Modify Entra example so that it uses v2.0
103
+
=======
104
+
* **Directory (tenant ID)**
105
+
* **Application (client) ID**
106
+
>>>>>>> 7839e208 (Explain how to configure extra params for authorize and token endpoints)
71
107
72
108
73
109
## Create OAuth 2.0 roles for your app
@@ -146,11 +182,20 @@ Now that some roles have been created for your application, you still need to as
146
182
147
183
9. Repeat the operations for all the roles you want to assign.
148
184
185
+
<<<<<<< HEAD
186
+
## Create a Scope for Management UI Access
187
+
||||||| parent of 7839e208 (Explain how to configure extra params for authorize and token endpoints)
188
+
<<<<<<< HEAD
149
189
## Create a Scope for Management UI Access
190
+
=======
191
+
## Create scope required by Management ui during authorization
192
+
=======
193
+
## Create scope required by Management UI during authorization
194
+
>>>>>>> 7839e208 (Explain how to configure extra params for authorize and token endpoints)
150
195
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.
196
+
There is one last configuration step required. Without this step, the `access_token` returned
197
+
by **Entra ID** is invalid. RabbitMQ cannot validate its signature because the `access_token` is meant for Microsoft resources.
198
+
First, you need to create a scope associated to the application you registered for RabbitMQ management UI as follows:
154
199
155
200
1. Go to **App registrations**.
156
201
2. Click on your application.
@@ -159,7 +204,7 @@ contains the granted roles.
159
204
5. Enter a name, eg. `management-ui`. Enter the same name for **Admin consent display name** and a description and save it.
160
205
7. The scope is named `api://{Application (client) ID}/{scope_name}`.
161
206
162
-
RabbitMQ management ui must provide this scope in `management.oauth_scopes` along with `openid profiles` scopes.
207
+
Check out the last section to see how this scope is used to configure RabbitMQ.
163
208
164
209
## Configure Custom Signing Keys
165
210
@@ -188,18 +233,27 @@ In the following example, replace `{Application(client) ID}` with the actual *Ap
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.
236
+
It is optional to create a signing key for your application. If you create one though, you must add the following RabbitMQ configuration. You need to replace `{Application(client) ID}` with your *Application(client) ID*. Without this configuration, 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.
193
237
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).
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).
196
243
197
244
## Configure RabbitMQ to Use Entra ID as OAuth 2.0 Authentication Backend
198
245
199
246
The configuration on **Entra ID** side is done. Next, configure RabbitMQ to use these resources.
200
247
248
+
<<<<<<< HEAD
201
249
Clone [rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/entra/rabbitmq.conf.tmpl) from the tutorial repository
202
250
to `rabbitmq.conf`. It must be in the same directory as `rabbitmq.conf.tmpl`.
251
+
||||||| parent of 7839e208 (Explain how to configure extra params for authorize and token endpoints)
252
+
Clone [rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/main/conf/entra/rabbitmq.conf.tmpl) from the tutorial repository
253
+
to `rabbitmq.conf`. It must be in the same directory as `rabbitmq.conf.tmpl`.
254
+
=======
255
+
Clone the file called [rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/main/conf/entra/rabbitmq.conf.tmpl) as `rabbitmq.conf` (in the same folder as `rabbitmq.conf.tmpl`).
256
+
>>>>>>> 7839e208 (Explain how to configure extra params for authorize and token endpoints)
203
257
204
258
Edit the new `rabbitmq.conf` file and proceed as follows:
Run the following commands to run RabbitMQ docker image:
@@ -231,7 +286,7 @@ make start-rabbitmq
231
286
```
232
287
233
288
This starts a Docker container named `rabbitmq`, with RabbitMQ Management UI/API with HTTPS enabled, and configured to use your Entra ID as OAuth 2.0 authentication backend,
234
-
based on the values set in `rabbitmq.conf` in the previous steps of this tutorial.
289
+
based on the information you provided in `rabbitmq.conf` in the previous steps of this tutorial.
235
290
236
291
## Automatic generation of a TLS Certificate and Key Pair
Copy file name to clipboardExpand all lines: docs/oauth2-examples-okta.md
+21-32Lines changed: 21 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,35 +170,31 @@ Once you've added the user to the appropriate groups and apps, they should have
170
170
171
171
This step is necessary otherwise the tokens do not carry any of the scopes granted to the users.
172
172
173
-
1.[Create an access policy](https://developer.okta.com/docs/guides/customize-authz-server/main/#create-access-policies)
174
-
2.[Create a rule](https://developer.okta.com/docs/guides/customize-authz-server/main/#create-rules-for-each-access-policy) for the access policy
173
+
1. Create access policy following these [instructions](https://developer.okta.com/docs/guides/customize-authz-server/main/#create-access-policies).
174
+
2. Create rule for the access policy following these [instructions](https://developer.okta.com/docs/guides/customize-authz-server/main/#create-rules-for-each-access-policy).
175
175
176
-
## [Optional] Test the Tokens Issued by Okta
176
+
## [Optional] Test the tokens issued by Okta
177
177
178
-
This step is optional but highly recommended.
178
+
This is totally optional but it can save you time.
179
179
180
-
1. Go to the **default Authorization Server**
181
-
2. Click on **Token Preview** tab
182
-
3. Fill in all the fields. For **grant type** choose `Authorization Code`
183
-
4. Click on **Preview Token** button
184
-
5. Check the claim `role` to see if it contains the roles assigned earlier in this guide
180
+
1. Go to the **default Authorization Server**.
181
+
2. Click on **Token Preview** tab.
182
+
3. Fill in all the fields. For **grant type** choose `Authorization Code`.
183
+
4. Click on **Preview Token** button.
184
+
5. Check the claim `role` to see if it contains the roles you assigned to your user.
185
185
186
186
187
187
## Configure RabbitMQ to use Okta as OAuth 2.0 Authentication Backend
188
188
189
-
The configuration on the Okta side is done. Next, configure RabbitMQ to use the resources created above.
189
+
The configuration on Okta side is done. You now have to configure RabbitMQ to use the resources you just created. You took note of the following values:
190
190
191
-
For that, you will need the following values from the previous steps:
192
-
193
-
***okta_client_app_ID**: the ID of the app registered in Okta to be used with RabbitMQ
194
-
***okta-Issuer**: the **default Authorization server**
195
-
***okta-Metadata-URI**: the **default Authorization server**
196
-
197
-
Copy [rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/okta/rabbitmq.conf.tmpl) from the tutorial repository
198
-
to `rabbitmq.conf`. It must be in the same directory as `rabbitmq.conf.tmpl`.
191
+
-**okta_client_app_ID** associated to the okta app that you registered in okta for rabbitMQ.
192
+
-**okta-Issuer** associated to the **default Authorization server**.
193
+
-**okta-Metadata-URI** associated to the **default Authorization server**.
199
194
195
+
Clone [rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/okta/rabbitmq.conf.tmpl) as `rabbitmq.conf` (in the same folder as `rabbitmq.conf.tmpl`).
200
196
There is a second configuration file, [advanced.config](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/okta/advanced.config),
201
-
that will not need any modifications. This is the RabbitMQ [advanced configuration file](./configure/) where RabbitMQ scopes are mapped to the permissions previously configured in Okta.
197
+
that you keep it as it is. This is the RabbitMQ advanced configuration that maps RabbitMQ scopes to the permissions previously configured in Okta.
202
198
203
199
Edit `rabbitmq.conf` and proceed as follows:
204
200
@@ -210,21 +206,14 @@ or `{okta-issuer}/.well-known/openid-configuration`
210
206
`auth_oauth2.discovery_endpoint_path` accordingly. For instance, if **okta-Metadata-URI** is `{okta-issuer}/some-other-endpoint`, you update `auth_oauth2.discovery_endpoint_path` with the value `some-other-endpoint`.
211
207
212
208
213
-
### About the OpenId Discovery Endpoint
214
-
215
-
RabbitMQ uses the standard OpenId discovery endpoint path `.well-known/openid-configuration`. Okta supports this path in addition to `.well-known/oauth-authorization-server`.
216
-
The only difference observed between the two endpoints is that the latter returns more values in the `claims_supported` JSON field.
209
+
### About OpenId Discovery Endpoint
217
210
218
-
The RabbitMQ's template configuration provided in the snippet below has this line.
219
-
This means that RabbitMQ will use the standard path.
211
+
RabbitMQ uses the standard OpenId discovery endpoint path `.well-known/openid-configuration`. Okta supports this path in addition to `.well-known/oauth-authorization-server`. The only difference observed at the time of writing this guide is that the latter returns more values in the json attribute `claims_supported`.
220
212
221
-
If the default does not work as expected, try uncommenting this line to use
222
-
the alternative path.
223
-
224
-
```ini
225
-
## Uncomment to use '.well-known/oauth-authorization-server' as the discovery
0 commit comments