FFFF Remove OpenJDK 17 support on server side by stianst · Pull Request #55610 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content
< 8000 link crossorigin="anonymous" rel="modulepreload" href="https://github.githubassets.com/assets/primer-react-a8793df31d3bf19f.js" fetchpriority="low" />
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Required toolchain
- Use Maven Wrapper, not system Maven: `./mvnw`.
- JDK: 17, 21, or 25 (CI uses 25 for most jobs, with some workflows pinned to 21; the Maven compiler release is 17).
- JDK: 21, or 25 (CI uses 25 for most jobs, with some workflows pinned to 21; the Maven compiler release is 21).
- Node.js: 24+ for UI work (`js/apps/admin-ui/CONTRIBUTING.md`).
- PNPM workspace is managed from `js/`.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
dist: [temurin]
version: [17, 21, 27]
version: [21, 27]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
6 changes: 6 additions & 0 deletions adapters/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<artifactId>keycloak-adapters-pom</artifactId>
<packaging>pom</packaging>

<properties>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
</properties>

<modules>
<module>spi</module>
<module>saml</module>
Expand Down
5 changes: 3 additions & 2 deletions adapters/saml/core-public/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@


<properties>
<!-- We still need to support EAP 8, set the Java version to 11. -->
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
</properties>
Expand Down
3 changes: 3 additions & 0 deletions adapters/saml/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<description>Keycloak SAML Client Adapter Core</description>

<properties>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
</properties>
Expand Down
6 changes: 6 additions & 0 deletions adapters/saml/wildfly-elytron/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<name>Keycloak WildFly Elytron SAML Adapter</name>
<description>Keycloak WildFly Elytron SAML Adapter</description>

<properties>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
6 changes: 6 additions & 0 deletions adapters/saml/wildfly/wildfly-subsystem/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<description>Keycloak Wildfly SAML Adapter Subsystem</description>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
</properties>

<build>
<plugins>
<plugin>
Expand Down
5 changes: 3 additions & 2 deletions adapters/spi/adapter-spi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
<description>Keycloak Adapter SPI</description>

<properties>
<!-- We still need to support EAP 8, set the Java version to 11. -->
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
</properties>

<dependencies>
Expand Down
5 changes: 3 additions & 2 deletions adapters/spi/jboss-adapter-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@
<description>Common JBoss/Wildfly Core Classes</description>

<properties>
<!-- We still need to support EAP 8, set the Java version to 11. -->
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
</properties>

<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions authz/client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
For the use by 3rd party applications, please use `org.keycloak:keycloak-authz-client` module.</description>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
</properties>

