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
generate the TLS certificate and private keys necessary. These certificates have an expiration date.
59
+
generate the TLS certificate and private keys as necessary. These certificates have an expiration date.
61
60
62
-
In case of any error messages that hint at expired or invalid certificates, stop Keycloak and run `make clean-certs` to regenerate the certificates and private keys,
63
-
then restart Keycloak and the proxy
61
+
In you see any error messages that hint at expired or invalid certificates, stop Keycloak, run `make clean-certs` to regenerate the certificates and private keys,
62
+
and then restart Keycloak and the proxy.
64
63
:::
65
64
66
65
## Deploy Keycloak
67
66
68
-
Deploy Keycloak by running the following command which deploys keycloak on its own network called `keycloak_net`:
67
+
Deploy keycloak on its own network called `keycloak_net` by running:
68
+
69
69
```bash
70
70
PROVIDER_NETWORK=keycloak_net make start-keycloak
71
71
```
72
72
73
-
To access Keycloak Management UI, go to https://keycloak:8443/ and enter `admin` as username and password.
73
+
To access Keycloak Management UI, go to https://keycloak:8443/ and enter `admin` as the username and password.
74
74
75
75
There is a dedicated **Keycloak realm** called `Test` configured as follows:
To start the forward proxy, run the following command which deploys forward-proxy in
84
-
two networks, `keycloak_net` and `rabbitmq_net`:
83
+
Deploy and start the forward-proxy in two networks, `keycloak_net` and `rabbitmq_net`, by running:
85
84
86
85
```bash
87
86
PROVIDER_NETWORK=keycloak_net make start-forward-proxy
88
87
```
89
88
90
-
The forward proxy is configured using [httpd.conf](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/forward-proxy/httpd/httpd.conf). This type of configuration inserts the access token into the HTTP **Authorization** header.
89
+
The forward proxy is configured by using [httpd.conf](https://github.com/rabbitmq/rabbitmq-oauth2-tutorial/tree/next/conf/forward-proxy/httpd/httpd.conf). This type of configuration inserts the access token into the HTTP **Authorization** header.
91
90
92
91
93
92
## Start RabbitMQ
94
93
95
-
To start RabbitMQ run the following command which deploys rabbitmq in its own network `rabbitmq_net`:
94
+
Deploy RabbitMQ in its own network `rabbitmq_net` and start it by running:
96
95
97
96
```
98
97
export IMAGE=<Tanzu RabbitMQ OCI image name>
@@ -103,19 +102,19 @@ MODE=forward-proxy OAUTH_PROVIDER=keycloak make start-rabbitmq
103
102
## Access [management UI](./management/)
104
103
105
104
Go to https://rabbitmq:15671/, proceed to login, and enter the credentials
106
-
`rabbit_admin` as username and `rabbit_admin` as password when Keycloak prompts you.
107
-
You should be redirected back to RabbitMQ management UI.
105
+
`rabbit_admin` as the username and `rabbit_admin` as the password when Keycloak prompts you.
106
+
You will be redirected back to RabbitMQ management UI.
108
107
109
-
Take into account that the management UI running in the browser goes straight to keycloak.
110
-
In other words, it does not go via the forward-proxy. If you really want the management UI to
111
-
go via the forward-proxy you would have to configure the browser. That is beyond
108
+
The management UI running in the browser goes straight to keycloak.
109
+
In other words, it does not go via the forward-proxy. If you want the management UI to
110
+
go via the forward-proxy, you must configure the browser. That is beyond
112
111
the scope of this example.
113
112
114
113
However, in order to validate the token the management UI received from keycloak, RabbitMQ has to connect to keycloak via the forward-proxy. This is necessary in order to download the signing keys and to download the OpenID configuration if you only configured the `issuer` URL.
115
114
116
-
## Access Management api
115
+
## Access Management API
117
116
118
-
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).
117
+
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).
119
118
120
119
```bash
121
120
make curl-keycloak url=https://localhost:15671/api/overview client_id=mgt_api_client secret=LWOuYqJ8gjKg3D2U8CJZDuID3KiRZVDa realm=test
0 commit comments