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/security.adoc
+67-22
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ Hawtio can be secured with the authentication mechanisms Quarkus provides, as we
62
62
63
63
if you want to disable Hawtio authentication for Quarkus, add the following configuration to `application.properties`:
64
64
65
-
[source,java]
65
+
[source,properties]
66
66
.application.properties
67
67
----
68
68
quarkus.hawtio.authenticationEnabled = false
@@ -89,7 +89,7 @@ To use the properties-based authentication with Hawtio, add the following depend
89
89
90
90
You can then define users to `application.properties` to enable the authentication. For example, defining a user `hawtio` with password `s3cr3t!` and role `admin` would look like the following:
91
91
92
-
[source,java]
92
+
[source,properties]
93
93
.application.properties
94
94
----
95
95
quarkus.security.users.embedded.enabled = true
@@ -112,7 +112,7 @@ In addition to the standard JAAS authentication, Hawtio on Spring Boot can be se
112
112
113
113
if you want to disable Hawtio authentication for Spring Boot, add the following configuration to `application.properties`:
114
114
115
-
[source,java]
115
+
[source,properties]
116
116
.application.properties
117
117
----
118
118
hawtio.authenticationEnabled = false
@@ -132,7 +132,7 @@ To use Spring Security with Hawtio, add `org.springframework.boot:spring-boot-st
132
132
133
133
Spring Security configuration in `src/main/resources/application.properties` should look something like the following:
134
134
135
-
[source,java]
135
+
[source,properties]
136
136
----
137
137
spring.security.user.name = hawtio
138
138
spring.security.user.password = s3cr3t!
@@ -216,45 +216,73 @@ See xref:keycloak.adoc#_spring_boot[Keycloak Integration - Spring Boot].
216
216
217
217
Hawtio authentication is enabled by default. If you want to disable Hawtio authentication, set the following system property:
218
218
219
-
[source,java]
219
+
[source,properties]
220
220
----
221
221
hawtio.authenticationEnabled = false
222
222
----
223
223
224
224
=== Jetty
225
225
226
-
To use authentication with Jetty, you first have to set up some users with roles. To do that navigate to the `etc/` folder of your Jetty installation and create the following file `etc/login.properties` and enter something like this:
226
+
Hawtio can integrate with Jetty JAAS mechanisms. However not all https://jetty.org/docs/jetty/12/operations-guide/jaas/index.html#loginmodules[Jetty JAAS modules] work out of the box.
227
227
228
-
[source,java]
228
+
Jetty JAAS modules work with Jetty security infrastructure and the important thing is that it requires your web application (WAR) to use `<login-config>` configuration.
229
+
230
+
Hawtio provides customized `org.eclipse.jetty.security.jaas.spi.PropertyFileLoginModule` which is available in `io.hawt.jetty.security.jaas.PropertyFileLoginModule` class. Additionally Hawtio provides ready to use `*.mod` file which can be copied directly to `$JETTY_BASE/modules`. This file describes https://jetty.org/docs/jetty/12/operations-guide/modules/index.html[Jetty module] with references to required Hawtio Jetty library:
INFO : jaas initialized in ${jetty.base}/start.d/jaas.ini
258
+
INFO : hawtio-jetty-security initialized in ${jetty.base}/start.d/hawtio-jetty-security.ini
259
+
INFO : copy ~/.m2/repository/io/hawt/hawtio-jetty-security/4.4-SNAPSHOT/hawtio-jetty-security-<version>.jar to ${jetty.base}/lib/hawtio-jetty-security-<version>.jar
260
+
INFO : Base directory was modified
261
+
----
262
+
263
+
To use authentication with Jetty, you first have to set up some users with credentials and roles. To do that navigate to `$JETTY_BASE/etc/` folder and create `etc/login.properties` file containing something like this:
264
+
265
+
[source,properties]
229
266
.etc/login.properties
230
267
----
231
-
scott=tiger,user
268
+
scott=tiger,user
232
269
admin=CRYPT:adpexzg3FUZAk,admin,user
233
270
----
234
271
235
-
You have added two users. The first one named `scott` with the password `tiger`. He has the role `user` assigned to it. The second user `admin` with password `admin` which is obfuscated (see Jetty realms for possible encryption methods). This one has the `admin` and `user` role assigned.
272
+
You have added two users. The first one named `scott` with the password `tiger`. He has the role `user` assigned to it. The second user `admin` with password `admin` which is obfuscated (see https://jetty.org/docs/jetty/12/operations-guide/tools/index.html#password[Password Obfuscation in Jetty documentation] for details). This one has the `admin` and `user` role assigned.
236
273
237
-
Now create the second file in the same `etc/` directory called `login.conf`. This is the login configuration file.
274
+
Now create the second file in the same `$JETTY_BASE/etc/` directory named `login.conf`. This is the JAAS login configuration file.
CAUTION: Currently the login module `org.eclipse.jetty.jaas.spi.PropertyFileLoginModule` doesn't work with Hawtio. The instructions are kept as-is for illustrative purposes. But to really make it work, use https://eclipse.dev/jetty/documentation/jetty-10/operations-guide/index.html#og-jaas-loginmodules[different login modules] or implement your own `PropertyFileLoginModule`.
250
-
251
-
Next, enable the JAAS module in Jetty. This is done by the following command:
0 commit comments