<dependencies>
Expand Down
6 changes: 3 additions & 3 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<description>Common library and dependencies shared with server and all adapters</description>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
</properties>
Expand Down
6 changes: 3 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<packaging>jar</packaging>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public Object extractUserIdentity(X509Certificate[] certs) {

// From Java 21, the 3rd entry can be present with the type-id as String and 4th entry with the value (either in String or byte format).
// See javadoc of X509Certificate.getSubjectAlternativeNames in Java 21. For the sake of simplicity, we just ignore those additional String entries and
// always parse it from byte (2nd entry) as we still need to support Java 17 and it is not reliable anyway that entries are present in Java 21.
// always parse it from byte (2nd entry) as it is not reliable that entries are present in Java 21.
if (obj instanceof byte[]) {
byte[] otherNameBytes = (byte[]) obj;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public Object extractUserIdentity(X509Certificate[] certs) {

// From Java 21, the 3rd entry can be present with the type-id as String and 4th entry with the value (either in String or byte format).
// See javadoc of X509Certificate.getSubjectAlternativeNames in Java 21. For the sake of simplicity, we just ignore those additional String entries and
// always parse it from byte (2nd entry) as we still need to support Java 17 and it is not reliable anyway that entries are present in Java 21.
// always parse it from byte (2nd entry) as it is not reliable that entries are present in Java 21.
if (obj instanceof byte[]) {
byte[] otherNameBytes = (byte[]) obj;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public Object extractUserIdentity(X509Certificate[] certs) {

// From Java 21, the 3rd entry can be present with the type-id as String and 4th entry with the value (either in String or byte format).
// See javadoc of X509Certificate.getSubjectAlternativeNames in Java 21. For the sake of simplicity, we just ignore those additional String entries and
// always parse it from byte (2nd entry) as we still need to support Java 17 and it is not reliable anyway that entries are present in Java 21.
// always parse it from byte (2nd entry) as it is not reliable that entries are present in Java 21.
if (obj instanceof byte[]) {
byte[] otherNameBytes = (byte[]) obj;

Expand Down
2 changes: 1 addition & 1 deletion < 10BC8 span class="diffstat" aria-hidden="true">2 docs/building.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Building from source

Ensure you have **JDK 17**, **JDK 21** or **JDK 25** and Git installed
Ensure you have **JDK 21** or **JDK 25** and Git installed

java -version
git --version
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>

<properties>
<!-- this property prevents the warning "WARN FilenoUtil: Native subprocess control requires open access" when using JRuby for the unit tests on JDK17 -->
Comment thread
vmuzikar marked this conversation as resolved.
Resolved
<!-- this property prevents the warning "WARN FilenoUtil: Native subprocess control requires open access" when using JRuby for the unit tests on JDK17+ -->
<surefire.system.args>
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
--add-opens java.base/java.io=ALL-UNNAMED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
Breaking changes are identified as those that might require changes for existing users to their configurations or applications.
In minor or patch releases, {project_name} will only introduce breaking changes to fix bugs.

=== OpenJDK 17 support removed

Keycloak server no longer supports running on OpenJDK 17, and the minimum supported version is now OpenJDK 21.

Comment on lines +7 to +10
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: the upgrading guide could help users assess impact with a few lines. But if you would like to keep things concise, that's not a problem. Something like:

=== OpenJDK 17 support removed

Keycloak server no longer supports running on OpenJDK 17, and the minimum supported version is now OpenJDK 21.
The official container image already uses OpenJDK 21 and is not affected by this change.
Client libraries (`keycloak-admin-client`, `keycloak-authz-client`) continue to support Java 8.
FIPS 140-2 deployments no longer need the `kc.java.security` file or the manual `XMLDSig` provider configuration that was required with older OpenJDK 17 versions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might consider including something around FIPS 140-2 once we reach agreement on those; the rest I'm not including.

=== Authorization policies with deleted references

Role policies with a missing required role and negative role, group, user, client, or client scope policies with unresolved references now evaluate as invalid.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@ For a configuration where this is applied, visit <@links.ha id="single-cluster-d
[#single-cluster-threads-concept]
== Concepts

[#single-cluster-jgroups-communications]
=== JGroups communications

// remove this paragraph once OpenJDK 17 is no longer supported on the server side.
// https://github.com/keycloak/keycloak/issues/31101

JGroups communications, which is used in single-cluster setups for the communication between {project_name} nodes,
benefits from the use of virtual threads which are available in OpenJDK 21 or later when at least four cores are available for {project_name}.
This reduces the memory usage and removes the need to configure thread pool sizes.
For best performance, use OpenJDK {jdk_version_latest} or later.

<#include "/high-availability/partials/concepts/threads.adoc" />

</@tmpl.guide>
24 changes: 10 additions & 14 deletions docs/guides/server/fips.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ FIPS library is not officially validated with OpenJDK 25. Hence for FIPS 140-2 c
To run in FIPS 140-2, {project_name} should run on a FIPS 140-2 enabled system. This requirement usually assumes RHEL or Fedora where FIPS was enabled during installation.
See https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/security_hardening/index#assembly_installing-the-system-in-fips-mode_security-hardening[RHEL documentation]
for the details. When the system is in FIPS mode, it makes sure that the underlying OpenJDK is in FIPS mode as well and would use only
https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/17/html/configuring_red_hat_build_of_openjdk_17_on_rhel_with_fips/openjdk-default-fips-configuration#security_providers[FIPS enabled security providers].
https://docs.redhat.com/en/documentation/red_hat_build_of_openjdk/21/html/configuring_red_hat_build_of_openjdk_21_on_rhel_with_fips/openjdk-default-fips-configuration#security_providers[FIPS enabled security providers].

To check that the system is in FIPS mode, you can check it with the following command from the command line:

Expand Down Expand Up @@ -160,23 +160,23 @@ always fulfils this requirement.

* The bc-fips version 1.0.2.4 deals with the end of the transition period for PKCS 1.5 RSA encryption. Therefore JSON Web Encryption (JWE) with algorithm `RSA1_5` is not allowed in strict mode by default (BC provides the system property `-Dorg.bouncycastle.rsa.allow_pkcs15_enc=true` as backward compatibility option for the moment). `RSA-OAEP` and `RSA-OAEP-256` are still available as before.

[[other_restrictions]]
== Other restrictions

To have SAML working, make sure that a `XMLDSig` security provider is available in your security providers.
To have Kerberos working, make sure that a `SunJGSS` security provider is available. In FIPS enabled RHEL 9 in OpenJDK 21, the `XMLDSig` security provider may be already enabled
Comment thread
vmuzikar marked this conversation as resolved.
Resolved
in the `java.security` by default and the same applies with latest OpenJDK 17. But with older OpenJDK 17, it may not be enabled by default, which means that SAML effectively cannot work.
To have SAML working, make sure that a `XMLDSig` security provider is available in your security providers. In FIPS enabled RHEL 9+ in OpenJDK 21, the `XMLDSig` security provider is enabled by default.

To have SAML working, you can manually add the provider into `JAVA_HOME/conf/security/java.security` into the list fips providers. For example, add the line such as the following in case
To have Kerberos working, make sure that a `SunJGSS` security provider is available. The security provider `SunJGSS` is not yet fully FIPS compliant. Hence it is not recommended to add it to your list of security providers
if you want to be FIPS compliant. The `KERBEROS` feature is disabled by default in {project_name} when it is executed on FIPS platform and when security provider is not
available. Details are in the https://bugzilla.redhat.com/show_bug.cgi?id=2051628[bugzilla].

You can manually add providers to the `fips.provider` list in `JAVA_HOME/conf/security/java.security`. For example, add the line such as the following in case
that it is not already available in your FIPS security providers:

[source]
----
fips.provider.7=XMLDSig
fips.provider.7=SunJGSS
----

Adding this security provider should work well. In fact, it is FIPS compliant and is already added by default in the OpenJDK 21 and newer versions of OpenJDK 17.
Details are in the https://bugzilla.redhat.com/show_bug.cgi?id=1940064[bugzilla].

NOTE: It is recommended to look at `JAVA_HOME/conf/security/java.security` and check all configured providers here and make sure that the number matches. In other words, `fips.provider.7`
assumes that there are already 6 providers configured with prefix like `fips.provider.N` in this file.

Expand All @@ -188,10 +188,6 @@ property above for adding XMLDSig provider into that file. Then start your {proj
-Djava.security.properties=/location/to/your/file/kc.java.security
----

For Kerberos/SPNEGO, the security provider `SunJGSS` is not yet fully FIPS compliant. Hence it is not recommended to add it to your list of security providers
if you want to be FIPS compliant. The `KERBEROS` feature is disabled by default in {project_name} when it is executed on FIPS platform and when security provider is not
available. Details are in the https://bugzilla.redhat.com/show_bug.cgi?id=2051628[bugzilla].

== Run the CLI on the FIPS host

If you want to run Client Registration CLI (`kcreg.sh|bat` script) or Admin CLI (`kcadm.sh|bat` script),
Expand Down Expand Up @@ -232,7 +228,7 @@ For example in the current directory, you can create sub-directory `files` and a

* BC FIPS jar files as described above
* Custom keystore file - named for example `keycloak-fips.keystore.bcfks`
* Security file `kc.java.security` with added provider for SAML (Not needed with OpenJDK 21 or newer OpenJDK 17)
* Java security file `kc.java.security` if required (see <<other_restrictions, Other Restrictions>>)

Then create `Containerfile` in the current directory similar to this:

Expand Down
1 change: 0 additions & 1 deletion docs/guides/server/supported-configurations.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ This {section} provides an overview of the platforms, versions, and configuratio

{project_name} requires a Java Virtual Machine (JVM) to run. The following Java Development Kit (JDK) versions are supported:

* OpenJDK 17 (LTS)
* OpenJDK 21 (LTS)
* OpenJDK 25 (LTS)

Expand Down
6 changes: 0 additions & 6 deletions integration/admin-client-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
<name>Keycloak Admin REST Client Core</name>
<description>Jackson-agnostic core of the Keycloak Admin REST Client: resource interfaces, token management, and SPI.</description>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
4 changes: 3 additions & 1 deletion integration/admin-client-jackson3/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
</description>

<properties>
<maven.compiler.release>17</maven.compiler.release>
<maven.compiler.source>${java.adapter.jackson3.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.jackson3.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.jackson3.minimum.version}</maven.compiler.release>
<version.resteasy.jackson.provider>1.0.0.Final</version.resteasy.jackson.provider>
</properties>

Expand Down
6 changes: 0 additions & 6 deletions integration/admin-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
For the use by 3rd party applications, please use `org.keycloak:keycloak-admin-client` module.
</description>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.release>8</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.keycloak</groupId>
Expand Down
6 changes: 6 additions & 0 deletions integration/client-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<artifactId>keycloak-client-cli-parent</artifactId>
<packaging>pom</packaging>

<properties>
<maven.compiler.source>${java.server.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.server.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.server.minimum.version}</maven.compiler.release>
</properties>

<modules>
<module>admin-cli</module>
<module>client-cli-dist</module>
Expand Down
6 changes: 6 additions & 0 deletions integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
<artifactId>keycloak-integration-parent</artifactId>
<packaging>pom</packaging>

<properties>
<maven.compiler.source>${java.adapter.minimum.version}</maven.compiler.source>
<maven.compiler.target>${java.adapter.minimum.version}</maven.compiler.target>
<maven.compiler.release>${java.adapter.minimum.version}</maven.compiler.release>
</properties>

<modules>
<module>admin-client-core</module>
<module>admin-client</module>
Expand Down
6 changes: 0 additions & 6 deletions misc/db-compatibility-verifier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@

<packaging>maven-plugin</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down
6 changes: 0 additions & 6 deletions misc/theme-verifier/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@

<packaging>maven-plugin</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
Expand Down
6 changes: 0 additions & 6 deletions misc/vuln-to-issues/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@

<packaging>jar</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Loading
Loading
0