Postgresql dependency on com.ongres.scram - how to add to classpath?


I’m setting up keycloak (13) to use postgresql on CentOS 8. I’ve installed the postgresql-jdbc package which pulls in ongres-scram-client client.

I’ve created the modules/system/layers/keycloak/org/postgresql/main directory, in which I’ve created a symlink to /usr/share/java/postgresql-jdbc/postgresql.jar and a module.xml to define the module as described in the documentation. I’ve also updated the xml file to use a postgresql database.

Starting the server with this setup fails with the following error:

Caused by: java.lang.NoClassDefFoundError: com/ongres/scram/common/stringprep/StringPreparation
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(
at org.postgresql.core.ConnectionFactory.openConnection(
at org.postgresql.jdbc.PgConnection.(
at org.postgresql.Driver.makeConnection(
at org.postgresql.Driver.connect(
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(
… 67 more

So it seems the jar files for ongres need to be added as well.
So I’ve created:

/srv/keycloak-13.0.1/modules/system/layers/keycloak/com/ongres/scram/common/main in which I’ve added a symlink to /usr/share/java/ongres-scram/common.jar and a module.xml:

<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.3" name="com.ongres.scram.common">
        <resource-root path="common.jar"/>

Also a modules/system/layers/keycloak/com/ongres/scram/client/main directory with a symlink to /usr/share/java/ongres-scram/client.jar and a module.xml:

<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.3" name="com.ongres.scram.client">
        <resource-root path="client.jar"/>
        <module name="com.ongres.scram.common"/>

But the error remains. How can I add these dependencies to the classpath so I can connect to a postgresql database?