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-okta.md
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,11 +186,14 @@ This is totally optional but it can save you time.
186
186
187
187
## Configure RabbitMQ to use Okta as OAuth 2.0 Authentication Backend
188
188
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:
189
+
The configuration on the Okta side is now done. The next step is to configure RabbitMQ
190
+
to use the resources created earlier.
190
191
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**.
192
+
The following values will be necessary during the next steps:
193
+
194
+
***okta_client_app_ID**: the Okta app registered above to be used with RabbitMQ
195
+
***okta-Issuer**: the **default Authorization server**
196
+
***okta-Metadata-URI**: the **default Authorization server**
194
197
195
198
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`).
196
199
There is a second configuration file, [advanced.config](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/okta/advanced.config),
@@ -205,6 +208,15 @@ or `{okta-issuer}/.well-known/openid-configuration`
205
208
4. Else you need to determine the path that follows the uri in `{okta-issuer}` and update
206
209
`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`.
207
210
211
+
The mapping of the roles configured in Okta, such as `monitoring` and `admin`, are configured
212
+
at the bottom of the `rabbitmq.conf` file. For example:
This is the configuration required to map those custom scopes to RabbitMQ scopes.
589
551
552
+
:::tip
553
+
Since RabbitMQ 4.1, it is possible to configure **scope aliases** using the [ini-like](./configure#config-file) configuration style. Earlier versions only supported
554
+
the legacy Erlang-style.
555
+
:::
590
556
591
557
```ini
592
-
# ...
593
-
auth_oauth2.resource_server_id=rabbitmq
594
-
auth_oauth2.additional_scopes_key=roles
595
-
# ...
596
-
```
597
-
598
-
Withthisconfiguration, RabbitMQexpects*customscopes*inthefield `roles` and
More detail is included in the next section about what happens during the authentication and how to configure OAuth 2.0 beyond the basic configuration shown previously.
118
118
119
-
###Authorization Flow {#authorization-flow}
119
+
## Authorization Flow {#authorization-flow}
120
120
121
121
This plugin does not communicate with any OAuth 2.0 provider in order to authenticate user and grants access. Instead, it decodes an access token provided by the client and authorises a user based on the scopes found in the token.
122
122
@@ -138,7 +138,7 @@ In chronological order, here is the sequence of events that occur when a client
138
138
5. RabbitMQ validates that the token has the **audience** claim and whose value matches the `resource_server_id` (this operation can be deactivated by setting `auth_oauth2.verify_aud` to `false`).
139
139
6. RabbitMQ translates the **scopes** found in the token into RabbitMQ **permissions** (the same permissions used in the RabbitMQ's internal database).
140
140
141
-
###Variables configurable in rabbitmq.conf {#variables-configurable}
141
+
## Variables Configurable in rabbitmq.conf {#variables-configurable}
@@ -150,8 +150,6 @@ In chronological order, here is the sequence of events that occur when a client
150
150
| `auth_oauth2.default_key` | ID of the default signing key.
151
151
| `auth_oauth2.signing_keys` | Paths to the [signing key files](#signing-key-files).
152
152
| `auth_oauth2.issuer` | The [issuer URL](#configure-issuer) of the authorization server that is used to either discover endpoints such as `jwks_uri` and/or where to redirect RabbitMQ management users to login and get a token.
153
-
| `auth_oauth2.discovery_endpoint_path` | The path used for the [OpenId discovery endpoint](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata). The endpoint URI is built using `auth_oauth2.issuer`, this path or else the default path `.well-known/openid-configuration` followed by query parameters configured in the following variable
154
-
| `auth_oauth2.discovery_endpoint_params` | [List of HTTP query parameters](#discovery-endpoint-params) sent to the OpenId discovery endpoint.
155
153
| `auth_oauth2.jwks_uri` | The URL of the [JWKS endpoint](#jwks-endpoint). According to the [JWT Specification](https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.2), the endpoint URL must be https. Optional if you set `auth_oauth2.issuer`. If this URL is set, it overrides the `jwks_uri` discovered via the discovery endpoint.
156
154
| `auth_oauth2.jwks_url` | This variable is **deprecated** and you should use instead `auth_oauth2.jwks_uri`. In RabbitMQ 4.2.0, this variable will be removed. In the meantime, RabbitMQ supports it until you change your configuration.
157
155
| `auth_oauth2.token_endpoint` | The URL of the OAuth 2.0 token endpoint. Optional if you set `auth_oauth2.issuer`. If this URL is set, it overrides the `token_endpoint` discovered via the discovery endpoint.
@@ -168,7 +166,7 @@ In chronological order, here is the sequence of events that occur when a client
168
166
| `auth_oauth2.default_oauth_provider` | ID of the OAuth 2.0 provider used for the `auth_oauth2.resource_servers`, that did not specify any (via the variable `oauth_provider_id`) or when `auth_oauth2.jwks_uri` and `auth_oauth2.issuer` are both missing.
169
167
170
168
171
-
####Resource Server ID {#resource-server-id}
169
+
## Resource Server ID {#resource-server-id}
172
170
173
171
A RabbitMQ cluster must have at least one resource server identifier configured. If it has just one resource, this is configured in the `auth_oauth2.resource_server_id` variable and it is **mandatory**.
174
172
If the RabbitMQ cluster has more than one OAuth resource then they are configured under `auth_oauth2.resource_servers.<index>` and in this case `auth_oauth2.resource_server_id` variable is not mandatory.
@@ -177,7 +175,7 @@ RabbitMQ uess the resource server identity for these two purposes:
177
175
- To validate the token's audience (`aud`) whose value must contain the resource server identifier. This validation can be disabled though.
178
176
- To initiate the OAuth 2.0 Authorization Code flow in the Management UI. This is the flow used to authenticate a user and to get its access token. RabbitMQ must include the resource server identifier in the request's attribute called `resource`.
179
177
180
-
####Scope prefix {#scope-prefix}
178
+
## Scope Prefix {#scope-prefix}
181
179
182
180
OAuth 2.0 tokens use scopes to communicate what set of permissions particular client are granted. The scopes are free form strings.
The following configuration declares two signing keys and configures the kid of the default signing key. For more information check the section [Configure Signing keys](#configure-signing-keys).
The following configuration sets the JWKS endpoint from which RabbitMQ downloads the signing keys using the configured CA certificate and TLS variables.
Each `auth_oauth2.resource_servers.<id/index>.` entry has the following variables shown in the table below. Except for the variables `id` and `oauth_provider_id`, if a resource does not configure a variable, RabbitMQ uses the variable configured at the root level. For instance, if the resource `auth_oauth2.resource_servers.prod` does not configure `preferred_username_claims` variable, RabbitMQ uses the value configured in `auth_oauth2.preferred_username_claims` for the resource `prod`.
237
284
@@ -241,6 +288,7 @@ Each `auth_oauth2.resource_servers.<id/index>.` entry has the following variable
241
288
| `resource_server_type` | The Resource Server Type required when using [Rich Authorization Request](#rich-authorization-request) token format.
242
289
| `additional_scopes_key` | Configure the plugin to look for scopes in other fields (maps to `additional_rabbitmq_scopes` in the old format).
243
290
| `scope_prefix` | [Configure the prefix for all scopes](#scope-prefix). The default value is `auth_oauth2.resource_server_id` followed by the dot `.` character.
| `preferred_username_claims` | [List of the JWT claims](#preferred-username-claims) to look for the username associated with the token separated by commas.
245
293
| `oauth_provider_id` | The identifier of the OAuth Provider associated to this resource. RabbitMQ uses the signing keys issued by this OAuth Provider to validate tokens whose audience matches this resource's id.
246
294
@@ -259,7 +307,7 @@ auth_oauth2.resource_servers.2.id = dev
259
307
260
308
See the advanced usage section called [Multiple Resource Servers](#multiple-resource-servers) for more information on how to configure them.
Copy file name to clipboardExpand all lines: versioned_docs/version-3.13/oauth2-examples-okta.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,14 +150,15 @@ Once you've added the user to the appropriate groups and apps, they should have
150
150
151
151
## Configure RabbitMQ to use Okta as OAuth 2.0 Authentication Backend
152
152
153
-
The configuration on Okta side is done. You now have to configure RabbitMQ to use the resources you just created.
153
+
The configuration on the Okta side is now done. The next step is to configure RabbitMQ
154
+
to use the resources created earlier.
154
155
155
156
[rabbitmq.conf](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/main/conf/okta/rabbitmq.conf) is a RabbitMQ configuration to **enable okta as OAuth 2.0 authentication backend** for the RabbitMQ OAuth2 and Management plugins. And [advanced.config](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/main/conf/okta/advanced.config) is the RabbitMQ advanced configuration that maps RabbitMQ scopes to the permissions previously configured in Okta.
156
157
157
-
Update it with the following values (you should have noted these in the previous steps):
158
+
Update it with the following values from the earlier steps:
158
159
159
-
-**okta-domain-name** associated to your okta domain name.
160
-
-**okta_client_app_ID** associated to the okta app that you registered in okta for rabbitMQ.
160
+
***okta-domain-name**: the Okta domain name
161
+
***okta_client_app_ID**: the Okta app registered above to be used with RabbitMQ
0 commit comments