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
Copy file name to clipboardExpand all lines: modules/ROOT/pages/developers/architecture.adoc
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@
2
2
3
3
This page presents general information about the Hawtio architecture. We show all the components (client, server, agent connections). For details about plugin development, see xref::developers/applications.adoc[].
You can attach the Hawtio console to your Spring Boot application in two steps.
@@ -247,7 +248,7 @@ It is possible to https://jetty.org/docs/jetty/12/operations-guide/deploy/index.
247
248
</Configure>
248
249
----
249
250
250
-
But there's a trick here. Normally Jetty unpacks this WAR archive to a temporary folder (which may be specified with `-Djava.io.tmpdir` system property). But there's no need for unpacking if there's `hawtio-war-4.2.0` _directory_ next to `hawtio-war-4.2.0.war` achive.
251
+
But there's a trick here. Normally Jetty unpacks this WAR archive to a temporary folder (which may be specified with `-Djava.io.tmpdir` system property). But there's no need for unpacking if there's `hawtio-war-4.2.0` _directory_ next to `hawtio-war-4.2.0.war` archive.
251
252
252
253
Jetty uses `org.eclipse.jetty.server.SymlinkAllowedResourceAliasChecker` _alias checker_ and if
253
254
_real path_ for the above `/data/tmp/hawtio-war-4.2.0` is different (i.e., the path uses symbolic links), resources from this WAR application won't be loaded and Hawtio application won't work.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/keycloak.adoc
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,10 @@
1
1
= Keycloak Integration
2
2
3
+
This chapter presents the legacy method of integration between Hawtio and https://www.keycloak.org[Keycloak]. This method relies on the
4
+
availability of Keycloak libraries and Keycloak-specific configuration files, as well as client side https://www.npmjs.com/package/keycloak-js[keycloak.js] library.
5
+
6
+
For generic OpenID Connect integration (which also supports Keycloak server), please refer to xref:oidc.adoc[] chapter.
7
+
3
8
You can secure your Hawtio console with https://www.keycloak.org[Keycloak]. To integration Hawtio with Keycloak, you need to:
4
9
5
10
1. Prepare Keycloak server
@@ -41,6 +46,10 @@ The following settings need to be made for each part:
41
46
Server side:: The runtime-specific configuration for the Keycloak adapter
42
47
Client side:: The Hawtio Keycloak configuration `keycloak-hawtio.json`
43
48
49
+
WARNING: Starting with Keycloak 25.0.0, Keycloak specific login modules https://github.com/keycloak/keycloak/issues/28789[are no longer available].
50
+
Keycloak can be used with Hawtio using xref:oidc.adoc[]. We can also use Quarkus or SpringBoot specific support for OAuth2 / OpenID Connect which
51
+
doesn't rely on Keycloak libraries.
52
+
44
53
[#_quarkus]
45
54
=== Quarkus
46
55
@@ -87,7 +96,8 @@ Finally create `keycloak-hawtio.json` under `src/main/resources` in the Quarkus
87
96
"clientId": "hawtio-client",
88
97
"url": "http://localhost:18080/",
89
98
"jaas": false,
90
-
"pkceMethod": "S256"
99
+
"pkceMethod": "S256",
100
+
"logoutUri": "/hawtio/auth/logout"
91
101
}
92
102
----
93
103
@@ -148,7 +158,8 @@ Finally create `keycloak-hawtio.json` under `src/main/resources` in the Spring B
148
158
"realm": "hawtio-demo",
149
159
"clientId": "hawtio-client",
150
160
"url": "http://localhost:18080/",
151
-
"jaas": false
161
+
"jaas": false,
162
+
"logoutUri": "/actuator/hawtio/auth/logout"
152
163
}
153
164
----
154
165
@@ -158,9 +169,10 @@ Build and run the project and it will be integrated with Keycloak.
158
169
159
170
See https://github.com/hawtio/hawtio/tree/4.x/examples/springboot-keycloak[springboot-keycloak example] for a working example.
160
171
172
+
////
161
173
=== Jetty
162
174
163
-
CAUTION: Keycloak adapters are https://www.keycloak.org/2022/02/adapter-deprecation[deprecated]. The instructions in this section are not verified with Hawtio v3. It will be updated.
175
+
CAUTION: Keycloak adapters are https://www.keycloak.org/2022/02/adapter-deprecation[deprecated]. The instructions in this section are not verified with Hawtio v4. It will be updated.
164
176
165
177
Assume `$JETTY_HOME` is the root directory of your Jetty installation and you deployed Hawtio WAR to Jetty as described in xref:get-started.adoc[].
Run Jetty and go to `http://localhost:8080/hawtio`. Users are again `admin` and `viewer` with access and `jdoe` without access.
221
+
////
209
222
223
+
////
210
224
=== Tomcat
211
225
212
226
CAUTION: Keycloak adapters are https://www.keycloak.org/2022/02/adapter-deprecation[deprecated]. The instructions in this section are not verified with Hawtio v3. It will be updated.
@@ -219,6 +233,7 @@ Instructions are quite similar to <<Jetty>>. You would need to setup JAAS realm
219
233
----
220
234
221
235
This is needed, so that Tomcat will use configured JAAS realm with `BearerTokenLoginModule` instead of `tomcat-users.xml` file, which Hawtio uses on Tomcat by default.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/oidc.adoc
+47-14Lines changed: 47 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
= OpenID Connect Integration
2
2
3
-
Hawtio is already xref:keycloak.adoc[supporting Keycloak] as https://openid.net/specs/openid-connect-core-1_0.html#Terminology[OpenID Provider]. However, Keycloak https://www.keycloak.org/2022/02/adapter-deprecation[already announced] that the configuration methods used by Hawtio are deprecated.
3
+
For a long time, Hawtio was xref:keycloak.adoc[supporting Keycloak] as https://openid.net/specs/openid-connect-core-1_0.html#Terminology[OpenID Provider]. However, Keycloak https://www.keycloak.org/2022/02/adapter-deprecation[already announced] that these configuration methods used by Hawtio are deprecated.
4
4
5
-
Because https://openid.net/specs/openid-connect-core-1_0.html[OpenID Connect Core 1.0] is a widespread specification and standard method for distributed authentication (based on https://datatracker.ietf.org/doc/html/rfc6749[OAuth 2]), Hawtio 4 now supports generic OpenID authentication.
5
+
Because https://openid.net/specs/openid-connect-core-1_0.html[OpenID Connect Core 1.0] is a widespread specification and standard method for distributed authentication (based on https://datatracker.ietf.org/doc/html/rfc6749[OAuth 2]), Hawtio 4 supports generic OpenID authentication. +
6
+
This allows integration with any OpenID Connect implementations.
6
7
7
8
== Building blocks and terminology
8
9
@@ -20,12 +21,12 @@ Authorization Server:: The server that coordinates communication between a _clie
20
21
+
21
22
In OpenID Connect specification, the _authorization server_ is named _OpenID Provider (OP)_.
22
23
23
-
The main goal of OAuth2 and OpenID Connect it to allow applications to access APIs without using user credentials and switch to token exchange.
24
+
The main goal of OAuth2 and OpenID Connect specifications is to allow applications to access APIs without using user credentials and switch to token exchange.
24
25
25
26
It is important to know how Hawtio maps to the above roles:
26
27
27
-
* Hawtio Client application is an OAuth2 _client_. User interacts with Hawtio web application which in turn communicates with Hawtio Server (backend) with https://jolokia.org/[Jolokia agent] running. Before accessing the Jolokia agent, Hawtio needs an OpenID Connect _access token_. To this end, Hawtio Client initiates OpenID Connect authentication process by redirecting user to _Authorization Server_.
28
-
* Hawtio Server application is a JakartaEE application exposing a https://jolokia.org/[Jolokia Agent] API which authorizes user actions based on the content of an _access token_. Using OAuth2 terminology, Hawtio Server is a _Resource Server_.
28
+
* Hawtio Client application is an OAuth2 _client_. User interacts with Hawtio web application which in turn communicates with Hawtio Server (backend) with a https://jolokia.org/[Jolokia Agent] running. Before accessing the Jolokia Agent, Hawtio needs an OpenID Connect _access token_. To this end, Hawtio Client initiates OpenID Connect authentication process by redirecting user to the _Authorization Server_.
29
+
* Hawtio Server application is a JakartaEE application exposing a https://jolokia.org/[Jolokia Agent] API which authorizes user actions based on the content of an _access token_. Using OAuth2 terminology, Hawtio Server (and the Jolokia Agent it contains) is a _Resource Server_.
29
30
30
31
The below UML diagram present the big picture.
31
32
@@ -36,22 +37,22 @@ The below UML diagram present the big picture.
36
37
// "Authorization Server" -> "User (Browser)": show login page
The most important aspect is: Hawtio Client never deals with user credentials. User authenticates with Authorization Server and Hawtio Client only gets the access token used later to access Hawtio Server (and its Jolokia API).
44
45
45
46
== Generic OpenID Connect authentication in Hawtio
46
47
47
-
Hawtio 4 can be used with existing OpenID Connect providers (like Keycloak, Microsoft Entra ID, Auth0, ...) and uses these libraries to fullfill the task:
48
+
Hawtio 4 can be used with existing OpenID Connect providers (like Keycloak, Microsoft Entra ID, Auth0, ...) and uses these libraries to fulfill the task:
48
49
49
50
* https://hc.apache.org/httpcomponents-client-4.5.x/[Apache HTTP Client 4] to implement HTTP communication from Hawtio Server to OpenID Connect provider (e.g., to retrieve information about public keys for token signature validation).
50
51
* https://connect2id.com/products/nimbus-jose-jwt[Nimbus JOSE + JWT] library to manipulate and validate OpenID Connect / OAuth2 access tokens.
51
52
52
-
These libraries are included in Hawtio Server WAR, which means there's no need to install/deploy _any_ additional libraries (as it is the case with xref:keycloak.adoc[Keycloak specific configuration]).
53
+
These libraries are included in Hawtio Server WAR, which means there's no need to install/deploy _any_ additional libraries (as it is the case with xref:keycloak.adoc[Keycloak legacy support]).
53
54
54
-
In order to configure Hawtio with external OpenID Connect provider, we need to provide one configuration file and point Hawtio to its location.
55
+
In order to configure Hawtio with an external OpenID Connect provider, we need to provide one configuration file and point Hawtio to its location.
55
56
56
57
The system property that specifies the location of OIDC (OpenID Connect) configuration is `-Dhawtio.oidcConfig`, but in case it's not specified, a default location is checked. The defaults are:
57
58
@@ -62,14 +63,18 @@ The system property that specifies the location of OIDC (OpenID Connect) configu
62
63
* For Apache Artemis runtime, `${artemis.instance.etc}/hawtio-oidc.properties`
63
64
* Falls back to `classpath:hawtio-oidc.properties` (for embedded Hawtio usage)
64
65
65
-
Unlike with xref:keycloak.adoc[Keycloak specific configuration], there's only one `*.properties` file needed that is used to configure all the aspects of OpenID Connect configuration. Here's the template:
66
+
Unlike with xref:keycloak.adoc[Keycloak legacy configuration], there's only one `*.properties` file needed that is used to configure all the aspects of OpenID Connect configuration. Here's the template:
66
67
67
68
[source]
68
69
----
69
70
# OpenID Connect configuration required at client side
70
71
72
+
# Name of the OIDC configuration - used for display purposes when selecting authentication method in the browser
73
+
name = Keycloak@localhost
74
+
71
75
# URL of OpenID Connect Provider - the URL after which ".well-known/openid-configuration" can be appended for
72
76
# discovery purposes
77
+
# if this property is unavailable, OIDC is not enabled
# time in minutes to cache public keys from jwks_uri
94
99
jwks.cacheTime = 60
95
100
101
+
# a path for a field in JWT payload that should be used as user identifier. Keycloak for example uses
102
+
# preferred_username, but it may be other field. The value will be used as user/identity JAAS Principal
103
+
oidc.userPath = preferred_username
104
+
96
105
# a path for an array of roles found in JWT payload. Property placeholders can be used for parameterized parts
97
-
# of the path (like for Keycloak) - but only for properties from this particular file
106
+
# of the path (like for Keycloak) - but only for properties from this particular file.
107
+
# The value will be used as role JAAS Principal(s)
98
108
# example for properly configured Entra ID token
99
109
#oidc.rolesPath = roles
100
110
# example for Keycloak with use-resource-role-mappings=true
@@ -129,6 +139,7 @@ http.readTimeout = 10000
129
139
130
140
This file configures several aspects of Hawtio+OpenID Connect:
131
141
142
+
* `name` property will be used at multi-authentication Hawtio login page
132
143
* OAuth2 - configure the location of Authorization Server, client ID and several OpenID Connect related options
133
144
* JWKS - cache time for public keys obtained from `jwks_uri`, which is the endpoint that exposes public keys used by the Authorization Server.
134
145
* JWT token configuration - information about the _claim_ (a field in JSON Web Token) that contains roles associated with the authenticated user. We also allow to map roles as defined in the Authorization Server to the roles used by the application (Hawtio Server and Jolokia).
@@ -146,6 +157,16 @@ There's a system property that specifies the role class:
@@ -326,7 +359,7 @@ Let's summarize the configuration required in Entra ID.
326
359
+
327
360
image::entra-scope.png[]
328
361
+
329
-
This will create a reference'able `api://hawtio-server/Jolokia.Access` scope we will use later.
362
+
This will create a referencable `api://hawtio-server/Jolokia.Access` scope we will use later.
330
363
3. In "App roles" section for `hawtio-server` define any roles you want to assign to users within the scope of this client, for example:
331
364
+
332
365
image::entra-roles.png[]
@@ -394,7 +427,7 @@ For reference, here's the relevant JSON snippet of `hawtio-server` app registrat
394
427
...
395
428
----
396
429
397
-
Now the granted access token is no longer specific for Microsft Graph API _audience_. It is intended for `hawtio-server` - `aud` claim is the UUID of `hawtio-server` app registration and `appid` claim is the UUID of `hawtio-client` app registration:
430
+
Now the granted access token is no longer specific for Microsoft Graph API _audience_. It is intended for `hawtio-server` - `aud` claim is the UUID of `hawtio-server` app registration and `appid` claim is the UUID of `hawtio-client` app registration:
0 commit comments