Skip to content

Commit 3ea6207

Browse files
OAuth 2: edits #2091
1 parent 8ef834d commit 3ea6207

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

docs/oauth2.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,33 +196,46 @@ auth_oauth2.scope_prefix = ''
196196
...
197197
```
198198

199-
#### Scope aliases {#scope-aliases}
199+
#### Scope Aliases {#scope-aliases}
200200

201-
An scope alias is a mapping between a custom scope and a RabbitMQ's scope. A custom
202-
scope is any scope which is not recogonized by RabbitMQ.
201+
:::important
203202

204-
Scope aliases are necessary when you cannot create RabbitMQ scopes in your
205-
identity provider. Instead you have to name them following a format which is not
206-
recognizable by RabbitMQ.
203+
Scope aliases are necessary when scopes in the RabbitMQ format cannot be
204+
configured on the identity provider (IDP) side
207205

208-
For instance, say you have these two roles in your identity provider:
209-
- `admin`.
210-
- `developer`.
206+
:::
207+
208+
A scope alias is a mapping between a custom JWT token scope and a set of RabbitMQ-specific scopes. A custom
209+
scope can also be defined as any scope which is not recogonized by RabbitMQ's OAuth 2 subsystem.
210+
211+
Scope aliases are necessary when scopes in the RabbitMQ format cannot be
212+
configured on the identity provider (IDP) side. Instead, a set of names is configured
213+
on the IDP side, and mapped to a set of scoped that RabbitMQ can parse and use.
214+
215+
For instance, let's consider an identity provider with the following two roles:
211216

212-
Also say that you want to map those roles to the following RabbitMQ scopes:
213-
- `admin` to `rabbitmq.tag:administrator rabbitmq.read:*/`
214-
- `developer` to `rabbitmq.tag:management rabbitmq.read:*/* rabbitmq.write:*/* rabbitmq.configure:*/*`
217+
* `admin`
218+
* `developer`
219+
220+
These roles should be mapped to the following RabbitMQ scopes:
221+
222+
* `admin` to `rabbitmq.tag:administrator rabbitmq.read:*/`
223+
* `developer` to `rabbitmq.tag:management rabbitmq.read:*/* rabbitmq.write:*/* rabbitmq.configure:*/*`
224+
225+
The following `rabbitmq.conf` example performs the aforementioned mapping using scope aliases. The mapping can be one-to-one or one-to-many:
215226

216-
You configure the scope aliases as follows. The mapping can be 1:1 or 1:many:
217227
```ìni
218228
# ...
229+
# the "admin" role above
219230
auth_oauth2.scope_aliases.admin = rabbitmq.tag:administrator rabbitmq.read:*/
231+
# the "developer" role above
220232
auth_oauth2.scope_aliases.developer = rabbitmq.tag:management rabbitmq.read:*/* rabbitmq.write:*/* rabbitmq.configure:*/*
221233
# ...
222234
```
223235

224-
Sometimes, the alias is not made of a single word but instead it uses special characters
225-
and symbols including the separator character `.`. In those cases, you can configure the scope aliases as follows:
236+
Sometimes an alias may have to use special characters and symbols including the separator character, `.`.
237+
In those cases, configure the scope aliases as follows:
238+
226239
```ìni
227240
# ...
228241
auth_oauth2.scope_aliases.1.alias = api://admin
@@ -232,7 +245,7 @@ auth_oauth2.scope_aliases.2.scope = rabbitmq.tag:management rabbitmq.read:*/* ra
232245
# ...
233246
```
234247

235-
#### Signing keys files {#signing-key-files}
248+
#### Signing Keys Files {#signing-key-files}
236249

237250
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).
238251

0 commit comments

Comments
 (0)