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
@@ -62,13 +63,18 @@ To understand the details of how to configure RabbitMQ with Oauth2, go to the [U
62
63
63
64
## <aid="getting-started-with-uaa-and-rabbitmq"class="anchor"href="#getting-started-with-uaa-and-rabbitmq">Getting started with UAA and RabbitMQ</a>
64
65
65
-
Before proceed other more sophisiticated examples, let's start RabbitMQ fully configured with OAuth 2.0 plugin and
66
-
UAA as an OAuth 2.0 Authorization Server.
66
+
Before proceeding with other more sophisticated examples, let's start RabbitMQ configured with OAuth 2.0 plugin and
67
+
[UAA](https://docs.cloudfoundry.org/concepts/architecture/uaa.html) as the OAuth 2.0 Authorization Server.
67
68
68
69
In the next section, you
69
70
will see how to set up UAA and RabbitMQ. If you are new to OAuth 2.0, it is a good starting point. If you already know OAuth 2.0
70
-
and you want to learn how to configure RabbitMQ to talk to one of Oauth 2.0 server tested on this tutorial, you can jump
71
-
straight to them. They are [KeyCloak](use-cases/keycloak.md), [https://auth0.com/](use-cases/oauth0.md) and [Azure Active Directory](use-cases/azure.md) in addition to UAA which you will use it in the next sections.
71
+
and you want to learn how to configure RabbitMQ to talk to one of OAuth 2.0 server tested on this tutorial, you can jump
72
+
straight to them. They are:
73
+
74
+
-[KeyCloak](use-cases/keycloak.md)
75
+
-[https://auth0.com/](use-cases/oauth0.md)
76
+
-[Azure Active Directory](use-cases/azure.md)
77
+
-[UAA](#uaa-asymmetrical-signing-keys)
72
78
73
79
74
80
#### <aid="uaa-asymmetrical-signing-keys"class="anchor"href="#uaa-asymmetrical-signing-keys">Use Asymmetrical Digital Singing Keys</a>
@@ -639,6 +645,24 @@ make stop-perftest-producer PRODUCER=producer_with_roles
639
645
make stop-perftest-consumer CONSUMER=consumer_with_roles
RabbitMQ needs to figure out the username associated to the token so that it can display it in the management ui.
651
+
By default, RabbitMQ will first look for the `sub` claim and if it is not found it uses the `client_id`.
652
+
653
+
Most authorization servers return the user's GUID in the `sub` claim rather than the actual user's username or email address, anything the user can relate to. When the `sub` claim does not carry a *user-friendly username*, you can configure one or several claims to extract the username from the token.
RabbitMQ would first look for the `user_name` claim and if it is not found it looks for `email`. Else it uses its default lookup mechanism which first looks for `sub` and then `client_id`.
Copy file name to clipboardExpand all lines: site/oauth2.md
+4
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,7 @@ NOTE: `jwks_url` takes precedence over `signing_keys` if both are provided.
167
167
| `auth_oauth2.resource_server_id` | [The Resource Server ID](#resource-server-id-and-scope-prefixes)
168
168
| `auth_oauth2.resource_server_type` | [The Resource Server Type](#rich-authorization-request)
169
169
| `auth_oauth2.additional_scopes_key` | Configure the plugin to also look in other fields (maps to `additional_rabbitmq_scopes` in the old format).
170
+
| `auth_oauth2.preferred_username_claims` | List of JWT claims to look for username associated to the token
170
171
| `auth_oauth2.default_key` | ID of the default signing key.
171
172
| `auth_oauth2.signing_keys` | Paths to signing key files.
172
173
| `auth_oauth2.jwks_url` | The URL of key server. According to the [JWT Specification](https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.2) key server URL must be https.
@@ -265,6 +268,7 @@ These are the typical permissions examples:
265
268
-`read:vhost1/*`(`read:vhost1/*/*`) - read permissions to any resource on the `vhost1` vhost
266
269
-`read:vhost1/some*` - read permissions to all the resources, starting with `some` on the `vhost1` vhost
267
270
-`write:vhost1/some*/routing*` - topic write permissions to publish to an exchange starting with `some` with a routing key starting with `routing`
271
+
-`read:*/*/*` and `write:*/*/*` - queue binding permissions required to bind a queue on a topic exchange with any routing key
268
272
269
273
See the [wildcard matching test suite](https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_auth_backend_oauth2/test/wildcard_match_SUITE.erl) and [scopes test suite](https://github.com/rabbitmq/rabbitmq-server/blob/main/deps/rabbitmq_auth_backend_oauth2/test/scope_SUITE.erl) for more examples.
0 commit comments