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-keycloak.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,14 @@ make start-rabbitmq
69
69
RabbitMQ is deployed with TLS enabled and Keycloak is configured with the corresponding `redirect_url` which uses https.
70
70
:::
71
71
72
+
:::important
73
+
RabbitMQ is configured to read the scopes from the custom claim [extra_scope](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/blob/next/conf/keycloak/rabbitmq.conf#L11) and
74
+
by default from the standard claim `scope`.
75
+
However, if your scopes are deep in a map/list structure like `authorization.permissions.scopes`
76
+
or under `realm_access.roles` or `resource_access.account.roles`, you can configure
77
+
RabbitMQ to use those locations instead. See the section [Use a different token field for the scope](./oauth2#use-different-token-field) for more information.
78
+
:::
79
+
72
80
## Access Management api
73
81
74
82
To access the management api run the following command. It uses the client [mgt_api_client](https://keycloak:8443/admin/master/console/#/test/clients/c5be3c24-0c88-4672-a77a-79002fcc9a9d/settings) which has the scope [rabbitmq.tag:administrator](https://keycloak:8443/admin/master/console/#/test/client-scopes/f6e6dd62-22bf-4421-910e-e6070908764c/settings).
| `auth_oauth2.resource_server_id` | The [Resource Server ID](#resource-server-id)
146
146
| `auth_oauth2.resource_server_type` | The Resource Server Type required when using [Rich Authorization Request](#rich-authorization-request) token format
147
-
|`auth_oauth2.additional_scopes_key`| Configure the plugin to look for scopes in other fields (maps to `additional_rabbitmq_scopes` in the old format). |
147
+
|`auth_oauth2.additional_scopes_key`|[Configure](#use-different-token-field) the plugin to look for scopes in other fields. |
148
148
|`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. |
149
149
| `auth_oauth2.preferred_username_claims` | [List of the JWT claims](#preferred-username-claims) to look for the username associated with the token.
150
150
| `auth_oauth2.default_key` | ID of the default signing key.
@@ -252,9 +252,6 @@ The following configuration declares two signing keys and configures the kid of
@@ -571,26 +568,116 @@ If a symmetric key is used, the configuration looks like this:
571
568
572
569
### Use a different token field for the scope {#use-different-token-field}
573
570
574
-
By default the plugin looks for the `scope` key in the token, you can configure the plugin to also look in other fields using the `extra_scopes_source` variable. Values format accepted are scope as **string** or **list**
571
+
The plugin always extracts the scopes from the `scope` claim. However,
572
+
you can also configure the plugin to look in other claims using the `auth_oauth2.additional_scopes_key` variable.
0 commit comments