Skip to content

Commit 8fbca2a

Browse files
Backport #2041 to 3.13
1 parent e102535 commit 8fbca2a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

docs/oauth2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@ By default, RabbitMQ searches for the `sub` claim first, and if it is not found,
564564
Most authorization servers return the user's GUID in the `sub` claim instead of the 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.
565565
566566
Example `rabbitmq.conf` configuration:
567-
```
567+
568+
``` ini
568569
# ...
569570
auth_oauth2.resource_server_id = rabbitmq
570571
auth_oauth2.preferred_username_claims.1 = user_name

versioned_docs/version-3.13/oauth2.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -563,14 +563,14 @@ By default, RabbitMQ searches for the `sub` claim first, and if it is not found,
563563
564564
Most authorization servers return the user's GUID in the `sub` claim instead of the 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.
565565
566-
Example `advanced.config` configuration:
567-
568-
```
569-
...
570-
{rabbitmq_auth_backend_oauth2, [
571-
{resource_server_id, <<"rabbitmq">>},
572-
{preferred_username_claims, [<<"user_name">>,<<"email">>]},
573-
...
566+
Example `rabbitmq.conf` configuration:
567+
568+
``` ini
569+
# ...
570+
auth_oauth2.resource_server_id = rabbitmq
571+
auth_oauth2.preferred_username_claims.1 = user_name
572+
auth_oauth2.preferred_username_claims.2 = email
573+
# ...
574574
```
575575
576576
In the example configuration, RabbitMQ searches for the `user_name` claim first and if it is not found, RabbitMQ searches for the `email`. If these are not found, RabbitMQ uses its default lookup mechanism which first looks for `sub` and then `client_id`.

0 commit comments

Comments
 (0)