-
Notifications
You must be signed in to change notification settings - Fork 764
OAuth2 doc changes #1504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OAuth2 doc changes #1504
Changes from all commits
026dde0
ee9ac04
95fa9cf
a6ada13
51066b4
7dd820d
57007ca
d7be933
64a9e30
4a84ea1
9eee1ea
15aa884
9b942d6
230b5e4
acc311a
dccd129
4f95750
61655e1
133609f
18c82d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -288,25 +288,32 @@ rabbitmqctl set_user_tags full_access administrator | |
RabbitMQ can be configured to use [JWT-encoded OAuth 2.0 access tokens](https://github.com/rabbitmq/rabbitmq-auth-backend-oauth2) to authenticate client applications and management UI users. When doing so, the management UI does | ||
not automatically redirect users to authenticate | ||
against the OAuth 2 server, this must be configured separately. Currently, | ||
RabbitMQ has been tested against the following Authorization servers: | ||
**Authorization code flow with PKCE** is tested with the following Authorization servers: | ||
|
||
* [UAA](https://github.com/cloudfoundry/uaa) | ||
* [Keycloak](https://www.keycloak.org/) | ||
* [Auth0](https://auth0.com/) | ||
* [Azure](https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/auth-oauth2) | ||
|
||
**Important**: from the OAuth 2.0 point of view, the RabbitMQ Management UI is a **public app** which | ||
means it cannot securely store credentials such as the *client_secret*. This means that RabbitMQ does not need to present a client_secret when authenticating users. | ||
|
||
It is usually possible to configure the OAuth client as a **public app** with the authorization server that you are using. | ||
If target authorization server only supports a **confidential app** or it requires a *client_secret*, | ||
then a *client_secret* **must** be configured using the `oauth_client_secret` setting. | ||
|
||
To redirect users to the UAA server to authenticate, use the following configuration: | ||
|
||
<pre class="lang-ini"> | ||
management.enable_uaa = true | ||
management.oauth_enabled = true | ||
michaelklishin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
management.oauth_client_id = rabbit_user_client | ||
management.oauth_client_secret = rabbit_user_client_secret | ||
management.oauth_provider_url = https://my-uaa-server-host:8443/uaa | ||
</pre> | ||
|
||
> IMPORTANT: Since RabbitMQ 3.10, RabbitMQ uses `authorization_code` grant type. `implicit` flow has been | ||
deprecated. | ||
> **Important**: Since RabbitMQ 3.10, RabbitMQ uses `authorization_code` grant type. `implicit` flow is deprecated. | ||
|
||
> **Important**: `management.oauth_client_secret` is an optional setting. It is only required when the authorization server used requires it | ||
|
||
michaelklishin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
### Allow Basic and OAuth 2 authentication | ||
|
||
|
@@ -333,7 +340,6 @@ management.disable_basic_auth = true | |
management.enable_uaa = true | ||
management.oauth_enabled = true | ||
management.oauth_client_id = rabbit_user_client | ||
management.oauth_client_secret = rabbit_user_client_secret | ||
management.oauth_provider_url = https://my-uaa-server-host:8443/uaa | ||
</pre> | ||
|
||
|
@@ -348,12 +354,6 @@ curl -i --header "authorization: Bearer <token>" http://localhost:15672/ap | |
This is true for all endpoints except `GET /definitions` and `POST /definitions`. Those | ||
endpoints require the token to be passed in the `token` query string parameter. | ||
|
||
### Minimum scope required and how the UI determines the username from the token | ||
|
||
At a minimum, RabbitMQ requires the the `openid` scope because it uses some claims in the *id token* to determine the username and to display this username on the top right corner of the management UI. The *id token* is returned by the Authorization server if the `openid` scope is included in the authorization request. | ||
|
||
RabbitMQ reads the `user_name` claim from the *id_token*. If the token does not contain the `user_name`, RabbitMQ uses the `sub` claim. | ||
|
||
### Configure which scopes RabbitMQ requests to the authorization server | ||
|
||
It is possible to configure which OAuth 2.0 scopes RabbitMQ should claim when redirecting the user to the authorization server. | ||
|
@@ -373,6 +373,8 @@ such as: | |
* <*resource_server_id*>`.tag:administrator` | ||
* <*resource_server_id*>`.read:*/*/*` | ||
|
||
The scopes are configured using the `management.oauth_scopes` setting. The value must be a space-separated list of scopes. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will a customer/user know what My understanding is you enter a scope followed by a space so: scope1 scope2 scope3 If that is correct then there probably is no need to clarify further, if I can understand more technical people definitely should :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is !! :) |
||
### Configure OpenID Connect Discovery endpoint | ||
|
||
By default, RabbitMQ assumes the OpenID Connect Discovery endpoint is at `<management.oauth_provider_url>/.well-known/openid-configuration`. If your endpoint differs, you can set yours via the `management.oauth_metadata_url` setting. | ||
|
@@ -395,6 +397,28 @@ For instance, if you configured the CSP header with the value `default-src 'self | |
|
||
In addition to the `connect-src` CSP header, RabbitMQ also needs the CSP directives `unsafe-eval` `unsafe-inline`, otherwise the OAuth 2.0 functionality may not work. | ||
|
||
### Identity-Provider initiated logon | ||
|
||
By default, the RabbitMQ Management UI uses the OAuth 2.0 **authorization code flow** to authenticate and authorize users. | ||
However, there are scenarios where users preferred to be automatically redirected to RabbitMQ without getting | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add "RabbitMQ" before the words "Management UI" in the first sentence just to be clear what UI it is at all times. Add the word "the" after "uses" in the first sentence above |
||
involved in additional logon flows. This is common in Web Portals where with a single click, users navigate | ||
straight to a RabbitMQ cluster's management UI with a token obtained under the covers. This is known as | ||
**Identity-Provider initiated logon**. | ||
|
||
RabbitMQ exposes a new setting called `management.oauth_initiated_logon_type` whose default value `sp_initiated`. | ||
To enable an **Identity-Provider initiated logon** you set it to `idp_initiated`. | ||
|
||
After you set `management.oauth_initiated_logon_type` to `idp_initiated` and | ||
`oauth_enabled: true` and `oauth_provider_url` are configured, the management UI exposes the HTTP endpoint `/login` which accepts `content-type: application/x-www-form-urlencoded` and it expects the JWT token in the `access_token` form field. This is the endpoint where the web portal would redirect users to access the RabbitMQ Management ui. | ||
|
||
This is the minimum required configuration for a RabbitMQ cluster configured with `idp_initiated` logon type: | ||
|
||
<pre class="lang-ini"> | ||
management.oauth_enabled = true | ||
management.oauth_initiated_logon_type = idp_initiated | ||
management.oauth_provider_url = https://my-web-portal | ||
</pre> | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps give an example of the above in documentation, thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point ! Thanks |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the above be updated to: "After you set I have no idea what the above means, do we need to explain it in more simple terms? thanks |
||
## <a id="http-api" class="anchor" href="#http-api">HTTP API</a> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,12 +107,12 @@ rather than `legacy-token-key`. | |
|
||
### Configure Client | ||
|
||
For backend applications which uses **Client Credentials flow** you create a **Client** with: | ||
For backend applications which uses **Client Credentials flow**, you can create a **Client** with: | ||
|
||
* **Access Type** : `confidential` | ||
* With all the other flows disabled: Standard Flow, Implicit Flow, Direct Access Grants | ||
* **Access Type** : `public` | ||
* Turn off `Standard Flow`, `Implicit Flow`, and `Direct Access Grants` | ||
* With **Service Accounts Enabled** on. If it is not enabled you do not have the tab `Credentials` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again enable/disable terminology used here which we want to avoid going forward, see the table here for more details: https://source.vmware.com/portal/pages/global-marketing/terminology-changes Are: Standard Flow, Implicit Flow, Direct Access Grant UI entities? if so, lets tag them appropriately, I think bold is being used to tag UI entities in OSS RabbitMQ docs right now, please use that here if so, thanks 4th bullet point: Service Accounts Enabled should change to Service Accounts Activated in PHASE 2 of inclusive language updates in code entities, more details about that in this issue: #1551 Also, a suggested reword of the 4th bullet point, how about: Service Accounts Enabled is turned on, if it is not, you won't have the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We cannot do anything about |
||
* In tab `Credentials` you have the client id secret | ||
* In the `Credentials` tab, you have the `client id` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the |
||
|
||
### Configure Client scopes | ||
|
Uh oh!
There was an error while loading. Please reload this page.