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
+10-4Lines changed: 10 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,12 +195,9 @@ For that, you will need the following values from the previous steps:
195
195
***okta-Issuer**: the **default Authorization server**
196
196
***okta-Metadata-URI**: the **default Authorization server**
197
197
198
-
Copy [rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/main/conf/okta/rabbitmq.conf.tmpl) from the tutorial repository
198
+
Copy [rabbitmq.conf.tmpl](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/okta/rabbitmq.conf.tmpl) from the tutorial repository
199
199
to `rabbitmq.conf`. It must be in the same directory as `rabbitmq.conf.tmpl`.
200
200
201
-
There is a second configuration file, [advanced.config](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/main/conf/okta/advanced.config),
202
-
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.
203
-
204
201
Edit `rabbitmq.conf` and proceed as follows:
205
202
206
203
1. Replace `{okta_client_app_ID}` with your **okta_client_app_ID**
@@ -210,6 +207,15 @@ or `{okta-issuer}/.well-known/openid-configuration`
210
207
4. Else you need to determine the path that follows the uri in `{okta-issuer}` and update
211
208
`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`.
212
209
210
+
The mapping of the roles configured in okta, i.e. `monitoring` and `admin`, are configured
211
+
at the bottom of the `rabbitmq.conf` file. Here it is configuration for convenience:
This is the configuration required to map those custom scopes to RabbitMQ scopes.
591
553
554
+
:::tip
555
+
Since RabbitMQ 4.1, it is possible to configure **scope aliases** using the [ini-like](./configure#config-file) configuration style. Earlier versions only supported
556
+
the legacy Erlang-style.
557
+
:::
592
558
593
559
```ini
594
-
# ...
595
-
auth_oauth2.resource_server_id=rabbitmq
596
-
auth_oauth2.additional_scopes_key=roles
597
-
# ...
598
-
```
599
-
600
-
Withthisconfiguration, RabbitMQexpects*customscopes*inthefield `roles` and
-[conf/uaa/scope-aliases.conf](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/blob/next/conf/uaa/scope-aliases.conf): configures a set of scope aliases.
583
+
-[conf/uaa/rabbitmq.conf](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/blob/next/conf/uaa/rabbitmq.conf) : configure the rest of oauth2 configuration in addition to configuring `extra_scope` as another claim from where to read scopes from
643
584
644
585
645
586
#### Demo 1: Launch RabbitMQ with custom scopes in scope field
| `auth_oauth2.resource_server_id` | The [Resource Server ID](#resource-server-id)
148
148
| `auth_oauth2.resource_server_type` | The Resource Server Type required when using [Rich Authorization Request](#rich-authorization-request) token format
149
-
|`auth_oauth2.additional_scopes_key`| Configure the plugin to look for scopes in other fields (maps to `additional_rabbitmq_scopes` in the old format) |
150
-
|`auth_oauth2.scope_prefix`|[Configure the prefix for all scopes](#scope-prefix). The default value is `auth_oauth2.resource_server_id` followed by the dot `.` character |
151
-
| `auth_oauth2.preferred_username_claims` | [List of the JWT claims](#preferred-username-claims) to look for the username associated with the token
152
-
| `auth_oauth2.default_key` | ID of the default signing key
153
-
| `auth_oauth2.signing_keys` | Paths to the [signing key files](#signing-key-files)
154
-
| `auth_oauth2.issuer` | The [issuer URL](#configure-issuer) of the authorization server. Used to build the discovery endpoint URL to discover other endpoints such as such as `jwks_uri`. Management UI users will be sent to this for logging in
155
-
| `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
156
-
| `auth_oauth2.discovery_endpoint_params` | [List of HTTP query parameters](#discovery-endpoint-params) sent to the OpenId discovery endpoint
157
-
| `auth_oauth2.jwks_url` | 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 use "https" for schema. Optional if you set `auth_oauth2.issuer`. If this URL is set, it overrides the `jwks_uri` discovered via the discovery endpoint
158
-
| `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
159
-
| `auth_oauth2.https.cacertfile` | Path to a file containing PEM-encoded CA certificates. The CA certificates are used to connect to any of these endpoints: `jwks_url`, `token_endpoint`, or the discovery endpoint
160
-
| `auth_oauth2.https.depth` | The maximum number of non-self-issued intermediate certificates that may follow the peer certificate in a valid [certification path](ssl#peer-verification-depth). The default value is 10
149
+
|`auth_oauth2.additional_scopes_key`| Configure the plugin to look for scopes in other fields (maps to `additional_rabbitmq_scopes` in the old format). |
150
+
| `auth_oauth2.scope_prefix` | [Configure the prefix for all scopes](#scope-prefix). The default value is `auth_oauth2.resource_server_id` followed by the dot `.` character.
151
+
| `auth_oauth2.scope_aliases` | [Configure scope aliases](#scope-aliases). See this [example](./oauth2-examples#using-scope-aliases).
152
+
| `auth_oauth2.preferred_username_claims` | [List of the JWT claims](#preferred-username-claims) to look for the username associated with the token.
153
+
| `auth_oauth2.default_key` | ID of the default signing key.
154
+
| `auth_oauth2.signing_keys` | Paths to the [signing key files](#signing-key-files).
155
+
| `auth_oauth2.issuer` | The [issuer URL](#configure-issuer) of the authorization server that is used to discover endpoints such as `jwk_uri` and others (https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata).
156
+
| `auth_oauth2.jwks_url` | 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.
157
+
| `auth_oauth2.token_endpoint` | The URL of the OAuth 2.0 token endpoint.
158
+
| `auth_oauth2.https.cacertfile` | Path to a file containing PEM-encoded CA certificates. The CA certificates are used to connect to any of these endpoints: `jwks_url`, `token_endpoint`, or the `issuer`.
159
+
| `auth_oauth2.https.depth` | The maximum number of non-self-issued intermediate certificates that may follow the peer certificate in a valid [certification path](ssl#peer-verification-depth). The default value is 10.
161
160
| `auth_oauth2.https.peer_verification` | Configures [peer verification](ssl#peer-verification). Available values: `verify_none`, `verify_peer`. The default value is `verify_peer` if there are trusted CA installed in the OS or `auth_oauth2.https.cacertfile` is set. <p/> **Deprecated**: This variable will be soon replaced by `auth_oauth2.https.verify`. Users should stop using this variable.
162
161
| `auth_oauth2.https.fail_if_no_peer_cert` | Used together with `auth_oauth2.https.peer_verification = verify_peer`. When set to `true`, TLS connection will be rejected if the client fails to provide a certificate. The default value is `false`
163
162
| `auth_oauth2.https.hostname_verification` | Enable wildcard-aware hostname verification for key server. Available values: `wildcard`, `none`. The default value is `none`
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).
@@ -242,12 +277,13 @@ Each `auth_oauth2.resource_servers.<id/index>.` entry has the following variable
242
277
| `resource_server_type` | The Resource Server Type required when using [Rich Authorization Request](#rich-authorization-request) token format.
243
278
| `additional_scopes_key` | Configure the plugin to look for scopes in other fields (maps to `additional_rabbitmq_scopes` in the old format).
244
279
| `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.
246
282
| `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.
247
283
248
284
All available configurable parameters for each OAuth 2 provider is documented [in a separate section](#multiple-oauth-providers-configuration).
249
285
250
-
Usually, a numeric value is used as `index`, for example `auth_oauth2.resource_servers.1.id = rabbit_prod`. However, it can be any string, for example `auth_oauth2.resource_servers.rabbit_prod.jwks_url = http://some_url`. By default, the `index` is the resource server's id. However, you can override it via the `id` variable like in `auth_oauth2.resource_servers.1.id = rabbit_prod`.
286
+
Usually, a numeric value is used as `index`, for example `auth_oauth2.resource_servers.1.id = rabbit_prod`. However, it can be any string, for example `auth_oauth2.resource_servers.rabbit_prod.issuer = http://some_url`. By default, the `index` is the resource server's id. However, you can override it via the `id` variable like in `auth_oauth2.resource_servers.1.id = rabbit_prod`.
251
287
252
288
Here is an example which configures two resources (`prod` and `dev`) which are used by the users and clients managed by
253
289
the same identity provider whose issuer url is `https://my-idp.com/`:
0 commit comments